Skip to content

v0.2.0 WitcherScript LSP, REDkit Tooling, and VS Code Harness

Choose a tag to compare

@bi3lu bi3lu released this 30 May 12:02
· 20 commits to main since this release
85a80b0

This release turns the project from a language-core foundation into a usable developer tooling stack. It adds core Language Server Protocol features, workspace/project indexing, semantic diagnostics, REDkit CLI integration, a VS Code extension harness, and end-to-end fixture coverage.

Highlights

  • Implemented a functional WitcherScript language server with:

    • initialize
    • initialized
    • textDocument/didOpen
    • textDocument/didChange
    • textDocument/didSave
    • workspace/didChangeWatchedFiles
    • workspace/executeCommand
    • textDocument/publishDiagnostics
  • Added editor-facing LSP features:

    • document symbols
    • workspace symbols
    • go to definition
    • hover
    • completion
    • references
  • Added project-aware workspace support through witcherscript.toml.

  • Added workspace scanning with:

    • source_roots
    • vanilla_roots
    • exclude rules
  • Added project-wide symbol indexing for:

    • classes
    • states
    • functions
    • events
    • fields
    • local declarations
  • Added semantic diagnostics for:

    • duplicate symbols
    • unknown types
    • missing base classes
    • unknown identifiers
    • function call argument count mismatches
  • Added REDkit C# tooling CLI commands:

    • detect
    • init
    • print-config
    • validate
    • recompile
    • launch-game
  • Added witcherscript.toml generation through REDkit tooling.

  • Added LSP refresh command for live project reloads:

witcherscript.refreshIndex
  • Added a VS Code extension harness for testing the language server in a real editor.

  • Added TypeScript tooling for the VS Code extension:

    • TypeScript compile check
    • ESLint
    • GitHub Actions CI job
  • Added end-to-end fixture tests for:

    • diagnostics
    • completion
    • go to definition
    • document symbols
    • workspace symbols
    • AST snapshots
    • larger project indexing

Changelog

Language Server

  • Added full-document synchronization for opened, changed, and saved .ws files.
  • Added diagnostic publication from lexer, parser, and semantic analysis.
  • Added project index refresh for watched file changes.
  • Added workspace/executeCommand support.
  • Added witcherscript.refreshIndex for reloading witcherscript.toml without restarting the server.
  • Added completion results for WitcherScript keywords and indexed project symbols.
  • Added document outline support from indexed AST declarations.
  • Added workspace-wide symbol search.
  • Added definition lookup for indexed symbols.
  • Added hover information for known symbols.
  • Added simple reference lookup across indexed files.

Parser and Analysis

  • Expanded parser support for structural declarations, function bodies, local variables, and statements.
  • Added symbol table, scope model, type references, and inheritance index.
  • Added semantic diagnostic rules for common project-level mistakes.
  • Improved import resolution support in the project index.
  • Fixed an import-cycle issue around workspace config compatibility exports.

REDkit Tooling

  • Added REDkit project detection.
  • Added game and REDkit installation detection with manual path support.
  • Added content repository modeling for vanilla, DLC, mod, and project repositories.
  • Added project validation output.
  • Added TOML export for the language server.
  • Added process adapters for recompilation and game launch commands.
  • Organized C# tooling into focused directories.
  • Added XML documentation comments for public C# API types and methods.

VS Code Extension

  • Added a minimal VS Code extension under src/vscode.
  • Added .ws language activation.
  • Added configurable language server startup.
  • Added command palette entries:
    • WitcherScript: Refresh Project Index
    • WitcherScript: Initialize REDkit Config
    • WitcherScript: Restart Language Server
  • Added Extension Host debug configuration.
  • Added local extension documentation.
  • Added ESLint and TypeScript CI checks.

Tests and Fixtures

  • Added project fixtures:
    • minimal_project
    • basic_project
    • broken_project
    • larger_project
  • Added end-to-end tests over real fixture workspaces.
  • Added AST snapshot coverage for fixture projects.
  • Added performance-oriented indexing regression coverage.
  • Expanded LSP tests for diagnostics, symbols, completion, definition, references, hover, watched files, and index refresh.

Validation

The release has been verified with:

uv run ruff check .
uv run ruff format --check .
uv run mypy src/py
uv run pytest
npm --prefix src/vscode run lint
npm --prefix src/vscode run check
npm --prefix src/vscode run compile
dotnet test src/dotnet/WitcherScript.RedkitTooling.sln

Current test result:

49 Python tests passed
6 .NET tests passed
VS Code extension lint/check/compile passed

Notes

The language server can now be tested directly in VS Code through the extension harness in src/vscode. The REDkit CLI can generate witcherscript.toml, and the running language server can reload that configuration through witcherscript.refreshIndex without restarting the editor.