Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Cscope as a LSP using null-ls.nvim #71

Closed
1 task done
pidgeon777 opened this issue Jul 31, 2021 · 2 comments
Closed
1 task done

Cscope as a LSP using null-ls.nvim #71

pidgeon777 opened this issue Jul 31, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@pidgeon777
Copy link

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

If I understood correctly, through null-ls.nvim it would be possible to define a new LSP server starting from command line output or writing it in LUA source code.

My question is, there is a tool called cscope which is used to find references, definitions, call hierarchies and so on in C/C++ code.

Would it be theoretically possible to read the cscope database or parse its command line output, defining a new cscope-based LSP with null-ls.nvim? If yes, how could be achieved, and is there someone currently working on it?

Help

No

Implementation help

No response

@pidgeon777 pidgeon777 added the enhancement New feature or request label Jul 31, 2021
@jose-elias-alvarez
Copy link
Owner

jose-elias-alvarez commented Jul 31, 2021

Your understanding is correct, though we're still missing a few pieces necessary to make something like this possible. I know absolutely nothing about cscope, but based on your description and using references as an example, the flow would be like this:

  1. Neovim's LSP client sends a request for references to all attached language servers that support the method;
  2. null-ls runs the command line program with the specified arguments (or reads the database, if you're able to do that through Lua / luv) and gets its output;
  3. null-ls parses the output and restructures it into the correct LSP-friendly format; and
  4. The null-ls handler for the method sends it back to to the LSP client, which displays it to the user.

At the moment, though, null-ls only handles diagnostics, formatting, and code actions. The main task (apart from getting and parsing cscope output) would be to build handlers for the methods we don't currently support, but the core structure should be flexible enough to handle it.

I haven't heard of anyone working on this, and I'm too ignorant about cscope to do anything myself, but I'm happy to provide full support for anyone who wants to take it on, especially since it sounds like a cool project that would really showcase what null-ls can do.

@jose-elias-alvarez
Copy link
Owner

Also, I don't know how much work it would take to parse the cscope output / database, but I'll also mention that I feel that this would be more appropriate as a plugin that integrates with null-ls and not something to directly include here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants