-
Notifications
You must be signed in to change notification settings - Fork 93
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
Short constant names highlighted incorrectly #135
Comments
So the issue is that something like Please @elprans and @1st1 weight in. Also, hearing from @pikeas (originator for #42) could be useful. |
Thanks for the reply. This is a tough one, for sure. I can understand the case of Below is another real world example of where an inconsistency might come up with longer names. Say we want to declare the instruction set for a CPU (CHIP-8 in this case). from enum import Enum, auto
class InstructionName(Enum):
I_0000 = auto()
I_00E0 = auto()
I_00EE = auto()
I_0NNN = auto()
I_1NNN = auto()
I_2NNN = auto()
I_3XKK = auto()
I_4XKK = auto()
I_5XY0 = auto()
I_6XKK = auto()
I_7XKK = auto()
I_8XY0 = auto()
I_8XY1 = auto()
I_8XY2 = auto()
I_8XY3 = auto()
I_8XY4 = auto()
I_8XY5 = auto()
I_8XY6 = auto()
I_8XY7 = auto()
I_8XYE = auto()
I_9XY0 = auto()
I_ANNN = auto()
I_BNNN = auto()
I_CXKK = auto()
I_DXYN = auto()
I_EX9E = auto()
I_EXA1 = auto()
I_FX07 = auto()
I_FX0A = auto()
I_FX15 = auto()
I_FX18 = auto()
I_FX1E = auto()
I_FX29 = auto()
I_FX33 = auto()
I_FX55 = auto()
I_FX65 = auto() There would be no highlighting for I guess the real problem in this ticket is to figure out what kind of contribution digits have to the constant highlighting heuristic when the two character quota for uppercased alphabets can not be met. Whether they should be considered, and if so, what kind of thresholds and constraints should be enforced with them. |
Chiming in since I was tagged. For names containing letters, I suggest the following rule (in pseudocode, not Python):
|
Hi. 👋
Short constant names seem to be highlighted incorrectly. I got the assumption that the bug might lie in this MagicPython package. What do you guys think? I ran across this while coding a project, and thought that I should do something about it.
VSCode Example
GitHub Example
I would also like to give special mention to short constant names that end in numbers. They don't seem to be highlighted correctly, even though the same length character-based constants do.
The text was updated successfully, but these errors were encountered: