Tokenising failure on parenthesis-wrapped object literal's type assertion operators `as keyof typeof`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start by inspecting the repository's TypeScript TextMate grammar files and reproduce the supplied examples in the relevant editor syntax highlighter. Compare the highlighting of as keyof typeof in the parenthesis-wrapped object literal with the other examples; done means those operators receive keyword scopes rather than variable.parameter.ts or the TSX equivalent.
Written by the indexing model from the issue text.
Description
JavaScript and TypeScript Nightly version: 5.3.0-dev.20231015
Code
This is the minimal and possible code for compare and constrast.
The example might not cover all posibilities that leads to this issue.
type A = { a: "", b: "" }
const a = { a: "", b: "" }
const c = ({
key: a.a, label: a.b[a.a as keyof typeof a.b]
})
const d = (
{
key: a.a, label: a.b[a.a as keyof typeof a.b]
})
const e =
{ key: a.a, label: a.b[a.a as keyof typeof a.b] }
const f =
{
key: a.a, label: a.b[a.a as keyof typeof a.b]
}
When the object literal is going to be written like d, the inner operator as keyof typeof is tokenised as variable.parameter.ts or (tsx), but not keyword.*.
- Dominant language
- TypeScript
- Stars
- 471
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/TypeScript-TmLanguage
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/TypeScript-TmLanguage#1071 ·
-
triste Open
Difficulty 5/5 Over a week Newbie friendliness 5/100
microsoft/TypeScript-TmLanguage#1078 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/TypeScript-TmLanguage#1076 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
microsoft/TypeScript-TmLanguage#1074 · 2 comments ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 58/100
microsoft/TypeScript-TmLanguage#1066 · 1 comment ·
All issues in microsoft/TypeScript-TmLanguage
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100