https://github.com/dhananjaylatkar/cscope_lsp
LSP server using cscope
https://github.com/dhananjaylatkar/cscope_lsp
c lsp-server neovim
Last synced: 2 months ago
JSON representation
LSP server using cscope
- Host: GitHub
- URL: https://github.com/dhananjaylatkar/cscope_lsp
- Owner: dhananjaylatkar
- License: mit
- Created: 2024-05-03T18:49:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-17T13:25:38.000Z (about 2 years ago)
- Last Synced: 2026-03-04T10:00:00.840Z (4 months ago)
- Topics: c, lsp-server, neovim
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `cscope_lsp`
This LSP implementation uses cscope to get results quickly.
## Installation
```shell
go install github.com/dhananjaylatkar/cscope_lsp@latest
```
## Neovim config
```lua
local function start_cscope_lsp()
local root_files =
{ "cscope.out", "cscope.files", "cscope.in.out", "cscope.out.in", "cscope.out.po", "cscope.po.out" }
local paths = vim.fs.find(root_files, { stop = vim.env.HOME })
local root_dir = vim.fs.dirname(paths[1])
if root_dir then
vim.lsp.start({
name = "cscope_lsp",
cmd = { "cscope_lsp" },
root_dir = root_dir,
filetypes = { "c", "h", "cpp", "hpp" },
})
end
end
vim.api.nvim_create_autocmd("FileType", {
pattern = { "c", "h", "cpp", "hpp" },
desc = "Start cscope_lsp",
callback = start_cscope_lsp,
})
```
## Requirements
1. `cscope` is installed.
2. `cscope.out` is created and updated.
## Supported Capabilities
1. textDocument/definition
2. textDocument/references
## Thanks
Used [educationalsp](https://github.com/tjdevries/educationalsp) as starter template.