GDScript: vendored tree-sitter-gdscript is behind upstream — valid Godot 4 code reports parse_partial (0.12.1)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read scripts/vendor-grammar.sh, internal/cbm/vendored/grammars/gdscript, vendored-checksums.txt, and the GDScript node type usage in lang_specs.c and grammar_gdscript.c. Refresh the vendored grammar with the pinned Tree-sitter CLI, update its checksum, and add regression cases for the listed constructs. Done means those cases parse cleanly and the node types still match the code that consumes them.
索引モデルが issue の本文から書いたものです。
説明
Summary
On 0.12.1, valid Godot 4 GDScript produces parse_partial ranges for several common constructs. All of them parse cleanly with the current upstream grammar (PrestonKnopp/tree-sitter-gdscript 872e2e9, 2026-10-21). The vendored copy (internal/cbm/vendored/grammars/gdscript, last refreshed 2026-06-02) predates the upstream fixes from July to October 2026. Refreshing the vendored grammar looks like it would fix all of them.
Repro
Every file below is accepted by Godot 4.7.2 (godot --headless --check-only --script <file>, no errors). Indexing them with index_repository(mode: "fast") on 0.12.1 gives:
| file | parse_partial |
|---|---|
1_wrapped_signature.gd |
5-5 |
2_init_inferred_defaults.gd |
4-4 |
3_not_await.gd |
5-5 |
4_tool_variable.gd |
7-7 |
6_await_in_format.gd |
6-6 |
1. Inferred-type default on a wrapped signature line (very common: projects wrap at 100 columns)
extends Node
func add_slider(text: String, lo: float,
getter := Callable()) -> void:
pass
2. Inferred-type defaults in _init
extends Node
func _init(r := 0.5, d := 0.075) -> void:
pass
3. not await
extends Node
func run() -> void:
if not await _open():
return
func _open() -> bool:
return true
4. A variable named tool (a Godot 3 keyword, an ordinary identifier in Godot 4)
extends Node
var tool: Object
func pick(t: Object) -> void:
tool = t
5. await as the right operand of %
extends Node
func t() -> void:
var perf: Array = []
perf.append("%.2f" % await _ms())
func _ms() -> float:
return 1.0
Old vs new grammar
I compiled both grammars, the vendored parser.c/scanner.c from main and upstream 872e2e9 src/, and parsed with py-tree-sitter (counting ERROR and MISSING nodes):
| vendored (cbm main) | upstream 872e2e9 |
|
|---|---|---|
| repro files above | errors on exactly the lines cbm reports | 0 errors |
real Godot 4.7 project, 1,615 .gd files |
558 files with errors | 0 files with errors |
On that project, index_status reports parse_partial for 184 files. The raw grammar has ERROR nodes in 558, so some recovered errors (for example single-line x := value defaults in static func) are not surfaced at all.
Likely relevant upstream changes after the June snapshot:
- Simplify and fix indentation parsing (#86, merged 2026-10-08)
- Fix precedence of
notwith comparison operators (2026-10-08) - Remove Godot 3 syntax from the Godot 4 parser (2026-10-09), which covers
toolas an identifier - Unicode identifiers, trailing separators, open-ended match patterns (2026-07 to 2026-10)
Note: upstream 872e2e9 is generated as LANGUAGE_VERSION 14, while the vendored copy is 15 (tree-sitter 0.25.4). Regenerating it with your pinned tree-sitter CLI should keep it consistent with the other grammars.
Impact
Functions are still found (names and call edges look right in our graph), so the damage is mostly noise in coverage reports and possibly lost parameter and type info on the affected lines. Third-party addons are hit harder: in GUT's addons/gut/test.gd, most of the file falls into error ranges (382-1355 and 1360-2874), and most functions keep only a one-line span without a body. Both GUT files parse cleanly with upstream 872e2e9.
Environment
- codebase-memory-mcp 0.12.1, macOS (arm64)
- Godot 4.7.2
Offer
I'm happy to send a PR that re-vendors the grammar via scripts/vendor-grammar.sh, updates vendored-checksums.txt, adds these repro cases as a regression test, and checks that GDScript node types used in lang_specs.c / grammar_gdscript.c still match (upstream #98 inlined some identifier/expression wrappers). Let me know if you'd rather do the refresh on your side.
Investigated and written with Claude Code (AI agent) on behalf of the account owner.
- 主要言語
- C
- スター
- 45.8k
- フォーク
- 3.8k
- 平均マージ
- 2日 18時間
- マージ済み PR(30日)
- 108
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DeusData/codebase-memory-mcp のほかの issue
-
bug ux/behavior
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
DeusData/codebase-memory-mcp#3191 ·
メンテナーはふだん 1 日以内に返信
-
documentation enhancement parsing/quality ux/behavior
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
DeusData/codebase-memory-mcp#3131 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug editor/integration parsing/quality ux/behavior
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DeusData/codebase-memory-mcp#3062 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug documentation editor/integration parsing/quality
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DeusData/codebase-memory-mcp#3050 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
editor/integration parsing/quality
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
DeusData/codebase-memory-mcp#2286 ·
メンテナーはふだん 1 日以内に返信
DeusData/codebase-memory-mcp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
メンテナーはふだん 1 日以内に返信
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameオープンgame: 010065A014024000 ios
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
seedds/nxnative#3714 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信