#2952 NV5 VS Code Fantom LSP

FMahony Yesterday

NV5 has released their Fantom LSP to the VS Code Marketplace. Repo to be made public at a later date. VSIX is bundled with the server pod internally and just needs to be pointed to FAN_HOME. A detailed list of features is provided below but I would like to call out some of personal favorites:

  • Dependency Analysis: Build.fan depends array is analyzed against using statements. This is used to flag using statements for undeclared dependencies but also identifies unused using imports.
  • Auto formatter: Supports Format Document for automatic indentation alignment. Set Bracket Style under settings to either k&r or allman and auto-format away.

Setup

  1. Install the extension from the Marketplace.
  2. Open Settings (Ctrl+,) and set fantom.home to your Fantom or SkySpark installation directory (e.g. C:\Skyspark\skyspark-4.0.5). If you already have the FAN_HOME environment variable set, you can skip this step.
  3. Open a .fan file. The language server starts automatically.

Features

Code Intelligence

  • Hover -- type signatures, documentation, and constructor details for types and slots from your code and compiled pods.
  • Go to Definition -- jump to the definition of any type, field, or method across your workspace.
  • Find References -- locate every usage of a symbol throughout the project.
  • Rename Symbol -- rename types, fields, and methods across all files at once.
  • Call Hierarchy -- browse incoming and outgoing calls for any method or constructor.

Editing

  • Completion -- context-aware autocomplete: pod names in using statements, dot-completion on receivers, keywords, local - variables, and types. Method snippets include parameter placeholders.
  • Signature Help -- parameter hints while typing function calls, with the active parameter highlighted.
  • Code Actions -- quick fixes including Add missing using, Remove unused using, and Uncomment line.

Navigation

  • Document Symbols -- outline and breadcrumb navigation for the current file.
  • Workspace Symbol Search -- Ctrl+T fuzzy search across all indexed symbols.

Diagnostics

  • Real-time parser errors on every keystroke.
  • Compiler diagnostics on save, with automatic cross-file refresh. Formatting
  • Full-file code formatting with Allman (default) or K&R bracket style.
  • Correctly handles triple-quoted multiline strings and list literal indentation.
  • Respects your editor tab size and spaces/tabs preference.

Syntax Highlighting

  • Semantic token support that goes beyond the bundled TextMate grammar, distinguishing classes, methods, fields, enums, and mixins with modifiers like declaration, readonly, static, and abstract.

Login or Signup to reply.