-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Semantic highlighting changes colors of JSX tags #88911
Comments
Look like you need to change language from JavaScript to JavaScript React otherwise Just add next file association to you User config or only to project using "files.associations": {
"*.js": "javascriptreact"
} |
@IllusionMH thank you, but still not working. It's working just fine before with the default setup. So, unless there are some breaking changes on the latest update, I don't think we need to add additional settings just to work with JSX. Also as you can see in my demo, the syntax highlight is working for a few seconds, but then the color changed. |
Experiencing the same issue with |
Version: 1.42.0-insider Also experiencing the same issue, even with the |
Experiencing the same issue. Colors unfortunately disappear after few seconds. Same version as above. |
/confirmed After couple of reloads I was able to reproduce it too (even with TS@next) and in TSX files. May be related to #86390 ? |
Confirming this issue. Quitting the app and reloading the file fixes it but only for a few seconds. Any saves break the syntax colouring. |
Likely caused by semantic highlighting. Try setting |
@mjbvz yes, setting it to Are there plans to restore current (non-semantic) highlights for JSX and leave it for other places? |
I can confirm the fix suggested by @mjbvz works (thanks) |
Yeah, |
Would it be possible to add texmateRules options which override the rules for the semantic scope? At least for JSX/TSX files.. |
See https://github.com/microsoft/vscode/wiki/Semantic-Highlighting-Overview and will require #86390 to make it for JS/TS. |
So, is this a bug or a feature?
--
Benjamin Grelié
|
My bet is bug (or not yet implemented part) in the feature. vscode/extensions/html-language-features/server/src/modes/javascriptSemanticTokens.ts Lines 101 to 107 in 65ff40c
Doesn't have any types/modifiers to distinguish usage of class/function/variable in regular case or as JSX tag, therefore they are colored by their type, and special styling for JSX is lost. Since extension might provide custom types/modifiers it will be easy to add |
semantic coloring of the JSX tags was unintended. Fix 3c930f9 is in todays i-build. |
Thanks, looks better now! @aeschli is it intended that Version: 1.42.0-insider (user setup) Repro codeNew workspace with only import React from 'react';
const Custom = (props: { children?: any }) => <div></div>;
Custom.Nested1 = (props: { children?: any }) => <span></span>;
Custom.Nested2 = function (props: { children?: any }) { return <span></span>; };
function test() {
return (
<React.Fragment>
<span className="demo">demo</span>
<Custom>
<Custom.Nested1></Custom.Nested1>
<Custom.Nested2></Custom.Nested2>
</Custom>
</React.Fragment>
)
} |
@aeschli thank you so much |
I just pushed a fix for the qualified JSX names. |
Version: 1.42.0-insider
Commit: fd13e44
Date: 2020-01-17T16:30:38.851Z
Electron: 7.1.7
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.0.0
Steps to Reproduce:
.js
or.jsx
file.Check this link for the demo: https://imgur.com/3CkhTIn
As seen on the demo, the syntax highlight on the
<LatestBlog/>
and<div>
turned to plain color a few seconds after changing Color Theme.Here's a snippet for testing purpose:
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: