sublimelsp / LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin
MIT License
135 stars 11 forks source link

how to Generates parentheses when calling a function #113

Closed AirBashX closed 2 years ago

AirBashX commented 2 years ago

For example:

document.getElementsByName || document.getElementsByName()

rchl commented 2 years ago

This functionality is supported by the server but unfortunately ST doesn't allow us to utilize it. We'd need https://github.com/sublimehq/sublime_text/issues/3298 to be implemented for that to work.

rchl commented 2 years ago

I'll close this issue since it would have to be solved in LSP package instead if the ST API is implemented.

predragnikolic commented 2 years ago

LSP knows what lsp completion item is selected. So that would not be a problem.

This would not work only if the server is modifying the completion item textEdit or insertText in resolve request.

rchl commented 2 years ago

That's the case here. The extra data that we need is provided through the resolve request. We'd want to resolve that on focusing given completion in the list but we can't. In theory it would be possible to do that before completion is inserted but that introduces too much latency.