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

JSX tag highlighting broken #65921

Closed
BrentonWatt opened this issue Dec 13, 2018 · 16 comments
Closed

JSX tag highlighting broken #65921

BrentonWatt opened this issue Dec 13, 2018 · 16 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues typescript Typescript support issues verified Verification succeeded

Comments

@BrentonWatt
Copy link

  • VSCode Version: 1.30
  • OS Version: Mac OS 10.14.2

Previously when selecting an opening tag in any JSX only the corresponding closing tag would be highlighted. As of version 1.30 (November) ALL corresponding JSX tags are highlighted across the file. I.e If you select any opening View tag for example, all View tags across the file are highlighted. It's almost like the tags are being treated like variables.

Steps to Reproduce:

  1. Open any JS file with JSX, in my case I was working with React Native JSX
  2. Click on any opening tag

Does this issue occur when all extensions are disabled?: Yes

screenshot 2018-12-13 at 09 29 49

@sunnyday90210
Copy link

sunnyday90210 commented Dec 13, 2018

  • VSCodeInsiders Version: 1.31.0-insider (user setup)
  • Windows 10 Pro: 10.0.17763 Build 17763

I am experiencing the same issue.
When highlighting any tags in the jsx file vscode seems to select all corresponding tags that are the same.
screenshot_1

Small workaround for now until this is fixed I am using Highlight Matching Tag it supports jsx.

@Muljayan
Copy link

I have the same issue when working with a plain react app. I am using Ubuntu 18.10 .

@sjnonweb
Copy link

Confirming the same! Tried disabling/uninstalling all extensions still this issue is happening. For now i have rolled back to 1.29.1

@mjbvz mjbvz transferred this issue from microsoft/vscode Dec 14, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Dec 14, 2018

Actually this, may be a VS Code api usage issue. We changed to use references for highlighting since the occurrences api is marked deprecated

@DanielRosenwasser Opinions on the what we should do here?

@DanielRosenwasser
Copy link
Member

I don't think that there's a practical difference; getOccurrencesAtPosition just filters out entries that didn't come from the file being asked about. For all intents and purposes, it's the same as getDocumentHighlights with a different output format. It's only a legacy API because old versions of Visual Studio were throwing exceptions for spans outside the current file.

@onur-dev
Copy link

Same problem here...

@uniqueiniquity
Copy link

@mjbvz it seems like you should be using documentHighlights rather than references here; this particular issue is explicitly handled already. Is there a particular reason you're inclined to use references instead?

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jan 2, 2019

Oh jeez, yes. Ben is right. Otherwise you're missing out on some handy specific functionality that we did for occurrences/documentHighlights.

image

image

@mjbvz mjbvz transferred this issue from microsoft/TypeScript Jan 2, 2019
@mjbvz mjbvz added this to the December/January 2019 milestone Jan 2, 2019
@mjbvz mjbvz self-assigned this Jan 2, 2019
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Jan 2, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Jan 2, 2019

Thanks @DanielRosenwasser. Didn't realize this TS Server API existed. I'll update VS Code to use it

@mjbvz mjbvz added typescript Typescript support issues javascript JavaScript support issues labels Jan 2, 2019
@mjbvz mjbvz closed this as completed in 44b5a77 Jan 2, 2019
@Muljayan
Copy link

Muljayan commented Jan 11, 2019

@mjbvz @DanielRosenwasser I am still getting this issue on Ubuntu 18.10 , vs-code version 1.30.2. Is the fix scheduled to be in a later update ?

@vrubliuk
Copy link

The same issue is on Windows 10, (VS code 1.30.2)

@7nights
Copy link

7nights commented Jan 14, 2019

Still having this issue on Mac, VS Code 1.30.2.
Just reverted to 1.29 and tag matching works fine for me. @Muljayan @vrubliuk

@DanielRosenwasser
Copy link
Member

It's been 13 days since the fix - just use the insiders releases in the meantime.

@7nights
Copy link

7nights commented Jan 30, 2019

@DanielRosenwasser As for a software that needs to be used at daily work, pushing user into insiders channel is not a good idea. I think you should never tell people to switch to a insiders release for getting a fix (because they may get several new bugs at the same time), instead you should release a patch to the stable channel. After all it has been one and a half month since the bug was released 😢

@octref octref added the verified Verification succeeded label Feb 1, 2019
@Muljayan
Copy link

Muljayan commented Feb 7, 2019

This is fixed in the latest updated.

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues typescript Typescript support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests