1 unstable release
Uses new Rust 2024
| 0.4.0 | Oct 9, 2025 |
|---|
#71 in Text editors
186 downloads per month
44KB
379 lines
safety-lsp
Configuration for VSCode
- For
.vscode/settings.json,SP_FILEstarts from workspace root if it's a relative path:
{
"safety-tool.env": {
"SP_FILE": "./ostd/safety-tags.toml"
}
}
SP_FILE can also be a absolute path.
SP_DIR is also supported, but only one of them should be specified.
- For remote usage,
safety-lsp.env.SAFETY_LSPshould be set as vscode will fail to findsafety-lspdue to absence of bash env loading.
{
"safety-tool.env": {
"SAFETY_LSP": "/path/to/safety-lsp"
}
}
Ctrl+Spaceto open hover doc panel of each completion candidate if the doc is not shown.
Configuration for Neovim
vim.lsp.config["safety-lsp"] = {
-- Command and arguments to start the server.
cmd = { "/home/gh-zjp-CN/tag-std/safety-tool/safety-lsp/target/debug/safety-lsp" },
-- Environment variables passed to the LSP process on spawn
cmd_env = { SP_DISABLE_CHECK = 1 },
-- Filetypes to automatically attach to.
filetypes = { "rust" },
-- Sets the "workspace" to the directory where any of these files is found.
-- Files that share a root directory will reuse the LSP server connection.
-- Nested lists indicate equal priority, see |vim.lsp.Config|.
root_markers = { { "Cargo.toml" }, ".git" },
-- Specific settings to send to the server. The schema is server-defined.
settings = {},
}
-- Make LSP server config into effects.
vim.lsp.enable("safety-lsp")
Dependencies
~16–22MB
~491K SLoC