Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to word highlighting when contributions don't provide document highlights #12973

Closed
bgashler1 opened this issue Sep 29, 2016 · 13 comments
Assignees
Labels
feature-request Request for new features or functionality html HTML support issues
Milestone

Comments

@bgashler1
Copy link
Contributor

bgashler1 commented Sep 29, 2016

  • VSCode Version: Insiders
  • OS Version: Windows 10

Regarding test plan item #12100

Steps to Reproduce:

  1. May not be a problem, but just filing this issue to be safe. I'm looking at an old version of VS Code site that was originally written in Razor. It's the example-word-count.cshtml file https://github.com/Microsoft/vscode-website/tree/3cfa8213681f680418997c7671fa1b8c452ac2af
  2. Try clicking on the class name updateWordCount pictured below on line 79 and note that it doesn't match the symbol with a highlight like it does in Stable today as shown in the picture.

Left is Insiders. Right is Stable.
screen shot 2016-09-28 at 10 48 18 pm

@dbaeumer
Copy link
Member

Word highlight is broken in CSHTML. Not sure if this should be the normal word highlight or whether this is a language word highlighter.

@sandy081
Copy link
Member

I see word highlighting is broken for HTML, CSHTML and HandleBars

Since, HTML has been extracted into a separate language server and this functionality has been lost. Moving to October.

This has to be documented as limitation in release notes

@sandy081 sandy081 modified the milestones: October 2016, September 2016 Sep 30, 2016
@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug html HTML support issues labels Sep 30, 2016
@sandy081 sandy081 removed their assignment Sep 30, 2016
@sandy081 sandy081 changed the title Symbol match highlight not working in Razor possibly? Word highlighting is not working in HTML / Razor / Handlebar Sep 30, 2016
@felixfbecker
Copy link
Contributor

#1751?

@aeschli
Copy link
Contributor

aeschli commented Oct 11, 2016

The html extension registers a document highlighter provider. This seems to prevent the default word highlighting. The same seems to happen in TypeScript: Select a word in a comment does not highlight it. Handing over to @jrieken.

@aeschli aeschli assigned jrieken and unassigned aeschli Oct 11, 2016
@jrieken
Copy link
Member

jrieken commented Oct 12, 2016

It seems like that was done on purpose by @alexandrudima - see: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/find/common/findController.ts#L814

Waiting for him to comment

@aeschli aeschli assigned aeschli and unassigned jrieken and alexdima Oct 13, 2016
@aeschli
Copy link
Contributor

aeschli commented Oct 13, 2016

IMO this must be fixed. It's a regression for the HTML mode which no longer shows word highlighting for anything but tags (which are served by a document highlight symbol provider).
To not interfere makes sense for all locations where there are already results by a document highlight provider. For locations without any results, it would be nice if regular word matches show.

@aeschli aeschli assigned jrieken and alexdima and unassigned aeschli Oct 13, 2016
@jrieken jrieken removed their assignment Oct 13, 2016
@jrieken
Copy link
Member

jrieken commented Oct 13, 2016

Not really sure what you mean @aeschli. Yes, we have no more nested modes and lost smart highlight for embedded languages, the rest is driven by the word def, or by the implementation your extension provides.

@aeschli
Copy link
Contributor

aeschli commented Oct 13, 2016

I verified that my word regex is now correct. As you observed in your comment above (https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/find/common/findController.ts#L814), word highlighting is skipped if there is a highlight provider.
IMO word highlighting should not be skipped if none of the highlight providers has any results.

@alexdima
Copy link
Member

alexdima commented Oct 24, 2016

Yes, this must be fixed by the DocumentHighlightProvider aka the HTML extension.

The principle is very simple: if there is a semantic highlighter, do not do a stupid word highlight if the selection is collapsed. If there is a real selection, then the selection highlighter kicks in.

@aeschli The same was happening before, the html worker used to have code in place to fall back to word highlighting.

@alexdima alexdima assigned aeschli and unassigned alexdima Oct 24, 2016
@aeschli
Copy link
Contributor

aeschli commented Oct 27, 2016

@alexandrudima So I'd reimplement what the default (aka stupid) word highlighter does in the html extension. And if there's another extension that adds a smarter highlighter provider that also has some highlighting for the words I don't support, that will conflict with the 'stupid' ones the HTML extension would provide.
IMO it would be better if the default behaviour is done by VSCode:
If no provider gives any result on a given empty selection, then provide a default highlight.

@aeschli aeschli modified the milestones: November 2016, October 2016 Oct 27, 2016
@alexdima
Copy link
Member

@aeschli Please do as you wish, as far as I'm concerned you are free to take ownership of SelectionHighlighter and WordHighlighter, and issues associated with them.

@aeschli
Copy link
Contributor

aeschli commented Oct 12, 2017

It was a behaviour change, but we haven't had many complaints about it since then.
Changing to 'feature-request'

@aeschli aeschli added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Oct 12, 2017
@aeschli aeschli changed the title Word highlighting is not working in HTML / Razor / Handlebar Fallback to word highlighting when contributions don't provide document highlights Oct 12, 2017
@aeschli
Copy link
Contributor

aeschli commented Nov 22, 2017

Closing as there have been no complaints about the new behaviour.

@aeschli aeschli closed this as completed Nov 22, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality html HTML support issues
Projects
None yet
Development

No branches or pull requests

7 participants