Skip to main content

Module lsp

Module lsp 

Source
Expand description

Builtin / keyword / method corpus for offline documentation.

Single source of truth for the reference manual (gen-docs → docs/reference.html). Every entry mirrors something the runtime actually recognizes:

  • “Keyword” → the KEYWORDS set in parser.rs (plus the operator keywords typeof/void/delete/instanceof/in/new/this).
  • “Global” → the global identifiers resolved in builtins.rs (undefined/NaN/Infinity/globalThis) and the free functions / constructors in its dispatch table (parseInt, parseFloat, isNaN, isFinite, String, Number, Boolean, Array, Error, …).
  • “console” → console.log/error/warn/info/debug.
  • “Math”/“JSON”/“Object”/“Number”/“String static”/“Array static” → the namespace dispatch arms in builtins.rs (call_builtin, call_math, the Math.* const table, Object.*, Number.*, Array.*).
  • “Array method”/“String method”/“Number method” → the per-type dispatch tables (array_method, string_method, and the number-method arms).

Only names the crate implements appear here — no classes, regex, Map/Set, generators, or modules, none of which the lexer/parser/builtins support.

The same corpus also backs the Language Server (node --lsp): completion and hover render from it, while diagnostics come from the runtime’s own parser::parse (a syntax error maps to the reported line). No output ever reaches the terminal — JSON-RPC on stdio only. Structure follows the sibling -rs interpreters’ lsp.rs (see pythonrs/src/lsp.rs).

Functions§

corpus
The builtin corpus, exposed for offline doc generation (gen-docs) and any editor tooling that wants the same (name, chapter, doc, example) rows.
run
Entry point for node --lsp.