Skip to content

Commit

Permalink
moved to having only relative includes
Browse files Browse the repository at this point in the history
  • Loading branch information
niosus committed May 10, 2016
1 parent df3e956 commit 689cf3b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
13 changes: 5 additions & 8 deletions EasyClangComplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@
import sublime_plugin
import os
import imp
import sys
import logging
import os.path as path

from threading import Thread

sys.path.append(path.dirname(__file__))

from plugin import tools
from plugin import error_vis
from plugin import plugin_settings
from plugin.completion import lib_complete
from plugin.completion import bin_complete
from .plugin import tools
from .plugin import error_vis
from .plugin import plugin_settings
from .plugin.completion import lib_complete
from .plugin.completion import bin_complete

# reload the modules
imp.reload(tools)
Expand Down
4 changes: 2 additions & 2 deletions plugin/completion/base_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from os import path
from os import listdir

from plugin.error_vis import CompileErrors
from .. import error_vis

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -67,7 +67,7 @@ def __init__(self, clang_binary):
self.version_str, info)
log.info(" Found clang version: %s", self.version_str)
# initialize error visuzlization
self.error_vis = CompileErrors()
self.error_vis = error_vis.CompileErrors()

def remove(self, view_id):
"""called when completion for this view is not needed anymore.
Expand Down
6 changes: 3 additions & 3 deletions plugin/completion/bin_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

from os import path

from plugin.error_vis import FORMAT_BINARY
from plugin.completion.base_complete import BaseCompleter
from .. import error_vis
from .base_complete import BaseCompleter

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -200,7 +200,7 @@ def complete(self, view, cursor_pos, show_errors):
log.info(" clang process output: \n%s", output_text)
if show_errors:
self.error_vis.generate(view, output_text.splitlines(),
FORMAT_BINARY)
error_vis.FORMAT_BINARY)
self.error_vis.show_regions(view)
# we could stop here, but we continue as sometimes there are still
# valid completions even though there were errors encountered
Expand Down
26 changes: 13 additions & 13 deletions plugin/completion/lib_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@

from os import path

from plugin.error_vis import FORMAT_LIBCLANG
from plugin.tools import PKG_NAME
from plugin.completion.base_complete import BaseCompleter
from .. import error_vis
from .. import tools
from .base_complete import BaseCompleter

log = logging.getLogger(__name__)

cindex_dict = {
'3.2': PKG_NAME + ".clang.cindex32",
'3.3': PKG_NAME + ".clang.cindex33",
'3.4': PKG_NAME + ".clang.cindex34",
'3.5': PKG_NAME + ".clang.cindex35",
'3.6': PKG_NAME + ".clang.cindex36",
'3.7': PKG_NAME + ".clang.cindex37",
'3.8': PKG_NAME + ".clang.cindex38",
'3.2': tools.PKG_NAME + ".clang.cindex32",
'3.3': tools.PKG_NAME + ".clang.cindex33",
'3.4': tools.PKG_NAME + ".clang.cindex34",
'3.5': tools.PKG_NAME + ".clang.cindex35",
'3.6': tools.PKG_NAME + ".clang.cindex36",
'3.7': tools.PKG_NAME + ".clang.cindex37",
'3.8': tools.PKG_NAME + ".clang.cindex38",
}


Expand Down Expand Up @@ -149,7 +149,7 @@ def init(self, view, includes, settings, project_folder):
if settings.errors_on_save:
self.error_vis.generate(
view, self.translation_units[view.id()].diagnostics,
FORMAT_LIBCLANG)
error_vis.FORMAT_LIBCLANG)
self.error_vis.show_regions(view)

def complete(self, view, cursor_pos, show_errors):
Expand Down Expand Up @@ -196,7 +196,7 @@ def complete(self, view, cursor_pos, show_errors):
if show_errors:
self.error_vis.generate(
view, self.translation_units[view.id()].diagnostics,
FORMAT_LIBCLANG)
error_vis.FORMAT_LIBCLANG)
self.error_vis.show_regions(view)

def update(self, view, show_errors):
Expand All @@ -220,7 +220,7 @@ def update(self, view, show_errors):
if show_errors:
self.error_vis.generate(
view, self.translation_units[view.id()].diagnostics,
FORMAT_LIBCLANG)
error_vis.FORMAT_LIBCLANG)
self.error_vis.show_regions(view)
return True
log.error(" no translation unit for view id %s")
Expand Down

0 comments on commit 689cf3b

Please sign in to comment.