intersystems / language-server

Repository for the VS Code Language Server
https://marketplace.visualstudio.com/items?itemName=intersystems.language-server
Other
16 stars 6 forks source link

In instance methods, should get auto-completion for i% properties #292

Closed isc-kiyer closed 9 months ago

isc-kiyer commented 9 months ago

In instance methods, to access the true value of a property (bypass the getters and setters), the i% syntax is used. There is autocompletion for .. syntax but not for i% syntax. This is a request to add autocompletion of class properties when using the i% syntax.

isc-bsaviano commented 9 months ago

@isc-kiyer I can add completion, hover and definition support for this pretty easily, but there is one issue. Having the completion trigger automatically requires adding "%" as a trigger character. I don't want to do that because "%" appears very often and this would cause existing completions to "disappear" when a "%" is typed (for example, in a class name or method name). What I'll do is add the support anyways, but you'll have to manually trigger it using Ctrl-Space after you type "i%".

isc-kiyer commented 9 months ago

@isc-bsaviano That sounds good! Is it possible to have a "trigger string" instead of a trigger character? Then you could trigger on "i%" instead which would only show up in instance methods. Also, the completion should only occur in instance methods since i% variables are not available in other contexts.

isc-bsaviano commented 9 months ago

Only single characters are allowed AFAICT.