Comments (6)
Calling the following (as expected) just shows the signature tooltip inside kakoune:
This behavior appears to be hardcoded; see here.
I don't think you can do much without e.g. changing the output command from lsp-show-signature-help
to your own in the Rust code.
You might be able to do it conditionally by adding a parameter here and hooking even deeper into the server's code.
from kakoune-lsp.
simply returns the JSON output of the LSP server unprocessed.
yeah lsp-connect
does exactly that. Would be interesting to see if it's useful. I did build an echo-current-toplevel-symbol
command which has only recently been obsoleted by modeline breadcrumbs. I don't remember if it had problems.
You'd need to revert c08c194 (Remove lsp-connect, 2024-03-11).
A usage example is documented in the original commit message 04b27ea (Introduce lsp-connect to allow users to handle raw LSP responses, 2022-02-13)
from kakoune-lsp.
I want to get the response of the signature help, process it, then insert the result out to the buffer again.
Interesting idea; not sure if signature help is the right request to do this, I use the snippets provided by the language server. When I accept the completion of a function name, it will also insert placeholders into the buffer that have the same text as in the signature help.
Normally I use <tab>
(per recommended mappings) to replace all the placeholders, but I sometimes also use <esc>
to keep them. Other editors use a similar behavior.
Which language server are you using? Is there a scenario where completion snippets don't work?
from kakoune-lsp.
The signature help was just an example since it's the easiest example to visualize I would assume. Changing some key bindings I cannot process the response (for example the signature of the function) externally and then write it into the buffer.
I guess the only way is to fork kak-lsp and dive into the Rust side.
from kakoune-lsp.
Anything is possible, the hard part is defining an output format that is usable. I have no idea which one you want.
It's not as simple as giving a list of parameter names because not every language uses ,
as separators.
Each parameter includes a label, which includes the type, so that's not really suitable for insertion
The point of kak-lsp is to be a CLI wrapper around LSP. But we can't easily provide what's not in LSP.
Of course if there is a reasonable use case we can add some hacks to make it work, and eventually standardize it.
But the hard part is designing it. What would the user interface be? A lsp-insert-default-arguments
command?
Note that we had lsp-connect
(it was recently removed but should be easy to git revert
) which should fit the bill.
However don't believe it's very useful. I don't think anyone used it. You can use it to do your thing; but it's also easy to do it on the Rust side, once you got the hang of it.
from kakoune-lsp.
Anything is possible, the hard part is defining an output format that is usable. I have no idea which one you want.
It's not as simple as giving a list of parameter names because not every language uses , as separators.
Each parameter includes a label, which includes the type, so that's not really suitable for insertion
Maybe I am misunderstanding you or not thinking far enough. I think the details of "which language" and "how to parse the response" (LSP servers JSON response) should be the issue of the consumer (i.e. what I would write as a plugin), not yours (i.e. kak-lsp). Obviously I am talking exclusively about plugin writers who want to hook into the LSP responses, not the editing experience itself with an LSP client (which is flawless, kudos!).
But the hard part is designing it. What would the user interface be? A lsp-insert-default-arguments command?
I agree that designing such an interface is non-trivial (which is also why I closed this issue). Very naively I would say a command like lsp-exec-raw-json
that takes a string of which LSP method to call ("signatureHelp") and optional arguments that are required for that specific call (no clue how/if that works in Rust) and simply returns the JSON output of the LSP server unprocessed.
I will have to try out lsp-connect
when I get the time to.
from kakoune-lsp.
Related Issues (20)
- `lsp-code-actions` seems to be broken since `v16.0.0`. HOT 12
- SIGSEGV on lsp-goto-document-symbol HOT 3
- Lexical LS does not load. HOT 5
- Add Biome to example config HOT 2
- Add `zk` to example config HOT 4
- Add Svelte to example config
- Run the LSP only when the roots is found HOT 1
- Could it be possible to parse new lines (or markdown) on the hover information? HOT 6
- Feature request: pre-render hook in hover buffer to display custom info HOT 1
- Sending experimental rust-analyzer stuff should only be done for rust-analyzer HOT 4
- Syntax error in lsp-did-change-config HOT 5
- Add htmx support HOT 8
- Add `phpactor` to the default config HOT 4
- Julia language server not starting HOT 13
- Add support for diagnostic tags HOT 7
- docs: readme for init doesn't work HOT 1
- Funny debug messages HOT 1
- Sorting of completion breaks fuzzy-matching HOT 4
- When not leaving insert mode, the insert after autocomplete marker does not get cleaned up. HOT 4
- Feauture: declare lsp_semantic_tokens as str-list HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kakoune-lsp.