Language Server CompletionItem additional edit/command support

Currently, to my knowledge, Nova doesn’t support additional text edits or commands in a language server protocol CompletionItem (spec). This means features like auto-import on autocomplete don’t work, as discussed in Automatically add missing imports · Issue #52 · apexskier/nova-typescript · GitHub.

It would be great to have support for this LSP feature added!

3 Likes

This would be awesome. Especially when creating lots of TSX based on a library of reusable components, being able to auto-import modules as you type and then immediately continue working on their props is great for the coding flow.

Super happy both with Nova and the TS extension so far, by the way. :+1:

2 Likes

Nova does support additionalTextEdits, since Nova 4, if I remember correctly. command, however, is not yet supported. If you are noticing that the former is not working, I can definitely investigate!

1 Like

+1 for Nova being able to handle completionItem/resolve commands, and specifically that it can resolve the additionalTextEdits property. As apexskier notes, my extension’s language server uses this ability for offering not-yet-imported symbols for completions, and then auto-importing the symbol when the completion is selected.

1 Like

This is still a requested feature.

To provide a bit more info, this is more complicated than Nova supporting additionalTextEdits for completionItems. Added in the 3.16 spec, it’s a way for servers to lazily provide completionItems to be more efficient. The idea is that when a user selects a completionItem, Nova would send a completionItem/resolve request and augment the selected completionItem with the returned data (in this case with additionalTextEdits). Nova would also need to declare this client capability in completionItem#resolveSupport.

3 Likes