microsoft / microsoft/TypeScript-Sublime-Plugin

Syntax highlighter breaks when return type ends with a number

Open
#455 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

The syntax highlighter completely stops highlighting when the returntype of a (static) method ends with a digit.

eg.

class Vector2 { }
class Vector { }


class Test {
    Method_Works() : Vector {
        return new Vector();
    }

    Method_Breaks(): Vector2 {
        return new Vector2();
    }
    static Method_Breaks() : Vector2 {
        return new Vector2();   
    }
}

edit: it even breaks in the GitHub highlighter... But the compiler does accept it

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

Reproduce the issue in the TypeScript syntax highlighter with the provided class and method examples, comparing Vector with Vector2 return types and static methods. Trace the highlighting rule that handles return-type names ending in digits; done means highlighting continues correctly after both Vector2 declarations and their method bodies.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.