Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] Template code completion using ${line_selection} and ${word_selection}

Hi,
I have implemented an editor with code completion. I have also defined several templates.
In encountered some issues with the ones using provided selections variables:
  • ${line_selection}
  • ${word_selection}
When I trigger completion on a selection, templates are simply  not available. Browsing the code at ScriptTemplateCompletionProcessor#computeCompletionProposals. It appears that templates are not provided when user did not start typing a valid identifier. In the case of selections, most of the time selections are not identifiers but statements.
I overridden ScriptTemplateCompletionProcessor#isValidPrefix(String prefix) to circumvent this problem. Even so, selected template is inserted after initial selection.

So I have a few questions.
Am I doing it right?
Should I file a bug?
Is it a language specific feature?

Cheers


Back to the top