Raven VS Code Extension
The Raven VS Code extension wires the editor to the Raven.LanguageServer LSP process so .rvn files, with legacy .rav compatibility, can surface diagnostics, completions, and inlay hints. The language server publishes syntax diagnostics immediately after edits and keeps previous semantic diagnostics and inlays visible for unchanged ranges while newer snapshot results are pending. It auto-discovers the language server build output and starts it with dotnet when the extension activates.
The Explorer also contains an opt-in Raven Syntax Tree debugging view. It
renders nodes, tokens, trivia, syntax property roles, raw kinds, spans, missing
elements, and diagnostics from the machine-readable rvn dev syntax json
output. The toolbar switches between the authored syntax tree and the fully
macro-expanded tree, and can open the complete expanded source in a read-only
virtual Raven document. Tree selections reveal the corresponding authored or
expanded source range.
The view is always available from the Explorer's Views menu. Run Raven: Show Authored Syntax Tree or Raven: Show Expanded Syntax Tree from the Command Palette to open Explorer, focus the view, and select its mode.
Prerequisites
- .NET SDK available on your
PATHso the client can start the language server. - Node.js 18+ for building and running the extension.
- A built
Raven.LanguageServer.dll(fromsrc/Raven.LanguageServer/bin/Debug/net10.0or a packagedserver/folder).
Building the extension
Install dependencies and compile the client bundle from the repository root:
cd src/Raven.VSCode
npm install
npm run compile
The compiled JavaScript emits to out/ and is referenced by the extension manifest.
Running inside VS Code
- Build the language server:
dotnet build src/Raven.LanguageServer/Raven.LanguageServer.csproj. - Open the repository in VS Code.
- In Run and Debug, launch
Raven: LSP + Extensionto start both the extension host and language server. - If needed, you can launch only
Raven VS Code Extension Host(extension host only). - Open or create a
.rvnfile to trigger activation and view diagnostics.
Configuration
The extension exposes settings to control language-server resolution and debug compilation:
raven.sdkPath(string): Override the Raven SDK root directory. When this is unset, the extension runsrvn sdk pathto discover an installed SDK. The extension looks in that root for bundled tools such asRaven.LanguageServer.dll,rvn.dll,rvnc.dll, andRaven.Core.dll.raven.languageServerPath(string): Override the resolvedRaven.LanguageServer.dllpath. Use this when working with custom build outputs or packaged bits.raven.autoBuildLanguageServerOnActivate(boolean): Opt-in source-development setting that buildssrc/Raven.LanguageServer/Raven.LanguageServer.csprojbefore activation if it can find the project in the current workspace or extension ancestors. It can substantially delay startup and is ignored whenraven.languageServerPathis set.raven.compilerProjectPath(string): Override the path used to locate a prebuiltrvnc.dllundersrc/Raven.Compiler/bin/Debug/<tfm>when no bundled compiler driver is available.raven.targetFramework(string): Optional target framework (for example,net10.0) passed to debug compile invocations.raven.inlayHints.enabled(boolean): Master switch for Raven inlay hints.raven.inlayHints.inferredTypes.enabled(boolean): Show inferred type annotation hints when Raven inlay hints are enabled.raven.inlayHints.names.enabled(boolean): Show name hints for positional invocation arguments and deconstruction elements when Raven inlay hints are enabled.raven.inlayHints.requestDebounceMilliseconds(number): Delay inlay requests after document edits so typing can settle before semantic inlay work runs.
When the extension discovers a workspace-built language server, it stages that build into an extension-owned directory before launch. The staged copy runs with the repository root as its working directory so repo-relative assets like Raven.Core.dll continue to resolve while the workspace build outputs remain free of language-server file locks.
F5 compile + debug
The extension contributes a Raven debug type:
Raven: Compile and Debugcompiles the active.rvnfile or.rvnprojtarget using thervnccompiler driver. Legacy.ravfiles and deprecated.ravenprojprojects remain supported for compatibility.- Build artifacts are emitted to
${workspaceFolder}/.raven-debug. - After compile succeeds, the extension starts a
coreclrdebug session withdotnet <compiled-output.dll>.
You can start it by pressing F5 in a Raven file, or by running Raven: Compile and Debug Active File from the command palette.
Running a file or project
Raven: Run Active File/Project uses the rvn frontend. Selecting a .rvn
or legacy .rav source runs that file as an isolated file-based application
through rvn run; selecting a .rvnproj or legacy .ravenproj file runs that
project. The command opens an interactive terminal rooted beside the selected
file so application input and output behave like an ordinary script or console
application.
Language features follow evaluated project membership. A source included by a project receives that project's semantic context; a source outside project items receives an isolated file-application context even when a project file exists elsewhere in the workspace.
Packaging
scripts/package-vscode.sh publishes a framework-dependent language server into a server/ directory next to package.json and creates the VSIX. The compiler remains in the separately installed Raven SDK. The client searches an explicit SDK path first, an SDK reported by rvn sdk path, workspace build outputs, the packaged server, and finally any user-provided direct assembly overrides.
When no SDK is discovered, the bundled server still provides editor features and the extension offers a link to the SDK installation instructions. The prompt can be permanently dismissed for syntax-only installations.