Example #1
0
    def on_modified(self, view):
        lint_check_fly = get_setting('lint_check_fly')
        auto_check_enabled = get_setting('enable_auto_check')
        auto_lint_enabled = get_setting('enable_auto_lint')

        if lint_check_fly and is_haskell_source(view) and view.file_name():
            self.fly_agent.fly(view)
Example #2
0
 def on_query_context(self, view, key, operator, operand, match_all):
     if key == 'auto_completion_popup':
         return get_setting('auto_completion_popup')
     elif key == 'is_haskell_source':
         return is_haskell_source(view)
     else:
         return False
Example #3
0
    def on_modified(self, view):
        lint_check_fly = get_setting('lint_check_fly')
        auto_check_enabled = get_setting('enable_auto_check')
        auto_lint_enabled = get_setting('enable_auto_lint')

        if lint_check_fly and is_haskell_source(view) and view.file_name():
            self.fly_agent.fly(view)
Example #4
0
    def on_query_completions(self, view, prefix, locations):
        if not is_haskell_source(view):
            return []

        begin_time = time.clock()
        # Only suggest symbols if the current file is part of a Cabal project.
        # TODO: Only suggest symbols from within this project.

        completions = autocompletion.get_import_completions(view, prefix, locations)

        if not completions:
            completions = autocompletion.get_completions(view, prefix, locations)

        end_time = time.clock()
        log('time to get completions: {0} seconds'.format(end_time - begin_time))
        # Don't put completions with special characters (?, !, ==, etc.)
        # into completion because that wipes all default Sublime completions:
        # See http://www.sublimetext.com/forum/viewtopic.php?t=8659
        # TODO: work around this
        comp = [c for c in completions if NO_SPECIAL_CHARS_RE.match(c[0])]
        if get_setting('inhibit_completions'):
            return (comp, sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)
        return comp
Example #5
0
 def on_selection_modified(self, view):
     if is_haskell_source(view) and view.file_name() and file_types.has(view.file_name()) and file_types.shown(view.file_name()):
         view.run_command('sublime_haskell_show_all_types', { 'filename': view.file_name() })
Example #6
0
 def is_enabled(self):
     return is_haskell_source(self.view) and self.view.file_name() is not None
Example #7
0
 def is_enabled(self):
     return is_haskell_source(self.view) and self.view.file_name() is not None and file_types.has(self.view.file_name()) and file_types.shown(self.view.file_name())
Example #8
0
 def on_selection_modified(self, view):
     if is_haskell_source(view) and view.file_name() and file_types.has(
             view.file_name()) and file_types.shown(view.file_name()):
         view.run_command('sublime_haskell_show_all_types',
                          {'filename': view.file_name()})
Example #9
0
 def is_enabled(self):
     return is_haskell_source(
         self.view) and self.view.file_name() is not None
Example #10
0
 def is_enabled(self):
     return is_haskell_source(self.view) and self.view.file_name(
     ) is not None and file_types.has(
         self.view.file_name()) and file_types.shown(self.view.file_name())
Example #11
0
 def is_enabled(self):
     return is_haskell_source(None)
Example #12
0
 def is_enabled(self):
     return is_haskell_source(None)