| Crates.io | openscad-lsp |
| lib.rs | openscad-lsp |
| version | 2.0.1 |
| created_at | 2022-05-27 09:30:50.719391+00 |
| updated_at | 2025-05-28 02:09:09.030716+00 |
| description | A language(LSP) server for OpenSCAD |
| homepage | |
| repository | https://github.com/Leathong/openscad-LSP |
| max_upload_size | |
| id | 594984 |
| size | 274,303 |
NOTICE: Because clang-format produces poor formatting results for OpenSCAD, we have completely removed support for clang-format and switched to the new formatter topiary
A LSP (Language Server Protocol) server for OpenSCAD.
inspired by dzhu/openscad-language-server
Tested with VSCode on Mac and Windows. [vscode extension]
Tested with lsp-mode on Emacs on Linux by @Lenbok.
builtin function/module documents
code and path auto-completion
jump to definition
code snippets
function/module signatures on hover
document symbols
formatter, utilizing topiary.
variable / module renaming
hover and suggestion documentation, read from comments before the function/module.
| IDE | Plugin | Note |
|---|---|---|
| Neovim | mason.nvim | Only tested on Mac and Linux |
| Neovim | nvim-lspconfig | Only tested on Mac and Linux |
| VS Code | openscad-language-support | Only tested on Mac and Windows |
| Emacs | lsp-bridge | Only tested on Mac and Linux |
openscad-LSP is written in Rust, in order to use it, you need to install Rust toolchain.
cargo install openscad-lsp
cd openscad-LSP
cargo build --release
The server communicates over TCP socket (127.0.0.1:3245).
A language(LSP) server for OpenSCAD
Usage: openscad-lsp [OPTIONS]
Options:
-p, --port <PORT> [default: 3245]
--ip <IP> [default: 127.0.0.1]
--builtin <BUILTIN> external builtin functions file path, if set, the built-in builtin functions file will not be used [default: ]
--stdio use stdio instead of tcp
--ignore-default exclude default params in auto-completion
--depth <DEPTH> search depth [default: 3]
--indent <INDENT> The indentation string used for that particular language. Defaults to " " if not provided. Any string can be provided, but in most instances will be some whitespace: " ", " ", or "\t"
--query-file <QUERY_FILE> The query file used for topiary formatting
-h, --help Print help
-V, --version Print version
To change the config at runtime, you can send notification workspace/didChangeConfiguration
// example
{
"settings": {
"openscad": {
"search_paths": "/libs",
"indent": " ",
"query_file": "path/to/my/openscad.scm",
"default_param": true
}
}
}