Skip to content
Commit 204b214c authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

lsp: Use label as insertText as a last resort

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

(cherry picked from commit f18000bc)
parent 7cfaa70e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment