diff options
| author | 2026-10-14 09:33:03 +0000 | |
|---|---|---|
| committer | 2026-10-14 09:33:03 +0000 | |
| commit | ebaa15f02dd0e5aa358ea2e527ae4557e40b4e9c (patch) | |
| tree | 9f53ccfed1eedd90df2747bdfd0e9ea907caee95 /tests/drivers | |
| parent | todo: record the reverted unchecked trial and what it showed (diff) | |
constants inside structs, and typo suggestions for fields and static members
const NAME = e; inside a struct body declares a compile-time constant named
Struct.NAME, reached as Struct.NAME or by bare name in the struct's methods.
A misspelled field or Struct.name member now ends its error with
'; did you mean 'name'?' on the member word, which the language server
turns into a quick fix.
Diffstat (limited to 'tests/drivers')
| -rw-r--r-- | tests/drivers/hint_fixes_test.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/drivers/hint_fixes_test.js b/tests/drivers/hint_fixes_test.js index 20d3dd1..a388911 100644 --- a/tests/drivers/hint_fixes_test.js +++ b/tests/drivers/hint_fixes_test.js @@ -76,5 +76,9 @@ fixes('a misspelled local function is corrected', 'int count_items() { return 1; 'int count_items() { return 1; }\nfn main() {\n\treturn count_items();\n}\n', 'change to `count_items`'); fixes('a qualified name from a file library adds its include', 'include rt;\nfn main() {\n\treturn actor.vector();\n}\n', 'actor', 0, 'include rt;\ninclude actor;\nfn main() {\n\treturn actor.vector();\n}\n', 'include actor'); +fixes('a misspelled field is corrected', 'include rt;\nstruct point { int length, width; }\nfn main() {\n\tpoint* p = rt.new(point);\n\treturn p.lenght;\n}\n', 'lenght', 0, + 'include rt;\nstruct point { int length, width; }\nfn main() {\n\tpoint* p = rt.new(point);\n\treturn p.length;\n}\n', 'change to `length`'); +fixes('a misspelled static function of a library group is corrected', 'include rt;\ninclude std;\nfn main() {\n\treturn std.Text.itao(5, 0);\n}\n', 'itao', 0, + 'include rt;\ninclude std;\nfn main() {\n\treturn std.Text.itoa(5, 0);\n}\n', 'change to `itoa`'); console.log(ok + ' hint fix checks passed, ' + bad + ' failed'); process.exit(bad ? 1 : 0); |
