Skip to content

Semantic highlighting: Highlight some top level variables as constants #1780

@yangdanny97

Description

@yangdanny97

Describe the Bug

Right now they are highlighted the same as other variables, but perhaps we should highlight the variables different if they only contain capital letters, numbers, and underscore.

If we want to get REALLY fancy, maybe we could also check that

  1. they defined in an assignment where the RHS is a literal (or the variable has a literal type)
  2. they are never re-assigned

I think maybe just implementing the basic condition is good enough.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomerslanguage-serverIssues specific to our IDE integration rather than type checking

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions