diff options
| author | 2026-10-14 08:09:40 +0000 | |
|---|---|---|
| committer | 2026-10-14 08:09:40 +0000 | |
| commit | a3e9e53e64a1aa5692bca2b60bcbff6a0fcfdba1 (patch) | |
| tree | 2598c50e36e488935211c2e304b720a58315bacb /tests/drivers/codeactions_client_test.js | |
| parent | embed: tests, editor support and docs; js vm file access; test fixes (diff) | |
lsp: quick fixes for hints and bare library names; comment cleanup
an undefined bare name that a module exports now says which one:
"put_c is used but never defined; did you mean to include rt and use
rt.put_c?", and the import quick fix is titled the same way and marked
preferred when it is the only one, so the editor's auto-fix applies it.
hints gain quick fixes that keep the program's meaning: an unused
parameter, or a local with no other use, is renamed to _; a constant
local with one declarator becomes const; a power-of-two multiply becomes
a parenthesized shift (not when a * / or % binds its left operand); and
let p = rt.new(n) with a small constant becomes let p[n]. the hints no
longer fire for _ discards or for locals already declared const.
whole-line /* */ comments in zc sources are // comments now, and //: is
gone from the maintained sources: the notes it marked were mostly the
documentation of the declaration below, which hovers now show. section
headers are separated from the declarations after them.
Diffstat (limited to 'tests/drivers/codeactions_client_test.js')
| -rw-r--r-- | tests/drivers/codeactions_client_test.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/drivers/codeactions_client_test.js b/tests/drivers/codeactions_client_test.js index f1936e7..6f956b9 100644 --- a/tests/drivers/codeactions_client_test.js +++ b/tests/drivers/codeactions_client_test.js @@ -9,7 +9,7 @@ class CodeAction { constructor(title, kind) { this.title = title; this.kind = ki const vscode = { Range, WorkspaceEdit, CodeAction, CodeActionKind: { QuickFix: 'quickfix' }, Uri: { parse: s => s } }; const uri = 'file:///test.zc', doc = { uri: { toString: () => uri }, version: 3 }; const edit = { range: { start: { line: 0, character: 0 }, end: { line: 0, character: 0 } }, newText: 'include rt;\n' }; -const source = { title: 'include rt;', kind: 'quickfix', isPreferred: true, edit: { documentChanges: [{ textDocument: { uri, version: 3 }, edits: [edit] }] } }; +const source = { title: 'include rt', kind: 'quickfix', isPreferred: true, edit: { documentChanges: [{ textDocument: { uri, version: 3 }, edits: [edit] }] } }; const actions = convertCodeActions(vscode, [source], doc); assert.strictEqual(actions.length, 1); assert.strictEqual(actions[0].kind, 'quickfix'); |
