Refactoring out some pointless sys.path changes
This commit is contained in:
parent
468e245bcb
commit
4978546e62
@ -18,7 +18,7 @@
|
|||||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import ycm_core
|
import ycm_core
|
||||||
from clang_completer import ClangCompleter
|
from completers.cpp.clang_completer import ClangCompleter
|
||||||
|
|
||||||
def GetCompleter():
|
def GetCompleter():
|
||||||
if ycm_core.HasClangSupport():
|
if ycm_core.HasClangSupport():
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
|
|
||||||
from completers.completer import Completer
|
from completers.completer import Completer
|
||||||
from completers.all.identifier_completer import IdentifierCompleter
|
from completers.all.identifier_completer import IdentifierCompleter
|
||||||
from filename_completer import FilenameCompleter
|
from completers.general.filename_completer import FilenameCompleter
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from ultisnips_completer import UltiSnipsCompleter
|
from completers.general.ultisnips_completer import UltiSnipsCompleter
|
||||||
USE_ULTISNIPS_COMPLETER = True
|
USE_ULTISNIPS_COMPLETER = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
USE_ULTISNIPS_COMPLETER = False
|
USE_ULTISNIPS_COMPLETER = False
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from jedi_completer import JediCompleter
|
from completers.python.jedi_completer import JediCompleter
|
||||||
|
|
||||||
def GetCompleter():
|
def GetCompleter():
|
||||||
return JediCompleter()
|
return JediCompleter()
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
import imp
|
import imp
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import vimsupport
|
import vimsupport
|
||||||
import vim
|
import vim
|
||||||
import ycm_utils as utils
|
import ycm_utils as utils
|
||||||
@ -85,11 +84,7 @@ class YouCompleteMe( object ):
|
|||||||
completer = None
|
completer = None
|
||||||
supported_filetypes = [ filetype ]
|
supported_filetypes = [ filetype ]
|
||||||
if os.path.exists( module_path ):
|
if os.path.exists( module_path ):
|
||||||
|
|
||||||
sys.path.insert( 0, os.path.dirname( module_path ) )
|
|
||||||
module = imp.load_source( filetype, module_path )
|
module = imp.load_source( filetype, module_path )
|
||||||
del sys.path[ 0 ]
|
|
||||||
|
|
||||||
completer = module.GetCompleter()
|
completer = module.GetCompleter()
|
||||||
if completer:
|
if completer:
|
||||||
supported_filetypes.extend( completer.SupportedFiletypes() )
|
supported_filetypes.extend( completer.SupportedFiletypes() )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user