diff options
| author | Florian Fischer <gitlab@muhq.space> | 2023-08-29 16:46:50 +0000 |
|---|---|---|
| committer | Florian Fischer <gitlab@muhq.space> | 2023-08-29 16:46:50 +0000 |
| commit | 2751145b885aea02aabbc193af359da9cb9127e6 (patch) | |
| tree | d94e486f1dbcf4b31321169b1814490f97736e04 /init.lua | |
| parent | b1db5ae2a8aeeb72dca127e62d5cbf5b3c7caced (diff) | |
| parent | bd27a71ec294b5d388bc2c233d397a76c3f21cf2 (diff) | |
| download | vis-lspc-2751145b885aea02aabbc193af359da9cb9127e6.tar.gz vis-lspc-2751145b885aea02aabbc193af359da9cb9127e6.zip | |
Merge branch 'naive_documentChanges_support' into 'main'
try to convert workspaceEdit.documentChanges to plain changes
Closes #34
See merge request muhq/vis-lspc!44
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -499,7 +499,18 @@ end -- apply a WorkspaceEdit received from the language server local function vis_apply_workspaceEdit(_, _, workspaceEdit) local file_edits = workspaceEdit.changes - assert(file_edits) + assert(file_edits or workspaceEdit.documentChanges) + + -- try to convert NOT SUPPORTED TextDocumentEdit[] + -- We do not announce suppport for versioned DocumentChanges in our + -- client capabilities, but some LSP servers ignore our capabilities + -- sending them anyway. + if not file_edits then + file_edits = {} + for _, edit in ipairs(workspaceEdit.documentChanges) do + file_edits[edit.textDocument.uri] = edit.edits + end + end -- generate change summary local summary = '--- workspace edit summary ---\n' |
