onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.36k stars 300 forks source link

editsToUse are deeper in LSP WorkspaceEdit response #2647

Closed Siprj closed 5 years ago

Siprj commented 5 years ago

Edits are actually stored in changes field in WorkspaceEdit; see: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md#workspaceedit

Resolves: #2646

codecov[bot] commented 5 years ago

Codecov Report

Merging #2647 into master will increase coverage by <.01%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2647      +/-   ##
=========================================
+ Coverage   45.79%   45.8%   +<.01%     
=========================================
  Files         361     361              
  Lines       14625   14624       -1     
  Branches     1924    1924              
=========================================
  Hits         6698    6698              
+ Misses       7697    7696       -1     
  Partials      230     230
Impacted Files Coverage Δ
browser/src/Services/Workspace/Workspace.ts 23.4% <0%> (+0.24%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7431882...afbbe58. Read the comment docs.

akinsho commented 5 years ago

@Siprj thanks for looking into this and raising a PR, I noticed this a part of #1717 but got bogged down with other changes, I wonder re. the change if you could swap the variable to work as follows:

 const editsToUse = edits.documentChanges
            ? convertTextDocumentChangesToFileMap(edits.documentChanges)
            : edits.changes

It's a small change but the re-assignment using let is a little more verbose and this was the change I was gonna (eventually) propose in #1717 (which would help me out as it would reduce conflicts there

Siprj commented 5 years ago

@Akin909 Done.