3
3
" nvim-lspconfig and volar/packages/shared/src/types.ts
4
4
5
5
call ale#Set (' vue_volar_executable' , ' vue-language-server' )
6
- call ale#Set (' vue_volar_use_global' , get ( g: , ' ale_use_global_executables ' , 0 ) )
6
+ call ale#Set (' vue_volar_use_global' , 1 )
7
7
call ale#Set (' vue_volar_init_options' , {
8
- \ ' documentFeatures' : {
9
- \ ' documentColor' : v: false ,
10
- \ ' documentFormatting' : {
11
- \ ' defaultPrintWidth' : 100 ,
12
- \ },
13
- \ ' documentSymbol' : v: true ,
14
- \ ' foldingRange' : v: true ,
15
- \ ' linkedEditingRange' : v: true ,
16
- \ ' selectionRange' : v: true ,
17
- \ },
18
- \ ' languageFeatures' : {
19
- \ ' callHierarchy' : v: true ,
20
- \ ' codeAction' : v: true ,
21
- \ ' codeLens' : v: true ,
22
- \ ' completion' : {
23
- \ ' defaultAttrNameCase' : ' kebabCase' ,
24
- \ ' defaultTagNameCase' : ' both' ,
25
- \ ' getDocumentNameCaseRequest' : v: false ,
26
- \ ' getDocumentSelectionRequest' : v: false ,
27
- \ },
28
- \ ' definition' : v: true ,
29
- \ ' diagnostics' : v: true ,
30
- \ ' documentHighlight' : v: true ,
31
- \ ' documentLink' : v: true ,
32
- \ ' hover' : v: true ,
33
- \ ' references' : v: true ,
34
- \ ' rename' : v: true ,
35
- \ ' renameFileRefactoring' : v: true ,
36
- \ ' schemaRequestService' : v: true ,
37
- \ ' semanticTokens' : v: false ,
38
- \ ' signatureHelp' : v: true ,
39
- \ ' typeDefinition' : v: true ,
40
- \ ' workspaceSymbol' : v: false ,
41
- \ },
42
- \ ' typescript' : {
43
- \ ' serverPath' : ' ' ,
44
- \ ' localizedPath' : v: null ,
45
- \ },
8
+ \ ' typescript' : { ' tsdk' : ' ' },
46
9
\} )
47
10
48
11
function ! ale_linters#vue#volar#GetProjectRoot (buffer ) abort
49
- let l: project_roots = [' package.json' , ' vite.config.js' , ' .git' , bufname (a: buffer )]
12
+ let l: project_roots = [
13
+ \ ' package.json' ,
14
+ \ ' vite.config.js' ,
15
+ \ ' vite.config.mjs' ,
16
+ \ ' vite.config.cjs' ,
17
+ \ ' vite.config.ts' ,
18
+ \ ' .git' ,
19
+ \ bufname (a: buffer )
20
+ \]
50
21
51
22
for l: project_root in l: project_roots
52
23
let l: nearest_filepath = ale#path#FindNearestFile (a: buffer , l: project_root )
@@ -60,11 +31,19 @@ function! ale_linters#vue#volar#GetProjectRoot(buffer) abort
60
31
endfunction
61
32
62
33
function ! ale_linters#vue#volar#GetInitializationOptions (buffer ) abort
63
- let l: tsserver_path = ale#path#FindNearestExecutable (a: buffer , [
64
- \ ' node_modules/typescript/lib/tsserverlibrary.js'
65
- \ ])
34
+ let l: tsserver_path = ale#path#FindNearestDirectory (a: buffer , ' node_modules/typescript/lib' )
35
+
36
+ if l: tsserver_path is # ' '
37
+ " no-custom-checks
38
+ echohl WarningMsg
39
+ " no-custom-checks
40
+ echom ' [volar] Must have typescript installed in project, please install via `npm install -D typescript`.'
41
+ " no-custom-checks
42
+ echohl None
43
+ endif
44
+
66
45
let l: init_options = ale#Var (a: buffer , ' vue_volar_init_options' )
67
- let l: init_options .typescript.serverPath = l: tsserver_path
46
+ let l: init_options .typescript.tsdk = l: tsserver_path
68
47
69
48
return l: init_options
70
49
endfunction
0 commit comments