source link: https://github.com/dzhu/openscad-language-server
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
openscad-language-server is an LSP (Language Server Protocol) server for OpenSCAD. It enables IDE-style features for OpenSCAD code in any editor for which an LSP client is available—i.e., most major modern text editors.
- context-aware completion
- insertion of useful snippets upon completion
- live diagnostic messages for syntax errors
- function/module signatures on hover
- handling of
use(of both local and library files)
- reasonable robustness in the presence of ill-formed input files
To install the server from crates.io (puts the binary into
cargo install openscad-language-server
To build directly from the repository (puts the binary into
target/release/openscad-language-server in the clone):
git clone https://github.com/dzhu/openscad-language-server cd openscad-language-server cargo build --release
Consult the documentation for your editor and its LSP client to configure them to use the server binary for OpenSCAD files. The server communicates over standard input/output.
Parsing of OpenSCAD code is handled by tree-sitter and tree-sitter-openscad. Communicating over LSP is handled by lsp-server. Having those crates handling all the dirty details of interacting with the outside world has made it possible to get started on this project quite quickly and stay focused on the interesting parts in the middle.
- openscad/openscad#3635 (PR for adding LSP server functionality into OpenSCAD itself)
- https://github.com/Antyos/vscode-openscad (plugin for VSCode)
- https://github.com/ncsaba/idea-openscad (plugin for IntelliJ IDEs)
- https://github.com/tralamazza/Sublime-OpenScad (syntax for Sublime Text)
- https://github.com/Maxattax97/openscad-lsp (only a skeleton, no functionality)
Aggregate valuable and interesting links.
Joyk means Joy of geeK