pmizio / typescript-tools.nvim

⚡ TypeScript integration NeoVim deserves ⚡
MIT License
1.26k stars 36 forks source link

completeFunctionCalls adds brackets when writing JSX #239

Open m-gail opened 4 months ago

m-gail commented 4 months ago

If you set the option complete_function_calls to true, brackets will also be added when completing JSX, even though JSX elements are not called as functions.

tstools

The expected behavior should be to not complete function calls in JSX markup. For example, in VS-Code it would work like this:

vscode

m-gail commented 4 months ago

After some testing I found a few other instances where completeFunctionCalls works incorrectly, for example in import statements or destructuring objects. The problems are the ones handled by this function in typescript-language-server: https://github.com/typescript-language-server/typescript-language-server/blob/983a6923114c39d638e0c7d419ae16e8bca8985c/src/completion.ts#L326 I think typescript-tools.nvim should behave the same as typescript-language-server here