Skip to content
New issue

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

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

Already on GitHub? # to your account

The constant in lower case is defined as a variable #542

Closed
mjbvz opened this issue Nov 20, 2017 · 11 comments
Closed

The constant in lower case is defined as a variable #542

mjbvz opened this issue Nov 20, 2017 · 11 comments

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Nov 20, 2017

From @dedmazayukr on November 19, 2017 21:20

Why the constant in lower case is defined as a variable ? The constant must be constant, regardless of the register.

  • VSCode Version: Version 1.18.1
  • OS Version: Ubuntu 17.10

Steps to Reproduce:

  1. Write for example: (lowercase and uppercase)
    const variable = 'as variable.other.readwrite';
    const CONSTANT = 'as variable.other.constant';

  2. Press ctrl+shift+p, and select Developer: Inspect TM Scope

  3. Click on word variable --> variable.other.readwrite (wrong)
    image

  4. Click on word CONSTANT --> variable.other.constant (correctly)
    image

Reproduces without extensions: Yes
Languages: javascript and typescript

Copied from original issue: microsoft/vscode#38735

@sheetalkamat
Copy link
Member

Agreed, though this is not reported often and hence could stay as it is for now. Fixing this means copying multiple pattern rules and modifying just little to accommodate this. If there is enough demand this can be looked at later time.

@sheetalkamat sheetalkamat added the wontfix Issue is either side effect or limitation that will not be fixed for now label Jan 31, 2018
@usernamehw
Copy link

Seriously?

@igolskyi
Copy link

igolskyi commented Feb 1, 2018

What's going on here ?! How can you ignore the incorrect classification of variables and constants? I am shocked and disappointed! What are the arguments for closing this bug?
Why the constant in lower case is defined as a variable ? The constant must be constant, regardless of the register. And it's not about syntax highlighting, you have a constant written as a variable

@sheetalkamat
Copy link
Member

This issue is not being reported many times... Note that in declaration you can argue about const being const regardless of case etc, but in the end during its usage, these are the same heuristics we can apply given that its a regex grammar. If the issue gets reported multiple times and has lot of demand this can be done for the declaration site as that is the only feasible solution we have.. Given that we can not completely fix this issue and number of reports on this, this at moment would be as is..

@igolskyi
Copy link

igolskyi commented Feb 2, 2018

This is done if peoples ask for a new function or feature. But this is a bug, I thought that the bug fixes are not dependent on the number of votes. Ok if you have a different way...

@akamud
Copy link

akamud commented Feb 13, 2018

This has been reported at least 3 times for my theme. Please consider fixing this.

@akamud
Copy link

akamud commented Mar 3, 2018

This has just been reported again for my theme.

@Budgiebrain994
Copy link

I'm also coming from @akamud 's theming, please address this issue

@sheetalkamat
Copy link
Member

I still believe fixing this is just going to raise more coloring issues than not fixing.

Eg. in code:

const x = 10;
foo = x; // x cannot be tokenized as const here. That means the color here would be different from declaration. There is no way to do this using just grammar.

@akamud
Copy link

akamud commented Mar 6, 2018

This would be one less coloring issue. For comparison, Atom works like you described and it is better than not having const coloring at all.

@ShayanJavadi
Copy link

please fix this. literally the only thing keeping me from jumping ship from atom to vscode.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants