Broken syntax highlighting for async generic arrow functions with multiline arguments
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- tooling
Research direction
Reproduce the highlighting failure with the async generic arrow-function example in the issue, then compare it with the referenced #481 case. Trace the TypeScript/JavaScript grammar behavior for multiline arguments and verify that the example and its stated variants highlight correctly.
Written by the indexing model from the issue text.
Description
TS and JS Grammar Extension version: 0.0.53 / latest
Syntax highlighting breaks for async generic arrow functions, whose arguments span multiple lines. This is basically the same problem as #481 but with async keyword
Code
async <TData, TError extends string = string>(
url: string,
config?: AxiosRequestConfig,
): Promise<Result<TData, TError>> => {
try {
const { data } = await Axios.get<ServerResponse<TData, TError>>(
url,
config,
)
return Result.fromResponse(data)
} catch (e) {
return handleError<TData, TError>(e)
}
}

It works fine when I either move type arguments to next line/remove async/move arguments to one line. In the first two cases, type arguments and normal arguments highlighting doesn't work though.



Just noticed GitHub highlighting breaks as well. Is it a grammar limitation?
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bcgov/bc-wallet-mobile#4761 · 1 comment ·
-
external-issue to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
refactor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100