dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.51k stars 1.43k forks source link

Typo in lua-language-server variable name, with fix #4581

Open nospam2998 opened 1 year ago

nospam2998 commented 1 year ago

Fixed on branch: https://git.netizen.se/ale/commit/?h=fix/lua-language-server_docs

Information

VIM version

% dpkg --list vim-gtk3 | sed -n 's/^ii\s*\(\S*\s*\S*\).*/\1/p'
vim-gtk3       2:9.0.1378-2

Operating System:

% lsb_release --description 2>/dev/null 
Description:    Debian GNU/Linux 12 (bookworm)

What went wrong

Following instructions for setting luals configuration from :help ale-lua-language-server does not result in any workspace/didChangeConfiguration method call. That's unexpected.

Reproducing the bug

Place in ~/.vimrc:

let g:ale_lua_lua_language_server_config = { 'key': 'value' }

A more expected behaviour occurs if changed into:

let g:ale_lua_language_server_config = { 'key': 'value' }
nospam2998 commented 2 weeks ago

Ping @hsanson !

Branch rebased onto latest master (a7ef181) and patch included below for your convenience:

From a5724da028879660d8b6b53f4d063a4520f931c9 Mon Sep 17 00:00:00 2001
From: cos <cos>
Date: Mon, 7 Aug 2023 22:38:09 +0200
Subject: [PATCH] Fix lua_language_server_config variable name

Since added in commit f2a21c9, the implementation and documentation has
differed in their naming. The latter has had an additional lua_-prefix.

With this fix, setting the variable as documented actually results in a
'workspace/didChangeConfiguration' method being executed on the luals.
---
 doc/ale-lua.txt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/doc/ale-lua.txt b/doc/ale-lua.txt
index 62d67324..ee0a8780 100644
--- a/doc/ale-lua.txt
+++ b/doc/ale-lua.txt
@@ -42,14 +42,18 @@ g:ale_lua_language_server_executable     *g:ale_lua_language_server_executable*
   will be `'/some/path/bin/lua-language-server'`.

-g:ale_lua_lua_language_server_config     *g:ale_lua_lua_language_server_config*
-                                         *b:ale_lua_lua_language_server_config*
+g:ale_lua_language_server_config             *g:ale_lua_language_server_config*
+                                             *b:ale_lua_language_server_config*
   Type: |Dictionary|
   Default: `{}`

   Dictionary containing configuration settings that will be passed to the
   language server.

+  For available configuration parameters, see `Settings` on the luals wiki:
+
+  https://luals.github.io/wiki/settings/
+

 ===============================================================================
 luac                                                             *ale-lua-luac*
-- 
2.45.2

Could we see this patch applied, please?