microsoft / microsoft/TypeScript-Sublime-Plugin

"readonly" not highlighted property when appearing after "private" in constructor()

Open
#576 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
236
Avg merge
21d 13h
Merged PRs (30d)
1

Description

This code:

export class Searcher {
    private selection: Selection;

    constructor(readonly board: Board, private readonly originalSelection: Selection) {
        this.selection = {
            start: this.originalSelection.start,
            focus: this.originalSelection.focus,
            axis: this.originalSelection.axis,
        };
    }

   ...
}

Appears like this in Sublime Text build 3126, macOS 10.11.5, TypeScript plugin v2.0.1:

screen shot 2016-12-18 at 12 31 46 pm

I expect the "readonly" and "private" modifiers to have the same highlighting, as red, not orange.

It appears that the syntax highlighter in GitHub also has this problem (as I file this issue):

screen shot 2016-12-18 at 12 33 29 pm

Should I submit this issue against the TmLanguage definition instead?

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 tracing how the plugin or the linked TypeScript-TmLanguage definition assigns scopes to constructor parameter modifiers, using the reported private readonly example as the reproduction case. Done means readonly receives the same highlighting as private in this ordering, with the responsible syntax definition updated or the issue redirected if it belongs in the linked repository.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.