示例#1
0
文件: omni.py 项目: N0hbdy/.dotfiles
    def __init__(self, vim):
        super().__init__(vim)

        self.name = 'omni'
        self.mark = '[O]'
        self.rank = 500
        self.is_bytepos = True
        self.min_pattern_length = 0

        self._input_patterns = {}
        set_pattern(self._input_patterns, 'css,less,scss,sass',
                    [r'\w+', r'\w+[):;]?\s+\w*', r'[@!]'])
        set_pattern(self._input_patterns, 'lua',
                    [r'\w+[.:]\w*', r'require\s*\(?["'']\w*'])
示例#2
0
    def __init__(self, vim):
        super().__init__(vim)

        self.name = 'omni'
        self.mark = '[O]'
        self.rank = 500
        self.is_bytepos = True
        self.min_pattern_length = 0

        self._input_patterns = {}
        set_pattern(self._input_patterns, 'css,less,scss,sass',
                    [r'\w+', r'\w+[):;]?\s+\w*', r'[@!]'])
        set_pattern(self._input_patterns, 'lua',
                    [r'\w+[.:]\w*', r'require\s*\(?["'']\w*'])
示例#3
0
    def __init__(self, vim):
        super().__init__(vim)

        self.name = 'omni'
        self.mark = '[O]'
        self.rank = 500
        self.is_bytepos = True
        self.min_pattern_length = 0

        input_patterns = {}
        set_pattern(input_patterns, 'css,less,scss,sass',
                    [r'\w{2}', r'\w+:?\s*\w*', r'[@!]'])
        self.vars = {
            'input_patterns': input_patterns,
            'functions': {},
        }
示例#4
0
    def __init__(self, vim):
        super().__init__(vim)

        self.name = 'omni'
        self.mark = '[O]'
        self.rank = 500
        self.is_bytepos = True
        self.min_pattern_length = 0

        input_patterns = {}
        set_pattern(input_patterns, 'css,less,scss,sass',
                    [r'\w{2}', r'\w+:?\s*\w*', r'[@!]'])
        self.vars = {
            'input_patterns': input_patterns,
            'functions': {},
        }
示例#5
0
    def __init__(self, vim):
        super().__init__(vim)

        self.name = 'omni'
        self.mark = '[O]'
        self.rank = 500
        self.is_bytepos = True
        self.min_pattern_length = 0

        self.__prev_linenr = -1
        self.__prev_pos = -1
        self.__prev_input = ''
        self.__prev_candidates = []

        self.__input_patterns = {}
        set_pattern(self.__input_patterns, 'css,less,scss,sass',
                    [r'\w+', r'\w+[):;]?\s+\w*', r'[@!]'])
        set_pattern(self.__input_patterns, 'ruby',
                    [r'[^. \t0-9]\.\w*', r'[a-zA-Z_]\w*::\w*'])
        set_pattern(self.__input_patterns, 'javascript',
                    [r'[^. \t0-9]\.\w*'])
        set_pattern(self.__input_patterns, 'lua',
                    [r'\w+[.:]', r'require\s*\(?["'']\w*'])
示例#6
0
    def __init__(self, vim):
        super().__init__(vim)

        self.name = 'omni'
        self.mark = '[O]'
        self.rank = 500
        self.is_bytepos = True
        self.min_pattern_length = 0

        self.__prev_linenr = -1
        self.__prev_pos = -1
        self.__prev_input = ''
        self.__prev_candidates = []

        self.__input_patterns = {}
        set_pattern(self.__input_patterns, 'css,less,scss,sass',
                    ['\w+', r'\w+[):;]?\s+\w*', r'[@!]'])
        set_pattern(self.__input_patterns, 'ruby',
                    [r'[^. \t0-9]\.\w*', r'[a-zA-Z_]\w*::\w*'])
        set_pattern(self.__input_patterns, 'lua',
                    [r'\w+[.:]', r'require\s*\(?["'']\w*'])
示例#7
0
    def __init__(self, vim):
        Base.__init__(self, vim)

        self.name = 'member'
        self.mark = '[M]'
        self.min_pattern_length = 0

        self.__object_pattern = r'[a-zA-Z_]\w*(?:\(\)?)?'
        self.__prefix = ''

        self.__prefix_patterns = {}
        set_pattern(self.__prefix_patterns,
                    '_', '\.')
        set_pattern(self.__prefix_patterns,
                    'c,objc', ['\.', '->'])
        set_pattern(self.__prefix_patterns,
                    'cpp,objcpp', ['\.', '->', '::'])
        set_pattern(self.__prefix_patterns,
                    'perl,php', ['->'])
        set_pattern(self.__prefix_patterns,
                    'ruby', ['\.', '::'])
        set_pattern(self.__prefix_patterns,
                    'lua', ['\.', ':'])
示例#8
0
    def __init__(self, vim):
        super().__init__(vim)

        self.name = 'member'
        self.mark = '[M]'
        self.min_pattern_length = 0

        self._object_pattern = r'[a-zA-Z_]\w*(?:\(\)?)?'
        self._prefix = ''

        prefix_patterns = {}
        set_pattern(prefix_patterns,
                    '_', r'\.')
        set_pattern(prefix_patterns,
                    'c,objc', [r'\.', '->'])
        set_pattern(prefix_patterns,
                    'cpp,objcpp', [r'\.', '->', '::'])
        set_pattern(prefix_patterns,
                    'perl,php', ['->'])
        set_pattern(prefix_patterns,
                    'ruby', [r'\.', '::'])
        set_pattern(prefix_patterns,
                    'lua', [r'\.', ':'])
        self.vars = {
            'prefix_patterns': prefix_patterns,
        }
示例#9
0
    def __init__(self, vim: Nvim) -> None:
        super().__init__(vim)

        self.name = 'member'
        self.mark = '[M]'
        self.min_pattern_length = 0

        self._object_pattern = r'[a-zA-Z_]\w*(?:\(\)?)?'
        self._prefix = ''

        prefix_patterns: typing.Dict[str, str] = {}
        set_pattern(prefix_patterns,
                    '_', r'\.')
        set_pattern(prefix_patterns,
                    'c,objc', [r'\.', '->'])
        set_pattern(prefix_patterns,
                    'cpp,objcpp', [r'\.', '->', '::'])
        set_pattern(prefix_patterns,
                    'perl,php', ['->'])
        set_pattern(prefix_patterns,
                    'ruby', [r'\.', '::'])
        set_pattern(prefix_patterns,
                    'lua', [r'\.', ':'])
        self.vars = {
            'prefix_patterns': prefix_patterns,
        }
示例#10
0
    def __init__(self, vim):
        Base.__init__(self, vim)

        self.name = 'member'
        self.mark = '[M]'
        self.buffers = {}
        self.min_pattern_length = 0

        # Initialize member prefix patterns
        set_default(self.vim, 'g:deoplete#member#prefix_patterns', {})
        set_default(self.vim, 'g:deoplete#member#_prefix_patterns', {})
        set_pattern(self.vim, 'g:deoplete#member#_prefix_patterns', 'c,objc',
                    r'\.|->')
        set_pattern(self.vim, 'g:deoplete#member#_prefix_patterns',
                    'cpp,objcpp', r'\.|->|::')
        set_pattern(self.vim, 'g:deoplete#member#_prefix_patterns', 'perl,php',
                    r'->')
        set_pattern(self.vim, 'g:deoplete#member#_prefix_patterns',
                    'cs,java,javascript,d,vim,ruby,python,perl6,scala,vb',
                    r'\.')
        set_pattern(self.vim, 'g:deoplete#member#_prefix_patterns',
                    'cs,java,javascript,d,vim,ruby,python,perl6,scala,vb',
                    r'\.')
        set_pattern(self.vim, 'g:deoplete#member#_prefix_patterns', 'ruby',
                    r'\.|::')
        set_pattern(self.vim, 'g:deoplete#member#_prefix_patterns', 'lua',
                    r'\.|:')

        # Initialize member object pattern
        self.object_pattern = r'[a-zA-Z_]\w*(?:\(\)?)?'
示例#11
0
    def __init__(self, vim):
        Base.__init__(self, vim)

        self.name = 'member'
        self.mark = '[M]'
        self.buffers = {}
        self.min_pattern_length = 0

        # Initialize member prefix patterns
        set_default(self.vim,
                    'g:deoplete#member#prefix_patterns', {})
        set_default(self.vim,
                    'g:deoplete#member#_prefix_patterns', {})
        set_pattern(self.vim,
                    'g:deoplete#member#_prefix_patterns',
                    'c,objc', r'\.|->')
        set_pattern(self.vim,
                    'g:deoplete#member#_prefix_patterns',
                    'cpp,objcpp', r'\.|->|::')
        set_pattern(self.vim,
                    'g:deoplete#member#_prefix_patterns',
                    'perl,php', r'->')
        set_pattern(self.vim,
                    'g:deoplete#member#_prefix_patterns',
                    'cs,java,javascript,d,vim,ruby,python,perl6,scala,vb',
                    r'\.')
        set_pattern(self.vim,
                    'g:deoplete#member#_prefix_patterns',
                    'cs,java,javascript,d,vim,ruby,python,perl6,scala,vb',
                    r'\.')
        set_pattern(self.vim,
                    'g:deoplete#member#_prefix_patterns',
                    'ruby', r'\.|::')
        set_pattern(self.vim,
                    'g:deoplete#member#_prefix_patterns',
                    'lua', r'\.|:')

        # Initialize member object pattern
        self.object_pattern = r'[a-zA-Z_]\w*(?:\(\)?)?'