https://github.com/jpeach/cscope-lsp
cscope line interface for cquery
https://github.com/jpeach/cscope-lsp
cscope language-server-protocol lsp vim
Last synced: about 1 year ago
JSON representation
cscope line interface for cquery
- Host: GitHub
- URL: https://github.com/jpeach/cscope-lsp
- Owner: jpeach
- License: apache-2.0
- Created: 2018-05-16T04:07:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T06:01:03.000Z (over 3 years ago)
- Last Synced: 2025-03-31T11:21:50.700Z (about 1 year ago)
- Topics: cscope, language-server-protocol, lsp, vim
- Language: Go
- Size: 48.8 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cscope-lsp
cscope line interface for a [Language Server](https://langserver.org).
## Vim Integration
To use `cscope-lsp` in your vim session, you need to do a bit of
configuration:
```vim
" Return the current cursor position as "file:line:col"
function! s:position()
return expand('%') . ':' . line('.') . ':' . col('.')
endfunction
if has("cscope")
:execute ':set cscopeprg=cscope-lsp'
" The file argument to 'add' is ignored by cscope-lsp but
" required by the vim cscope integration. Any file name
" will do here.
:execute ':cs add .gitignore'
" cs: Find symbol
map cs :cs find s =position()
" cg: Find definition
map cg :cs find g =position()
" cc: Find callers
map cc :cs find c =position()
" cd: Find callees
map cd :cs find d =position()
" ct: Find text string
map ct :cs find t =position()
" ce: Find egrep pattern
map ce :cs find e =position()
" cf: Find file
map cf :cs find f =position()
" ci: Find files #including this
map ci :cs find i =position()
endif
```
It can be hard to understand the interaction between `cscope-lsp`
and [cquery](https://github.com/cquery-project/cquery), but trace
mode can be helpful here. To enable tracing, add the `--trace`
option to the `cscope-lsp` argument, like this:
```vim
:execute ':cs add compile_commands.json . --trace=/tmp/cscope.trace'
```