コード例 #1
0
    def get_param_type(self):
        view = self.window.active_view()
        complete = HaxeComplete_inst()

        comps, hints = complete.get_haxe_completions(view, view.sel()[0].end(), ignoreTopLevel=True)

        return hints
コード例 #2
0
    def get_param_type(self):
        view = self.window.active_view()
        complete = HaxeComplete_inst()

        for r in view.sel():
            comps, hints = complete.get_haxe_completions(view, r.end())

        return hints
コード例 #3
0
    def get_param_type(self):
        view = self.window.active_view()
        complete = HaxeComplete_inst()

        for r in view.sel():
            comps, hints = complete.get_haxe_completions(view, r.end())

        return hints
コード例 #4
0
    def get_param_type(self):
        view = self.window.active_view()
        complete = HaxeComplete_inst()

        comps, hints = complete.get_haxe_completions(
            view, view.sel()[0].end(), ignoreTopLevel=True)

        return hints
コード例 #5
0
    def run(self, edit, input=''):
        complete = HaxeComplete_inst()
        view = self.view

        if not input:
            pos = view.sel()[0].end()
            if view.substr(pos) == '(' and view.score_selector(
                    pos - 1, 'source.haxe.2 meta.parameters.haxe.2') == 0:
                view.run_command('haxe_show_type')
                return

        if input == '(':
            sel = view.sel()
            emptySel = True
            for r in sel:
                if not r.empty():
                    emptySel = False
                    break

            autoMatch = view.settings().get('auto_match_enabled', False)

            if autoMatch:
                if emptySel:
                    view.run_command('insert_snippet', {
                        'contents': '($0)'
                    })
                else:
                    view.run_command('insert_snippet', {
                        'contents': '(${0:$SELECTION})'
                    })
            else:
                view.run_command('insert', {
                    'characters': '('
                })
        else:
            view.run_command('insert', {
                'characters': input
            })

        if input and not view.settings().get('haxe_auto_complete', True):
            return

        haxe_smart_snippets = view.settings().get('haxe_smart_snippets', False)
        haxe_use_popup = view.settings().get('haxe_use_popup', True) and \
            int(sublime.version()) >= 3070

        if not haxe_smart_snippets and not haxe_use_popup:
            return

        for r in view.sel():
            comps, hints = complete.get_haxe_completions(
                view, r.end(), ignoreTopLevel=True)

            if haxe_use_popup:
                self.show_popup(hints)
            elif haxe_smart_snippets and input:
                self.insert_snippet(hints)
コード例 #6
0
    def run(self, edit, input=''):
        complete = HaxeComplete_inst()
        view = self.view

        if not input:
            pos = view.sel()[0].end()
            if view.substr(pos) == '(' and view.score_selector(
                    pos - 1, 'source.haxe.2 meta.parameters.haxe.2') == 0:
                view.run_command('haxe_show_type')
                return

        if input == '(':
            sel = view.sel()
            emptySel = True
            for r in sel:
                if not r.empty():
                    emptySel = False
                    break

            autoMatch = view.settings().get('auto_match_enabled', False)

            if autoMatch:
                if emptySel:
                    view.run_command('insert_snippet', {'contents': '($0)'})
                else:
                    view.run_command('insert_snippet',
                                     {'contents': '(${0:$SELECTION})'})
            else:
                view.run_command('insert', {'characters': '('})
        else:
            view.run_command('insert', {'characters': input})

        if input and not view.settings().get('haxe_auto_complete', True):
            return

        haxe_smart_snippets = view.settings().get('haxe_smart_snippets', False)
        haxe_use_popup = view.settings().get('haxe_use_popup', True) and \
            int(sublime.version()) >= 3070

        if not haxe_smart_snippets and not haxe_use_popup:
            return

        for r in view.sel():
            comps, hints = complete.get_haxe_completions(view,
                                                         r.end(),
                                                         ignoreTopLevel=True)

            if haxe_use_popup:
                self.show_popup(hints)
            elif haxe_smart_snippets and input:
                self.insert_snippet(hints)
コード例 #7
0
    def run(self, edit, input=''):
        complete = HaxeComplete_inst()
        view = self.view

        if input == '(':
            sel = view.sel()
            emptySel = True
            for r in sel:
                if not r.empty():
                    emptySel = False
                    break

            autoMatch = view.settings().get('auto_match_enabled', False)

            if autoMatch:
                if emptySel:
                    view.run_command('insert_snippet', {
                        'contents': '($0)'
                    })
                else:
                    view.run_command('insert_snippet', {
                        'contents': '(${0:$SELECTION})'
                    })
            else:
                view.run_command('insert', {
                    'characters': '('
                })
        else:
            view.run_command('insert', {
                'characters': input
            })

        autocomplete = view.settings().get('auto_complete', True)
        if not autocomplete:
            return

        haxe_smart_snippets = view.settings().get('haxe_smart_snippets', False)
        haxe_use_popup = view.settings().get('haxe_use_popup', True) and \
            int(sublime.version()) >= 3070

        if not haxe_smart_snippets and not haxe_use_popup:
            return

        for r in view.sel():
            comps, hints = complete.get_haxe_completions(view, r.end())

            if haxe_use_popup:
                self.show_popup(hints)
            elif haxe_smart_snippets and input:
                self.insert_snippet(hints)
コード例 #8
0
    def run(self, edit, input=''):
        complete = HaxeComplete_inst()
        view = self.view

        if input == '(':
            sel = view.sel()
            emptySel = True
            for r in sel:
                if not r.empty():
                    emptySel = False
                    break

            autoMatch = view.settings().get('auto_match_enabled', False)

            if autoMatch:
                if emptySel:
                    view.run_command('insert_snippet', {'contents': '($0)'})
                else:
                    view.run_command('insert_snippet',
                                     {'contents': '(${0:$SELECTION})'})
            else:
                view.run_command('insert', {'characters': '('})
        else:
            view.run_command('insert', {'characters': input})

        autocomplete = view.settings().get('auto_complete', True)
        if not autocomplete:
            return

        haxe_smart_snippets = view.settings().get('haxe_smart_snippets', False)
        haxe_use_popup = view.settings().get('haxe_use_popup', True) and \
            int(sublime.version()) >= 3070

        if not haxe_smart_snippets and not haxe_use_popup:
            return

        for r in view.sel():
            comps, hints = complete.get_haxe_completions(view, r.end())

            if haxe_use_popup:
                self.show_popup(hints)
            elif haxe_smart_snippets and input:
                self.insert_snippet(hints)