Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Implement textDocument/rename #251

Merged
merged 2 commits into from
May 15, 2017
Merged

Implement textDocument/rename #251

merged 2 commits into from
May 15, 2017

Conversation

felixfbecker
Copy link
Contributor

@tomv564 I split out the rename feature in a separate PR

@felixfbecker
Copy link
Contributor Author

@tomv564 could you give this a review?

@codecov
Copy link

codecov bot commented May 15, 2017

Codecov Report

Merging #251 into master will increase coverage by 0.33%.
The diff coverage is 80.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #251      +/-   ##
==========================================
+ Coverage   57.83%   58.16%   +0.33%     
==========================================
  Files          13       13              
  Lines        2056     2087      +31     
  Branches      340      345       +5     
==========================================
+ Hits         1189     1214      +25     
- Misses        731      734       +3     
- Partials      136      139       +3
Impacted Files Coverage Δ
src/util.ts 75.17% <100%> (+0.35%) ⬆️
src/typescript-service.ts 69.95% <79.31%> (+0.6%) ⬆️

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 61edbfa...14a08f7. Read the comment docs.

@felixfbecker felixfbecker mentioned this pull request May 15, 2017
3 tasks
@tomv564
Copy link
Contributor

tomv564 commented May 15, 2017

Can you explain what function the JSONPTR serves? I am guessing something to do with streaming unrequested payloads to the client?

@felixfbecker
Copy link
Contributor Author

JSONPTR is just a template string tag to help escaping JSON Pointers.

If you mean streaming (which works with JSON Patches) in general, see microsoft/language-server-protocol#182

@felixfbecker
Copy link
Contributor Author

Does this work for you otherwise?

@tomv564
Copy link
Contributor

tomv564 commented May 15, 2017

Can you explain what json pointers mean in the context of the changes being sent to the client? This is the first place that uses them, so I am curious what they point to and why!

The rest looks OK!

@felixfbecker
Copy link
Contributor Author

Streaming works through JSON Patches, which contain a path property that is a JSON Pointer to point to the property in the JSON document to change:

Additionally, operation objects MUST have exactly one "path" member.
That member's value is a string containing a JSON-Pointer value
[RFC6901] that references a location within the target document (the
"target location") where the operation is performed.

https://tools.ietf.org/html/rfc6902#section-4

They are already used in every method as the path property, but rename is the first method where the path is dynamic because it's a URI -> change dictionary. Since URIs contain slashes, and slashes are reserved in JSON Pointers, they need to be escaped.

@tomv564
Copy link
Contributor

tomv564 commented May 15, 2017 via email

@felixfbecker felixfbecker merged commit 6436c74 into master May 15, 2017
@felixfbecker felixfbecker deleted the rename branch May 15, 2017 16:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants