Incorrect bracket matching when JavaScript identifier contains $

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
devtools

調査の方向性

Look at the bracket matching logic in the JavaScript editor, likely in a language server or syntax highlighting component. Start by searching for files handling bracket matching or tokenization for JavaScript. Reproduce the issue locally with the provided test case to confirm the bug. Check how '$' is being interpreted in identifiers and adjust the matching rules to treat it as part of an identifier, not a bracket.

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

説明

In the JavaScript editor, bracket matching incorrectly associates an opening { with a $ character instead of the corresponding closing }.

This is reproducible in a completely new, empty .js file, so it does not appear to be related to the project, existing source code, or workspace configuration.

Steps to reproduce
  1. Create a new empty JavaScript file, for example test.js.
  2. Enter the following code:
function test() {
    const $this = $(this);
}
  1. Place the cursor on the opening { after function test().
Actual result

The $ character in $this / $(this) is highlighted as the matching character.

For example:

function test() {
    const $this = $(this);
          ^

The $ is highlighted instead of the closing }.

Expected result

The corresponding closing brace should be highlighted:

function test() {
    const $this = $(this);         
}
^
                                  

The $ character is valid in JavaScript identifiers and should not be treated as a bracket or matching character.

Additional information

The problem is reproducible with a completely new JavaScript file containing only the above code.

Try removing the $s from the file and I see that NO } is highlighted

Environment
  • Eclipse IDE: 4.41
  • Eclipse Wild Web Developer: 1.4.1.202608181434
  • Feature: org.eclipse.wildwebdeveloper.feature.feature.group
  • Operating system: Windows
  • Language: JavaScript
Notes

The issue also occurs in existing JavaScript source code, including code using jQuery, but jQuery itself does not appear to be relevant because the minimal example above reproduces the problem.

The problem affects only the visual bracket matching/highlighting; the JavaScript code itself is valid.

主要言語
Java
スター
203
フォーク
76
平均マージ
1日 5時間
マージ済み PR(30日)
30

環境構築

はじめの一歩

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

eclipse-wildwebdeveloper/wildwebdeveloper のほかの issue

eclipse-wildwebdeveloper/wildwebdeveloper の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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