aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 08:09:40 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 08:09:40 +0000
commita3e9e53e64a1aa5692bca2b60bcbff6a0fcfdba1 (patch)
tree2598c50e36e488935211c2e304b720a58315bacb /docs
parentembed: 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 'docs')
-rw-r--r--docs/LEARN.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/LEARN.md b/docs/LEARN.md
index 8b0e1e6..b649b4f 100644
--- a/docs/LEARN.md
+++ b/docs/LEARN.md
@@ -915,7 +915,7 @@ output:
the language server reports informational hints for likely mistakes. by default, `hints on;` shows blue informational squiggles. `hints small;` keeps the same hints but displays compact dots; it does not reduce their number or kinds. `hints off;` suppresses hints after the directive. each setting applies from its source position.
-an inline block comment immediately before a numeric literal marks that literal as intentional and suppresses its magic-number hint. a comment before another operand does not suppress the hint. a block comment immediately above a declaration provides hover documentation; `//:` marks an implementation note instead.
+an inline block comment immediately before a numeric literal marks that literal as intentional and suppresses its magic-number hint. a comment before another operand does not suppress the hint. block comments are for this kind of place, between code on one line; a comment on lines of its own is written with `//`. the `//` comment immediately above a declaration is its hover documentation.
[example source](../examples/learn/29-block-comments.zc):
@@ -923,7 +923,7 @@ an inline block comment immediately before a numeric literal marks that literal
namespace;
include rt;
-/* adds a memory offset to an address. */
+// adds a memory offset to an address.
int offset_address(int address) {
return address + /* offset in memory */ 0x40ff;
}