Skip to content

Commit

Permalink
astro-ls: fix initializationOptions to use tsdk instead of serverPath…
Browse files Browse the repository at this point in the history
…, localizedPath
  • Loading branch information
shusch authored and mattn committed Jul 25, 2024
1 parent 3f1ca4d commit f7cb396
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions settings/astro-ls.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function! s:get_current_ts_path() abort
let ts_path = '/node_modules/typescript/lib/tsserverlibrary.js'
let ts_path = '/node_modules/typescript/lib'

let project_dir = lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'package.json')
let tsserverlibrary_path = project_dir . ts_path
Expand All @@ -9,8 +9,7 @@ function! s:get_current_ts_path() abort

let path = filereadable(tsserverlibrary_path) ? tsserverlibrary_path : fallback_path
return {
\ 'serverPath': path,
\ 'localizedPath': v:null,
\ 'tsdk': path,
\ }
endfunction

Expand All @@ -22,8 +21,7 @@ endfunction

let g:vim_lsp_settings_astro_options = {
\ 'typescript': {
\ 'serverPath': '',
\ 'localizedPath': v:null,
\ 'tsdk': '',
\ },
\ }

Expand Down

0 comments on commit f7cb396

Please sign in to comment.