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

Disable automatic highlighting of current token/word? #5351

Closed
leeoniya opened this issue Apr 15, 2016 · 25 comments
Closed

Disable automatic highlighting of current token/word? #5351

leeoniya opened this issue Apr 15, 2016 · 25 comments
Assignees
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@leeoniya
Copy link

Sorry if this has been asked before (I couldn't find it in any issues containing "highlight").

Is it possible to disable automatic highlighting of the current token/word without also disabling match-highlight for explicit selections via "editor.selectionHighlight": false?

Thanks!

  • VSCode Version: 1.0.0-insider
  • OS Version: Win10

auto-highlight

@alexdima
Copy link
Member

I think editor.selectionHighlight does not stop semantic highlighting, so I don't think we have any option to disable semantic highlighting (from https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts#L120)

@leeoniya
Copy link
Author

I think editor.selectionHighlight does not stop semantic highlighting

Right, it shouldn't. But an additional option to disable this would be very welcome.

@leeoniya
Copy link
Author

leeoniya commented Jun 2, 2016

@alexandrudima any updates?

Seems like an easy feature to add, let me know if there's any interest or if you'd like a pull request for this.

@alexdima
Copy link
Member

alexdima commented Jun 6, 2016

👍 on a PR. You can add a new editor option and use it in https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts#L120 -- that is where we do the call to do semantic word highlighting to language servers.

@Bill-Stewart
Copy link

+1 - I like selected matches to be highlighted, but I would like to be able to disable automatic keyword highlighting.

@PierBover
Copy link

This is really annoying visually.

Also in most themes there's barely a visual difference between a highlighted word and a selected one.

@Bill-Stewart
Copy link

I agree @PierBover. Please react  on the top post to raise its profile.

@leeoniya
Copy link
Author

@aeschli plz put this on your radar in case you'll be working on WordHighlighter for #12973

@jitendravyas
Copy link

any solution to this ?

@realuser
Copy link

+1

@alexdima alexdima added the feature-request Request for new features or functionality label Mar 1, 2017
@alexdima alexdima added this to the March 2017 milestone Mar 1, 2017
@alexdima
Copy link
Member

alexdima commented Mar 1, 2017

Added editor.occurrencesHighlight that can be set to false to turn this off. Will be available in tomorrow's insiders build and in the March stable release (i.e. not the one going out in the next few days)

@Bill-Stewart
Copy link

Thank you @alexandrudima !

@leikind
Copy link

leikind commented Apr 6, 2017

Having read this discussion a few times I assumed that setting editor.selectionHighlight to true and editor.occurrencesHighlight to false would result in the behavior I need: no automatic selection of a word where the cursor is, and a working selection once I select the whole word. But no, in fact, I don't see how editor.occurrencesHighlight changes anything at all, and editor.selectionHighlight turns highlighting off/on completely.

Still highlighting words automatically when the cursor is:

screen shot 2017-04-06 at 11 51 59

  • VSCode Version: 1.11.0
  • OS Version: MacOS 10.12.4

@nevcook
Copy link

nevcook commented Apr 7, 2017

Same for me.
I also gather from the discussion above, the same conclusion that leikind came to, but I've just installed the latest update (1.11.1) and setting "editor.occurrencesHighlight": false seems to have no effect at all.

Language: Go
VSCode: 1.11.1
OS: Windows 10

@realuser
Copy link

realuser commented Apr 7, 2017

I also am experiencing that setting "editor.occurrencesHighlight": false in user settings appears to have no effect on word highlighting in VSCode: 1.11.1.

If the cursor is on a word, all occurrences of that word are still highlighted.

@leikind
Copy link

leikind commented Apr 8, 2017

@alexandrudima Since "editor.occurrencesHighlight": false does not have any effect for at least 3 users, shouldn't this ticket be re-opened?

@sullerandras
Copy link

Support for occurrencesHighlight seems to be language and extension dependent. On a freshly installed VSCode 1.11.1 with no extensions, changing editor.occurrencesHighlight: false only had effect for .js files, it didn't change anything for .rb, .sql or .py (i didn't try more file types).

After installing the recommended "Ruby" extension, highlighting occurrences is always disabled for Ruby files, changing the occurrencesHighlight flag doesn't have any effect.

Installing the recommended "Python" and "mssql" extensions didn't change anything for those file types, occurrences are always highlighted.

@leikind
Copy link

leikind commented Apr 9, 2017

@sullerandras
I installed the Ruby extension and found out that no matter how I set editor.occurrencesHighlight, words in a Ruby file are never highlighted when the cursor is on a word. Contrary to, say, a plain text file when words are always highlighted no matter how I set editor.occurrencesHighlight.

@alexdima
Copy link
Member

alexdima commented Apr 10, 2017

Thank you for the feedback. For cases where no extension registers a document highlight provider, the selection highlighter compensates and highlights whole words. This can happen for any language where we don't ship with such a document highlight provider (e.g. ruby, sql, python).

I've extracted this to #24426

@dheerajwebkul
Copy link

Updated my vscode to V1.11.2,
and still
"editor.occurrencesHighlight": false,

is not working to stop highlight semantic symbol occurrence. :(

@nevcook
Copy link

nevcook commented Apr 21, 2017

Was this fix released in VS Code v1.11.2, or is the release of this change still pending?
I ask because for me also, it is still not working.

Language: Go
VSCode: 1.11.2
OS: Windows 10

@leikind
Copy link

leikind commented Apr 21, 2017

Nothing has changed in 1.11.2.

"editor.occurrencesHighlight": false has no effect.

Language: plain text
VSCode: 1.11.2
OS: MacOS

@maddox
Copy link

maddox commented Apr 21, 2017

Same issue, "editor.occurrencesHighlight": false has no effect.

Language: ruby
VSCode: 1.11.2
OS: macOS

@nbourguig
Copy link

Same issue, "editor.occurrencesHighlight": false has no effect.

Language: javascript
VSCode: 1.11.2
OS: macOS

@realuser
Copy link

realuser commented Apr 22, 2017

My understanding is that this issue was moved to this issue: #24426 and that issue was fixed but will not appear until the April 2017 milestone which closes April 30, 2017.

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 verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests