Moving everything under pytho/ycm

This commit is contained in:
Strahinja Val Markovic 2013-05-19 19:44:42 -07:00
parent acb9099bb9
commit faa225fdc4
31 changed files with 70 additions and 36 deletions

View File

@ -40,7 +40,7 @@ function! youcompleteme#Enable()
py import sys py import sys
py import vim py import vim
exe 'python sys.path.insert( 0, "' . s:script_folder_path . '/../python" )' exe 'python sys.path.insert( 0, "' . s:script_folder_path . '/../python" )'
py import extra_conf_store py from ycm import extra_conf_store
py extra_conf_store.CallExtraConfYcmCorePreloadIfExists() py extra_conf_store.CallExtraConfYcmCorePreloadIfExists()
py import ycm py import ycm

33
python/ycm/__init__.py Normal file
View File

@ -0,0 +1,33 @@
#!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Strahinja Val Markovic <val@markovic.io>
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# YouCompleteMe is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
from youcompleteme import (
YouCompleteMe, CompatibleWithYcmCore, CurrentIdentifierFinished,
CompletionStartColumn )
# We don't really need to do this, but if we don't, pyflakes complains that we
# have unused imports. Pyflakes should ignore unused imports in __init__.py
# files, but doesn't. See this bug report:
# https://bugs.launchpad.net/pyflakes/+bug/1178905
__all__ = [
YouCompleteMe.__name__,
CompatibleWithYcmCore.__name__,
CurrentIdentifierFinished.__name__,
CompletionStartColumn.__name__
]

View File

@ -17,11 +17,11 @@
# 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 completers.general_completer import GeneralCompleter
import vim import vim
import vimsupport
import ycm_core import ycm_core
import ycm_utils as utils from ycm.completers.general_completer import GeneralCompleter
from ycm import vimsupport
from ycm import utils
MAX_IDENTIFIER_COMPLETIONS_RETURNED = 10 MAX_IDENTIFIER_COMPLETIONS_RETURNED = 10
MIN_NUM_CHARS = int( vimsupport.GetVariableValue( MIN_NUM_CHARS = int( vimsupport.GetVariableValue(

View File

@ -18,8 +18,8 @@
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>. # along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
import vim import vim
import vimsupport from ycm import vimsupport
from completers.completer import Completer from ycm.completers.completer import Completer
OMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!' OMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!'
OMNIFUNC_NOT_LIST = ( 'Omnifunc did not return a list or a dict with a "words" ' OMNIFUNC_NOT_LIST = ( 'Omnifunc did not return a list or a dict with a "words" '

View File

@ -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 completers.cpp.clang_completer import ClangCompleter from ycm.completers.cpp.clang_completer import ClangCompleter
def GetCompleter(): def GetCompleter():
if ycm_core.HasClangSupport(): if ycm_core.HasClangSupport():

View File

@ -19,8 +19,8 @@
import abc import abc
import vim import vim
import vimsupport
import ycm_core import ycm_core
from ycm import vimsupport
from collections import defaultdict from collections import defaultdict
NO_USER_COMMANDS = 'This completer does not define any commands.' NO_USER_COMMANDS = 'This completer does not define any commands.'

View File

@ -17,13 +17,13 @@
# 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 completers.completer import Completer
from collections import defaultdict from collections import defaultdict
import vim import vim
import vimsupport
import ycm_core import ycm_core
import extra_conf_store from ycm import vimsupport
from flags import Flags from ycm import extra_conf_store
from ycm.completers.completer import Completer
from ycm.completers.cpp.flags import Flags
CLANG_FILETYPES = set( [ 'c', 'cpp', 'objc', 'objcpp' ] ) CLANG_FILETYPES = set( [ 'c', 'cpp', 'objc', 'objcpp' ] )
MAX_DIAGNOSTICS_TO_DISPLAY = int( vimsupport.GetVariableValue( MAX_DIAGNOSTICS_TO_DISPLAY = int( vimsupport.GetVariableValue(

View File

@ -19,8 +19,8 @@
import ycm_core import ycm_core
import os import os
import vimsupport from ycm import vimsupport
import extra_conf_store from ycm import extra_conf_store
NO_EXTRA_CONF_FILENAME_MESSAGE = ('No {0} file detected, so no compile flags ' NO_EXTRA_CONF_FILENAME_MESSAGE = ('No {0} file detected, so no compile flags '
'are available. Thus no semantic support for C/C++/ObjC/ObjC++. See the ' 'are available. Thus no semantic support for C/C++/ObjC/ObjC++. See the '

View File

@ -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 completers.cpp.clang_completer import ClangCompleter from ycm.completers.cpp.clang_completer import ClangCompleter
def GetCompleter(): def GetCompleter():
if ycm_core.HasClangSupport(): if ycm_core.HasClangSupport():

View File

@ -16,14 +16,15 @@
# 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 completers.threaded_completer import ThreadedCompleter
from completers.cpp.clang_completer import InCFamilyFile
from completers.cpp.flags import Flags
import vim import vim
import vimsupport
import os import os
import re import re
from ycm import vimsupport
from ycm.completers.threaded_completer import ThreadedCompleter
from ycm.completers.cpp.clang_completer import InCFamilyFile
from ycm.completers.cpp.flags import Flags
USE_WORKING_DIR = vimsupport.GetBoolValue( USE_WORKING_DIR = vimsupport.GetBoolValue(
'g:ycm_filepath_completion_use_working_dir' ) 'g:ycm_filepath_completion_use_working_dir' )

View File

@ -18,12 +18,12 @@
# 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 completers.completer import Completer from ycm.completers.completer import Completer
from completers.all.identifier_completer import IdentifierCompleter from ycm.completers.all.identifier_completer import IdentifierCompleter
from completers.general.filename_completer import FilenameCompleter from ycm.completers.general.filename_completer import FilenameCompleter
try: try:
from completers.general.ultisnips_completer import UltiSnipsCompleter from ycm.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

View File

@ -18,7 +18,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 completers.general_completer import GeneralCompleter from ycm.completers.general_completer import GeneralCompleter
from UltiSnips import UltiSnips_Manager from UltiSnips import UltiSnips_Manager

View File

@ -17,7 +17,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 completer import Completer from ycm.completers.completer import Completer
class GeneralCompleter( Completer ): class GeneralCompleter( Completer ):
""" """

View File

@ -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 completers.cpp.clang_completer import ClangCompleter from ycm.completers.cpp.clang_completer import ClangCompleter
def GetCompleter(): def GetCompleter():
if ycm_core.HasClangSupport(): if ycm_core.HasClangSupport():

View File

@ -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 completers.cpp.clang_completer import ClangCompleter from ycm.completers.cpp.clang_completer import ClangCompleter
def GetCompleter(): def GetCompleter():
if ycm_core.HasClangSupport(): if ycm_core.HasClangSupport():

View File

@ -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 completers.python.jedi_completer import JediCompleter from ycm.completers.python.jedi_completer import JediCompleter
def GetCompleter(): def GetCompleter():
return JediCompleter() return JediCompleter()

View File

@ -20,8 +20,8 @@
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>. # along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
import vim import vim
from completers.threaded_completer import ThreadedCompleter from ycm.completers.threaded_completer import ThreadedCompleter
import vimsupport from ycm import vimsupport
import sys import sys
from os.path import join, abspath, dirname from os.path import join, abspath, dirname

View File

@ -19,7 +19,7 @@
import abc import abc
from threading import Thread, Event from threading import Thread, Event
from completer import Completer from ycm.completers.completer import Completer
class ThreadedCompleter( Completer ): class ThreadedCompleter( Completer ):
def __init__( self ): def __init__( self ):

View File

@ -24,8 +24,8 @@ import imp
import random import random
import string import string
import sys import sys
import vimsupport
import vim import vim
from ycm import vimsupport
from fnmatch import fnmatch from fnmatch import fnmatch
# Constants # Constants

View File

@ -19,9 +19,9 @@
import imp import imp
import os import os
import vimsupport
import vim import vim
import ycm_utils as utils from ycm import vimsupport
from ycm import utils
try: try:
import ycm_core import ycm_core
@ -33,8 +33,8 @@ except ImportError as e:
os.path.dirname( os.path.abspath( __file__ ) ), str( e ) ) ) os.path.dirname( os.path.abspath( __file__ ) ), str( e ) ) )
from completers.all.omni_completer import OmniCompleter from ycm.completers.all.omni_completer import OmniCompleter
from completers.general.general_completer_store import GeneralCompleterStore from ycm.completers.general.general_completer_store import GeneralCompleterStore
FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE = vim.eval( FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE = vim.eval(
'g:ycm_filetype_specific_completion_to_disable' ) 'g:ycm_filetype_specific_completion_to_disable' )