Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sysdig-lsp"
version = "0.4.0"
version = "0.4.1"
edition = "2024"
authors = [ "Sysdig Inc." ]
readme = "README.md"
Expand Down
56 changes: 44 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ Navigate to **Settings > Configure Kate > LSP Client > User Server Settings** an

### JetBrains IDEs


> [!WARNING]
> The configuration for JetBrains IDEs is not definitive.
> In the future, we plan to develop a dedicated plugin that will automatically manage the LSP and expand its functionalities.
Expand All @@ -157,7 +156,7 @@ Navigate to **Settings > Configure Kate > LSP Client > User Server Settings** an
}
```

### Vim with coc.nvim
### Vim with coc.nvim (to be reviewed)

Add the following to your `coc.nvim` configuration:

Expand All @@ -177,22 +176,55 @@ Add the following to your `coc.nvim` configuration:

### Neovim with nvim-lspconfig

Refer to the [Neovim LSP configuration guide](https://neovim.io/doc/user/lsp.html#lsp-config) and add:
Install [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig?tab=readme-ov-file#install):

```bash
git clone https://github.com/neovim/nvim-lspconfig ~/.config/nvim/pack/plugins/start/nvim-lspconfig
```

Now you can use `require("lspconfig")`, so add in your `~/.config/nvim/init.lua`:

```lua
return {
default_config = {
cmd = { 'sysdig-lsp' },
root_dir = util.root_pattern('.git'),
filetypes = {
'dockerfile',
local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")

if not configs.sysdig then
configs.sysdig = {
default_config = {
cmd = { "sysdig-lsp" },
root_dir = lspconfig.util.root_pattern(".git"),
filetypes = { "dockerfile" },
single_file_support = true,
init_options = {
sysdig = {
api_url = "https://us2.app.sysdig.com",
-- api_token = "my_token", -- if not specified, will be retrieved from the SYSDIG_API_TOKEN env var.
},
},
},
single_file_support = true,
init_options = {
activateSnykCode = 'true',
}
end

lspconfig.sysdig.setup({})
```

### Neovim 0.11+ (without plugins)

Refer to the [Neovim LSP configuration guide](https://neovim.io/doc/user/lsp.html#lsp-config) and add the following config in `~/.config/nvim/init.lua`:

```lua
vim.lsp.config.sysdig = {
cmd = {"sysdig-lsp"},
root_markers = {"Dockerfile"},
filetypes = { "dockerfile" },
init_options = {
sysdig = {
api_url = "https://us2.app.sysdig.com",
-- api_token = "my_token", -- if not specified, will be retrieved from the SYSDIG_API_TOKEN env var.
},
},
}
vim.lsp.enable("sysdig")
```

## Hacking
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() {
let (service, messages) = LspService::new(|client| {
let subscriber = tracing_subscriber::registry()
.with(LSPLogger::new(client.clone()))
.with(tracing_subscriber::fmt::layer());
.with(tracing_subscriber::fmt::layer().with_writer(std::io::stderr));

tracing::subscriber::set_global_default(subscriber)
.expect("setting default subscriber failed");
Expand Down