From 43eea17544e4bed4384c76d3d95be2c0688b9e27 Mon Sep 17 00:00:00 2001 From: pommicket Date: Thu, 29 Dec 2022 18:51:49 -0500 Subject: little things --- README.md | 11 +++++++++-- lsp-write.c | 5 +++++ main.c | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b3ab8aa..60677b9 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ to include the absolute path if not). [clangd](https://clangd.llvm.org/installation) is enabled by default. On Debian/Ubuntu you can install it with: -``` +```bash sudo apt install clangd-15 # replace 15 with the highest number you can get sudo ln -s /usr/bin/clangd-15 /usr/bin/clangd ``` @@ -180,6 +180,13 @@ You can download it [here](https://github.com/python-lsp/python-lsp-server). `rust-analyzer` is enabled by default. You can download it by following [the instructions here](https://rust-analyzer.github.io/manual.html#rust-analyzer-language-server-binary). +On Linux you can install it with: + +```bash +mkdir -p ~/.local/bin +curl -L https://github.com/rust-lang/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer +chmod +x ~/.local/bin/rust-analyzer +``` ## Tags (lightweight LSP alternative) @@ -204,7 +211,7 @@ To install `ted` from source on Linux, you will also need: These can be installed on Ubuntu/Debian with: -``` +```bash sudo apt install clang libsdl2-dev cmake ``` diff --git a/lsp-write.c b/lsp-write.c index 7d8a0f1..9d7c2b1 100644 --- a/lsp-write.c +++ b/lsp-write.c @@ -432,6 +432,11 @@ static void write_request(LSP *lsp, LSPRequest *request) { write_arr_elem_string(o, "plaintext"); write_arr_end(o); write_obj_end(o); + + // definition capabilities + write_key_obj_start(o, "definition"); + // NOTE: LocationLink support doesn't seem useful to us right now. + write_obj_end(o); write_obj_end(o); write_key_obj_start(o, "workspace"); write_key_bool(o, "workspaceFolders", true); diff --git a/main.c b/main.c index c02774f..766a426 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,6 @@ /* @TODO: -- check definition capabilities +- LSPResponse is_error member (and make sure ide-*.c handles it) - some way of showing that we're currently loading the definition location (different cursor color?) - more LSP stuff: - go to definition using LSP -- cgit v1.2.3