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

Wrong color of console.log token #104616

Closed
tafelito opened this issue Aug 14, 2020 · 21 comments
Closed

Wrong color of console.log token #104616

tafelito opened this issue Aug 14, 2020 · 21 comments
Assignees
Labels
*as-designed Described behavior is as designed grammar Syntax highlighting grammar javascript JavaScript support issues

Comments

@tafelito
Copy link

tafelito commented Aug 14, 2020

Version: 1.48.0
Commit: db40434
Date: 2020-08-13T08:03:27.059Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.5.0

Steps to Reproduce:

this is a follow up of #91818

image

this was working fine before I updated to v1.48

editor.semanticHighlighting is disabled

I'm using the theme

image

Before the update the console was yellow

Changing the tokenColorCustomizations to this doesn't do anything

"textMateRules": [
        {
          "scope": ["meta.function-call"],
          "settings": {
            "foreground": "#FFCB6B"
          }
        }
      ]

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

@weinand weinand removed their assignment Aug 14, 2020
@Tyriar Tyriar assigned mjbvz and unassigned Tyriar Aug 14, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Aug 15, 2020

Can you please explain why the color is wrong?

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Aug 15, 2020
@alesbolka
Copy link

alesbolka commented Aug 15, 2020

Before:
pre-patch
Now:
after-patch

Before the patch the console would be highlighted as any other native function or reserved word, like const or require. Now it gets highlighted as a regular object / variable.

@tafelito
Copy link
Author

image

this is with version 1.47

@fysser
Copy link

fysser commented Aug 15, 2020

I got same problem with Palenight Theme after update to version 1.48, console entries now became poorly visible among other code, console word was yellow previously

console

@evenfrost
Copy link

Same for me. Console logs are hardly distinguishable now.

@mjbvz
Copy link
Collaborator

mjbvz commented Aug 17, 2020

Thanks for the explanation.

The previous coloring was incorrect and was coming from the support.class rule (console is not a class). We fixed this for #101802. I don't plan on reverting this fix as it makes the grammar more consistent. I understand it's been this way for a while and you have gotten used to specific colors but the new behavior better for the grammar long term

If you want proper distinct colorization for console, please file a feature request against typescript so that semantic coloring can identify calls to console

@mjbvz mjbvz closed this as completed Aug 17, 2020
@mjbvz mjbvz added *as-designed Described behavior is as designed grammar Syntax highlighting grammar javascript JavaScript support issues and removed info-needed Issue requires more information from poster labels Aug 17, 2020
@skiv71
Copy link

skiv71 commented Aug 21, 2020

Why can we not have what we have before? At least it was correct.

@skiv71
Copy link

skiv71 commented Aug 21, 2020

This should not be closed, the issue still exists AND wasn't broke before

@skiv71
Copy link

skiv71 commented Aug 21, 2020

Ok, so the original implementation, whilst correct, was done wrong. Methods and classes like console, which are system etc. should be in reserved colouring

@mjbvz
Copy link
Collaborator

mjbvz commented Aug 21, 2020

As mentioned, please open an issue against TypeScript if you want console colored in a special way. Or put together an injection grammar extension that does this

We're not going to intentionally make the grammar incorrect again

@goliafrs
Copy link

Why we need to make a issue for typescript, if the problem concerns not it?

The problem is that you have taken away from us the ability to specify the color for a specific token.
And this token is quite global, and if you lose sight of it in the code, then there may be problems in the code on production servers, so data leakage may occur due to a banal oversight.
Yes, you can set the linter (e.g. eslint) on the console, but it shouldn't be a solution to a simple line in the editor's visual theme.
If you care about grammar, the console is an object (at least in JavaScript).

Add a token support.objects.console.XXX, and everyone will be happy.
Instead of the first key support you can add any other words you want.

Just add a token, that's all we ask, why complicate...

P.S. I love VS Code, i think it's best code editor in world. And i make theme for him, and the code becomes clearer and more readable with it, but from now I lose the ability to customize my theme and it's sad.
P.S.S. Sorry about my English.

@skiv71
Copy link

skiv71 commented Aug 24, 2020

Lost interest in this, yes its open source, but the mindset is typical microsoft.

@skiv71
Copy link

skiv71 commented Aug 24, 2020

Incidentally, found a fix... use a pre 1.48 vscodium... god no idea how much microsoft suck... windows 10, yay... hahaha

@bantingGamer
Copy link

bantingGamer commented Aug 27, 2020

Finally found a workaround for this issue.

you have to enable semanticHighlighting and then add a property that will change the color manually

create a folder called .vscode
create a file called settings.json
add the following code:

{
  "editor.semanticTokenColorCustomizations": {
    "enabled": true,
    "rules": {
      "variable.defaultLibrary": "#4EC9B0"
    }
  }
}

hope this helps peeps in distress 😝

@gjsjohnmurray
Copy link
Contributor

hope this helps peeps in distress

@bantingGamer good tip. Looks like the variable.defaultLibrary semantic token arrived in #91090 and @aeschli made the TS/JS semantic colorer assign it in aeschli/typescript-vscode-sh-plugin@8582a31

@gjsjohnmurray
Copy link
Contributor

create a folder called .vscode
create a file called settings.json
add the following code:
...

As an alternative to setting this in each folder's .vscode subfolder you can do it at the user level. One way is to run the Preferences: Open Settings (JSON) command.

@tafelito
Copy link
Author

enabling semanticTokenColorCustomizations also changes a bunch of other stuff that I don't really want. I don't think that's a viable solution

@adamreisnz
Copy link

adamreisnz commented Aug 28, 2020

@mjbvz

The previous coloring was incorrect and was coming from the support.class rule (console is not a class).

That's not correct. As I posted here, the context was coming from support.variable.object.node.

Last I checked, console was still a support variable in Node.JS.

@vadimvorenas
Copy link

Finally found a workaround for this issue.

you have to enable semanticHighlighting and then add a property that will change the color manually

create a folder called .vscode
create a file called settings.json
add the following code:

{
  "editor.semanticTokenColorCustomizations": {
    "enabled": true,
    "rules": {
      "variable.defaultLibrary": "#4EC9B0"
    }
  }
}

hope this helps peeps in distress 😝

Thank you, I'm happy for that!

@adamreisnz
Copy link

adamreisnz commented Sep 16, 2020 via email

@vadimvorenas
Copy link

What about the people that don't want semantic highlighting?

On Thu, 17 Sep 2020, 01:39 vadimvorenas, @.***> wrote: Finally found a workaround for this issue. you have to enable semanticHighlighting and then add a property that will change the color manually create a folder called .vscode create a file called settings.json add the following code: { "editor.semanticTokenColorCustomizations": { "enabled": true, "rules": { "variable.defaultLibrary": "#4EC9B0" } } } hope this helps peeps in distress 😝 Thank you, I'm happy for that! — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#104616 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADXYQVD2YTDKWLIFHNBE4TSGC5YVANCNFSM4P7DDTEQ .

They don't need to do anything, because by default it is, and this theme was specially created for this - how to undo the default actions

Much more important is the question - what to do when deleting a small file puts the entire editor in a stupor for 30 seconds?

@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed grammar Syntax highlighting grammar javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests