Add some experimental completion code for tsserver
This commit is contained in:
@@ -26,7 +26,7 @@ function! ale#lsp#tsserver_message#Change(buffer) abort
|
||||
\ 'file': expand('#' . a:buffer . ':p'),
|
||||
\ 'line': 1,
|
||||
\ 'offset': 1,
|
||||
\ 'endLine': 1073741824 ,
|
||||
\ 'endLine': 1073741824,
|
||||
\ 'endOffset': 1,
|
||||
\ 'insertString': join(l:lines, "\n"),
|
||||
\}]
|
||||
@@ -35,3 +35,21 @@ endfunction
|
||||
function! ale#lsp#tsserver_message#Geterr(buffer) abort
|
||||
return [1, 'ts@geterr', {'files': [expand('#' . a:buffer . ':p')]}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#tsserver_message#Completions(buffer, line, column) abort
|
||||
" An optional 'prefix' key can be added here for a completion prefix.
|
||||
return [0, 'ts@completions', {
|
||||
\ 'line': a:line,
|
||||
\ 'offset': a:column,
|
||||
\ 'file': expand('#' . a:buffer . ':p'),
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#tsserver_message#CompletionEntryDetails(buffer, line, column, entry_names) abort
|
||||
return [0, 'ts@completionEntryDetails', {
|
||||
\ 'line': a:line,
|
||||
\ 'offset': a:column,
|
||||
\ 'file': expand('#' . a:buffer . ':p'),
|
||||
\ 'entryNames': a:entry_names,
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user