Skip to content

lsp: Use label as insertText as a last resort

Waqar Ahmed requested to merge work/lsp-comp-fix into master

Some servers don't send insertText but use textEdit instead. However, we changed the logic of using textEdit recently so that a textEdit's text would only override insertText if insertText was empty. We missed one thing though, the insertText was already overridden with "label" which is a display thing and isn't necessarily correct code. This breaks servers such as dart-analyzer.

To fix this, use label as a last resort. The logic is as follows now: -> read insertText -> If it is empty and we have a non-empty textEdit, use that -> If insertText is still empty, use label

Merge request reports

Loading