Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Editor support

Andy C++ ships a language server (LSP) so editors can offer rich feedback as you write .ndc files. The server is built into the ndc binary and is started with:

ndc lsp --stdio

Most users don’t run this by hand — the VS Code extension launches it automatically. Any LSP-capable editor can use it by pointing at the ndc lsp --stdio command for the andy-cpp language and the .ndc file extension.

What the language server provides

  • Diagnostics — lexer, parser, and semantic/type errors are reported inline as you type.
  • Inlay type hints — inferred types are shown after let bindings and function parameters, and inferred return types after function signatures. Hints are only shown where you didn’t already write an annotation.
  • Hover — hovering an expression shows its inferred type; hovering a built-in function shows its signature and documentation.
  • Completion — typing . offers functions whose first parameter accepts the receiver’s type (method-call style). General completion offers built-in functions, in-scope variables, and language keywords.
  • Document symbols — an outline of the top-level and nested functions and variable declarations in the file.
  • Go-to-definition — jump from a variable or function usage to its declaration.

Notes

  • The server uses full-document synchronisation and re-analyses on each edit.
  • While the buffer is mid-edit and doesn’t parse, the last successful analysis is retained so hints and dot-completion keep working.