Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Initial support added for textDocument/documentHighlight - #1767

Merged
Jake Bailey (jakebailey) merged 6 commits into
microsoft:masterfrom
astenman:master
Mar 18, 2020
Merged

Jake Bailey (jakebailey) merged 6 commits into
microsoft:masterfrom
astenman:master

Conversation

@astenman

@astenman astenman commented Nov 7, 2019

Copy link
Copy Markdown
Contributor

Change-Id: Ib13d86bc96a3702b0e0d79b27b7791898388e104

Since I am using this language server in emacs, it would be nice to have support for textDocument/documentHighlight.

The added functionality only looks for related items in the current file.

Change-Id: Ib13d86bc96a3702b0e0d79b27b7791898388e104
@msftclas

Microsoft Contribution License Agreements (msftclas) commented Nov 7, 2019 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending it, what you have so far looks good. The other "sources" we have (completion, hover, references, etc), have tests written, so it'd be appreciated it you could add those to keep things tested.

Change-Id: I411c1d4daac84a6a12a95b11fa5781eaf42eeae9
@astenman

astenman commented Nov 8, 2019

Copy link
Copy Markdown
Contributor Author

Good point. I have added a test file with two simple tests.

Change-Id: I77908a16e6c230c14fb790a4f47a58e55303c273

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Just a few style comments. A preview of this in action:

image

Note how it picks the correct x. Previously, VS Code would just find any x and say "this is x".

Comment thread src/LanguageServer/Impl/Sources/DocumentHighlightSource.cs Outdated
Comment thread src/LanguageServer/Impl/Sources/DocumentHighlightSource.cs Outdated
Comment thread src/LanguageServer/Impl/Sources/DocumentHighlightSource.cs Outdated
Change-Id: If45beeafc9a40af5ac12b79d124c8021e9e492a9
@astenman

astenman commented Nov 13, 2019 via email

Copy link
Copy Markdown
Contributor Author

@jakebailey

Copy link
Copy Markdown
Member

Ah, I understand. This PR looks good to me, though I'm going to want to hold off on merging it immediately (extension release soon, so we're trying to keep things to bugfixes to limit risky changes).

…-server

Change-Id: Id27143262e6389aa1ec1f434c39b1e32bf7563cf

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in reviewing and merging this. LGTM.

@jakebailey

Copy link
Copy Markdown
Member

Will merge once I have done a little bit of testing.

@jakebailey
Jake Bailey (jakebailey) merged commit 1a9d6e5 into microsoft:master Mar 18, 2020
@astenman

Copy link
Copy Markdown
Contributor Author

Thanks!

Mikhail Arkhipov (MikhailArkhipov) pushed a commit that referenced this pull request Jun 15, 2020
* Initial support added for textDocument/documentHighlight

Change-Id: Ib13d86bc96a3702b0e0d79b27b7791898388e104

* Added two tests for DocumentHighlightSource

Change-Id: I411c1d4daac84a6a12a95b11fa5781eaf42eeae9

* Code refactoring according to comments from reviewer

Change-Id: If45beeafc9a40af5ac12b79d124c8021e9e492a9

Co-authored-by: Anders Stenman <anders.stenman@niradynamics.se>
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
(cherry picked from commit 1a9d6e5)
Mikhail Arkhipov (MikhailArkhipov) pushed a commit that referenced this pull request Jun 15, 2020
* Initial support added for textDocument/documentHighlight

Change-Id: Ib13d86bc96a3702b0e0d79b27b7791898388e104

* Added two tests for DocumentHighlightSource

Change-Id: I411c1d4daac84a6a12a95b11fa5781eaf42eeae9

* Code refactoring according to comments from reviewer

Change-Id: If45beeafc9a40af5ac12b79d124c8021e9e492a9

Co-authored-by: Anders Stenman <anders.stenman@niradynamics.se>
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
(cherry picked from commit 1a9d6e5)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants