From 646f957bdb27f4157ad0d9815f8cfa1533db8f5f Mon Sep 17 00:00:00 2001 From: Michiel van den Heuvel Date: Sat, 24 Jun 2023 19:24:33 +0200 Subject: Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 7b523ad..2b98a91 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ start the language server. Your language server probably supports stdio but maybe requires a [special command line flag](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#implementationConsiderations). -Additional field are: +Additional fields are: * `settings` - a table of arbitrary possibly nested data. It is sent in a `workspace/didChangeConfiguration` to the language server after initialization. It is also used to lookup configuration for the `workspace/configuratio` method call. * `init_options` - table of arbitrary possibly nested data. It is send to the server as `initializationOptions` in the parameters of the `initialize` method call. -- cgit v1.2.3 From e83950a7149f364b653395cdd4d9446875a7f469 Mon Sep 17 00:00:00 2001 From: Michiel van den Heuvel Date: Fri, 16 Jun 2023 18:23:58 +0200 Subject: Add textDocument/formatting implementation This is tested with the Rust language server and the Lua one. Moving the cursor to the correct position afterwards works with Rust, but not with Lua. Being smarter about the ranges is probably necessary for Lua and might make other ones more robust. --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 2b98a91..b9d6cae 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ vis-lspc currently supports: * `textDocument/implementation` * `textDocument/hover` * `textDocument/rename` +* `textDocument/formatting` * `[Diagnostics]` ## Whats not working @@ -109,6 +110,7 @@ vis-lspc is in a early state, but if you are brave there are some default key bi # workspace edits lspc-rename - rename the identifier under the cursor to + lspc-format - format the file in the current window # development support lspc-hover - hover over the current line -- cgit v1.2.3 From 336cf3083232e824c8990834b56c6a1068b5a631 Mon Sep 17 00:00:00 2001 From: Michiel van den Heuvel Date: Sat, 24 Jun 2023 19:46:03 +0200 Subject: Make formatting options sort of configurable This should be wired up to code that's in a pull request in the vis repository for the default options. This PR does not yet expose `expandtab`. Referenced PR: https://github.com/martanne/vis/pull/717 --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index b9d6cae..ffd98d6 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,7 @@ Additional fields are: * `settings` - a table of arbitrary possibly nested data. It is sent in a `workspace/didChangeConfiguration` to the language server after initialization. It is also used to lookup configuration for the `workspace/configuratio` method call. * `init_options` - table of arbitrary possibly nested data. It is send to the server as `initializationOptions` in the parameters of the `initialize` method call. +* `formatting_options` - table of configuration data as found in [the LSP specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_formatting). `tabSize` and `insertSpaces` are required. **Example:** The language server configuration entry in the `ls_map` for lua-language-server @@ -163,6 +164,7 @@ ls_map.lua = { settings = { Lua = {diagnostics = {globals = {'vis'}}, telemetry = {enable = false}}, }, + formatting_options = {tabSize = 2, insertSpaces = true}, }, ``` -- cgit v1.2.3