-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the completion trigger character conditional #1413
Comments
@jdneo I do not believe this is possible. This question/request may be more appropriate for the microsoft/language-server-protocol repository. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@jrieken has this come up in VS Code ? |
The lua-language-server achives the similar functionality. |
Share one more information. I observed the Currently in Java, we are planning to add |
In ycmd triggers were always regex based. LSP using a single character has always seemed limiting (think, even c I think a protocol supported regex trigger would be better. Or just press a manual trigger. |
Yes, it has come up in the past but not in recent years. I believe extension use the last character of their words like |
I'm against regular expressions. I think there are many dialects and some clients cannot handle it. The advantage of a single character is that it can be handled by the editor's keypress handler. |
FWIW, these are the regex triggers that ycmd uses by default. We add the 'trigger characters' provided by LSP servers to these lists dynamically: https://github.com/ycm-core/ycmd/blob/master/ycmd/completers/completer_utils.py#L180-L211 (for some languages we actually ignore them, as they are inferior in practice to our hard-coded ones). The LSP already includes a regular expression syntax, defined to be some subset of javascript's (https://microsoft.github.io/language-server-protocol/specifications/specification-current/#regExp). Anyway, I do tend to agree that is somewhat unfortunate and in practice (as you see above) most expression are just "multiple characters" rather than actually complex expressions. Perhaps the 'trigger characters' could be augmented with alternative "trigger prefixes" which is to say "Trigger if the prefix at the current cursor position matches these characters". The challenge there is that the "whitespace" trigger that prompted this request no longer works if you enter multiple spaces as in |
This is a feature request to make the completion trigger character take effect conditionally.
Considering the following Java code:
When user enter the
space
, it would be helpful to show a completion list. This behavior can be observed in other IDEs:But simply adding
space
to the trigger characters could be a problem because not everyspace
needs to follow a completion action.Is it possible to make it conditional? For example, only taking effect when there is a
"new"
beforespace
.The text was updated successfully, but these errors were encountered: