languageserver
languageserver copied to clipboard
Disable matching parenthesis in autocompletion
I was wondering if there was any way to disable the parenthesis matching in the autocompletion feature?
Example: in the text editor type prin then hit tab you will get print() and I would like to have the option to get print( instead.
Note: I am working in VScode and I am assuming that the autocompletion feature comes from languageserver not vscode-R
Yes, this behavior comes from #168, and we could use an option to choose from the three possible behaviors: inserting plain text f or f(, or inserting snippet f($0). What do you think, @randy3k ?
It is always unclear to me whether the server settings should be retrieved from .Rprofile options. While it is a canonical way to specify user settings in R, a more standard way in LSP to do so is to use initializationOptions or workspace/didChangeConfiguration.
Put aside this, I agree that .Rprofile options would be a bit approachable for general R users. I believe that we could add an option for inserting parentheses after function completions as what RStudio does.

Though I am not sure about the auto-matching of the closing parenthesis, it seems that it is also related to one's editor settings.
By the way, it is better to display print() instead of print if the completion is going to be print($0)?
It is always unclear to me whether the server settings should be retrieved from .Rprofile options. While it is a canonical way to specify user settings in R, a more standard way in LSP to do so is to use initializationOptions or workspace/didChangeConfiguration.
I prefer putting languageserver settings in .Rprofile because it makes more sense to apply to all clients if user has multiple editors, and some settings requires code to be provided (e.g. languageserver.formatting_style.
I believe that we could add an option for inserting parentheses after function completions as what RStudio does.
In RStudio, when Insert parentheses after function completions is enabled, it will insert foo() if Insert matching parens/quotes is also enabled or foo( if not, or otherwise it will insert plain foo.
If we are to add an option like Insert parentheses after function completions, then user could only choose from foo or foo(), without foo( as @intiben requested? I'm also not sure if it has anything to do with editor's auto matching parens.
By the way, it is better to display
print()instead of print if the completion is going to beprint($0)?
I prefer the standard way of most LSP (C/C++, C#, Python, etc.) and RStudio do that the label is not necessarily the text to be inserted or it would be too noisy to see a lot of foo() in the completion list and the function is given the function icon.
I prefer the standard way of most LSP (C/C++, C#, Python, etc.) and RStudio do that the label is not necessarily the text to be inserted or it would be too noisy to see a lot of foo() in the completion list and the function is given the function icon.
👌
It does seem that both pyls and ccls show foo() in their labels. Correct me if I am wrong.