dense-analysis / ale

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

Setting ale_typescript_tsserver_config_path has no effect #4798

Open Konstantin-Glukhov opened 1 week ago

Konstantin-Glukhov commented 1 week ago

Information

VIM version

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled May 21 2024 22:55:41) MS-Windows 64-bit GUI version with OLE support Included patches: 1-429

What went wrong

tsserver starts without config file when b:ale_typescript_tsserver_config_path is set

According to the ale-typescript.txt:

g:ale_typescript_tsserver_config_path   *g:ale_typescript_tsserver_config_path*
                                        *b:ale_typescript_tsserver_config_path*
  Type: |String|
  Default: `''`

  ALE will first discover the tsserver.json path in an ancestor directory. If
  no such path exists, this variable will be used instead.

I guess this feature is not implemented. Looking through the code I don't see any attempt to use the set env variable. The only attempt to locate tsconfig.json is in

autoload\ale\handlers\tsserver.vim
5:    let l:tsconfig_file = ale#path#FindNearestFile(a:buffer, 'tsconfig.json')

function ale#path#FindNearestFile() only searches the current tree upwords. There is no code to look in ale_typescript_tsserver_config_path.

Reproducing the bug

let b:ale_typescript_tsserver_config_path = 'E:\Config' :ALELint

:ALEInfo

Linter Variables: let g:ale_javascript_tsserver_config_path = '' let b:ale_javascript_tsserver_config_path = 'E:\Config' let g:ale_javascript_tsserver_executable = 'tsserver' let g:ale_javascript_tsserver_use_global = 0

Command History:

(executable check - success) tsserver (started) 'cmd /s/c "tsserver"'