microsoft / microsoft/TypeScript-Sublime-Plugin

Decorators are not correctly highlighted

Open
#479 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When using a decorator in typescript the decorator should be highlighted as a function, since it is an implicit function call.

Currently, @foo and @foo() are not highlighted the same, but since both are clearly decorator calls they should be; in particular @foo is currently not highlighted any particular color.

I tried to figure out how to add this myself but haven't been successful so far -- I'm just not familiar with how tmLanguage files work :-/ If you want to give me tips to get started I'm willing to try to do this myself

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 tmLanguage grammar files and reading the decorator rules that handle @foo and @foo(). Compare the scopes assigned to both forms and verify that each receives the same function highlighting when the grammar is updated.

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.