microsoft / microsoft/TypeScript-TmLanguage

Does not provide different scopes for [ ]

Open
#630 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Suggestion
Dominant language
TypeScript
Stars
471
Forks
149
PR merge metrics
No merged PRs in 30d

Description

TS and JS Grammar Extension version: 0.0.41 / latest

Code
For this case vscode provides special scope 'punctuation.definition.binding-pattern.array'

const [value] = 'string'

For all these cases vscode provides single scope 'meta.array.literal meta.brace.square'

// array literal
const a = [1, 2, 3]

// array access by index
const b = a[1]

// object property access by name
const c = Math['min']

// object literal computed keys
const d = {
  [`key`]: 'computed'
}

Can you add different scopes for each case?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript and JavaScript TextMate grammar definitions in this repository and reviewing how square-bracket constructs are currently scoped. Compare the existing scopes with the binding-pattern, array-literal, index-access, computed-property, and computed-key examples in the issue; done means each case receives the requested distinct scope and the grammar checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.