mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Use input_patterns & add comments for updating it
This commit is contained in:
@@ -59,7 +59,8 @@ let s:omni_start_map = {
|
|||||||
\ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$',
|
\ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$',
|
||||||
\}
|
\}
|
||||||
|
|
||||||
" A map of exact characters for triggering LSP completions.
|
" A map of exact characters for triggering LSP completions. Do not forget to
|
||||||
|
" update self.input_patterns in ale.py in updating entries in this map.
|
||||||
let s:trigger_character_map = {
|
let s:trigger_character_map = {
|
||||||
\ '<default>': ['.'],
|
\ '<default>': ['.'],
|
||||||
\ 'typescript': ['.', '''', '"'],
|
\ 'typescript': ['.', '''', '"'],
|
||||||
|
|||||||
@@ -24,7 +24,13 @@ class Source(Base):
|
|||||||
self.rank = 1000
|
self.rank = 1000
|
||||||
self.is_bytepos = True
|
self.is_bytepos = True
|
||||||
self.min_pattern_length = 1
|
self.min_pattern_length = 1
|
||||||
self.input_pattern = r'(\.|::|->)\w*$'
|
# Do not forget to update s:trigger_character_map in completion.vim in
|
||||||
|
# updating entries in this map.
|
||||||
|
self.input_patterns = {
|
||||||
|
'_': r'\.\w*$',
|
||||||
|
'rust': r'(\.|::)\w*$',
|
||||||
|
'typescript': r'(\.|\'|")\w*$',
|
||||||
|
}
|
||||||
|
|
||||||
# Returns an integer for the start position, as with omnifunc.
|
# Returns an integer for the start position, as with omnifunc.
|
||||||
def get_complete_position(self, context):
|
def get_complete_position(self, context):
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ class DeopleteSourceTest(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(attributes, {
|
self.assertEqual(attributes, {
|
||||||
'input_pattern': r'(\.|::|->)\w*$',
|
'input_patterns': {
|
||||||
|
'_': r'\.\w*$',
|
||||||
|
'rust': r'(\.|::)\w*$',
|
||||||
|
'typescript': r'(\.|\'|")\w*$',
|
||||||
|
},
|
||||||
'is_bytepos': True,
|
'is_bytepos': True,
|
||||||
'mark': '[L]',
|
'mark': '[L]',
|
||||||
'min_pattern_length': 1,
|
'min_pattern_length': 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user