microsoft / microsoft/TypeScript-TmLanguage

Javascript highlighting fails when less than symbol ("<") is first char and followed by greater than (">")

オープン
#884 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Accepting PRs bug javascript
主要言語
TypeScript
スター
471
フォーク
149
PR マージ指標
30日以内にマージされた PR はありません

説明

TS and JS Grammar Extension version: clicking previous link (in chrome 91.0.4472.114 on macos 10.13.6) gives 404 but searching vscode 1.59.1 extensions for @builtin typescript shows vscode.typescript-language-features 1.0.0 and vscode.typescript 1.0.0. Installing ms-vscode.vscode-typescript-next 4.5.20210902, found in this repo's readme, made no difference.

Code

vscode language mode: JavaScript

const x = 1;
0
< x
&& 1 > 0 // incorrect syntax highlight color coding

Screen Shot 2021-09-03 at 17 54 05

The issue seems to be that < x … > is interpreted as some type specification (like in array<int>)?
Compare with following where the last x is replaced with 1.

const x = 1;
0
< 1
&& 1 > 0 // correct syntax highlight color coding

Screen Shot 2021-09-03 at 17 55 02


I found #752 but decided to open a new issue.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Start with the JavaScript grammar behavior for the reproduced < x and && 1 > 0 expression, then compare it with the numeric variant in the issue. Review the related #752 issue and the grammar files in this repository to identify the relevant rule. Done means both examples receive correct JavaScript syntax highlighting.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。