Commit 03c0ccc
fix: support quoted structure names in structure command diagnostics (#456)
Quoted structure names in commands (e.g. `structure load
"mystructure:house" ~ ~ ~`) triggered false "missing structure" errors
because the diagnoser compared the raw token—including surrounding
quotes—against stored unquoted IDs.
## Changes
- **`diagnose_structure_implementation`** — call `Text.UnQuote()` on the
resolved ID string before all lookup checks, consistent with how other
diagnosers (tickingarea, fake-entity, mcfunction, etc.) handle quoted
tokens.
- **Structure diagnoser test** — add a case asserting that a quoted
token resolves cleanly when the unquoted ID exists in the pack.
```
# Before — false positive error
structure load "mystructure:house" ~ ~ ~
# ^^^^^^^^^^^^^^^^^^^ → looked up as `"mystructure:house"`, not found
# After — no error
structure load "mystructure:house" ~ ~ ~
# → stripped to `mystructure:house`, found ✓
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DaanV2 <2393905+DaanV2@users.noreply.github.com>1 parent 9712013 commit 03c0ccc
3 files changed
Lines changed: 15 additions & 2 deletions
File tree
- ide/vscode/src
- packages/bedrock-diagnoser
- src/diagnostics/behavior-pack/structure
- test/lib/diagnostics/behavior-pack
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
| |||
0 commit comments