Skip to content

AlexanderBrevig/forth-lsp

Repository files navigation

forth-lsp

CI

A Language Server Protocol implementation for Forth, bringing modern IDE features to Forth development.

Features

  • Hover - View documentation for built-in words and user-defined functions
  • Completion - Auto-complete for built-in words and your definitions
  • Go to Definition - Jump to where words are defined
  • Find References - Find all usages of a word
  • Rename - Rename symbols across your workspace
  • Document Symbols - Outline view of word definitions in current file
  • Workspace Symbols - Search for definitions across all files
  • Signature Help - View parameter information while typing
  • Diagnostics - Real-time error detection for undefined words
  • Formatting - Auto-format your code with configurable options

Installation

cargo install forth-lsp

Then configure your editor to use forth-lsp. Works with any LSP-compatible editor (VS Code, Neovim, Helix, Emacs, etc.).

Configuration

Create a .forth-lsp.toml in your workspace root:

[builtin]
# Point at word list files (e.g. gforth -e 'words bye' > gforth.words)
word_files = ["gforth.words"]

# Or define words inline
[[builtin.words]]
word = "MY-WORD"
stack = "( n -- )"
description = "Does something special"

[format]
indent_width = 2
use_spaces = true

Contributing

Issues and PRs welcome!

Development

# Run tests
cargo test --workspace
# or
cargo t

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors