Use some default regex for completion support in other filetypes
This commit is contained in:
parent
3ef98f42bd
commit
8be85c2997
@ -12,14 +12,14 @@ function! s:GetRegex(map, filetype) abort
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return ''
|
" Use the default regex for other files.
|
||||||
|
return s:should_complete_map['<default>']
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Regular expressions for checking the characters in the line before where
|
" Regular expressions for checking the characters in the line before where
|
||||||
" the insert cursor is. If one of these matches, we'll check for completions.
|
" the insert cursor is. If one of these matches, we'll check for completions.
|
||||||
let s:should_complete_map = {
|
let s:should_complete_map = {
|
||||||
\ 'javascript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$',
|
\ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$',
|
||||||
\ 'typescript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$',
|
|
||||||
\}
|
\}
|
||||||
|
|
||||||
" Check if we should look for completions for a language.
|
" Check if we should look for completions for a language.
|
||||||
|
@ -230,6 +230,9 @@ Execute(Completion should be done after words in parens in TypeScript):
|
|||||||
Execute(Completion should not be done after parens in TypeScript):
|
Execute(Completion should not be done after parens in TypeScript):
|
||||||
AssertEqual '', ale#completion#GetPrefix(&filetype, 3, 15)
|
AssertEqual '', ale#completion#GetPrefix(&filetype, 3, 15)
|
||||||
|
|
||||||
|
Execute(Completion prefixes should work for other filetypes):
|
||||||
|
AssertEqual 'ab', ale#completion#GetPrefix('xxxyyyzzz', 3, 14)
|
||||||
|
|
||||||
Execute(ale#completion#Show() should remember the omnifunc setting and replace it):
|
Execute(ale#completion#Show() should remember the omnifunc setting and replace it):
|
||||||
let &l:omnifunc = 'FooBar'
|
let &l:omnifunc = 'FooBar'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user