Updating code to work with new ycmd location
This commit is contained in:
parent
abfba7a1aa
commit
a69bbb3009
@ -49,12 +49,13 @@ function! youcompleteme#Enable()
|
||||
py import sys
|
||||
py import vim
|
||||
exe 'python sys.path.insert( 0, "' . s:script_folder_path . '/../python" )'
|
||||
py from ycm import utils
|
||||
exe 'python sys.path.insert( 0, "' . s:script_folder_path .
|
||||
\ '/../third_party/ycmd" )'
|
||||
py from ycmd import utils
|
||||
py utils.AddThirdPartyFoldersToSysPath()
|
||||
py from ycm import base
|
||||
py base.LoadJsonDefaultsIntoVim()
|
||||
py from ycm import vimsupport
|
||||
py from ycm import user_options_store
|
||||
py from ycmd import user_options_store
|
||||
py user_options_store.SetAll( base.BuildServerConf() )
|
||||
|
||||
if !pyeval( 'base.CompatibleWithYcmCore()')
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
import vim
|
||||
from ycm import vimsupport
|
||||
from ycm import utils
|
||||
from ycm import user_options_store
|
||||
from ycmd import utils
|
||||
from ycmd import user_options_store
|
||||
import ycm_client_support
|
||||
|
||||
YCM_VAR_PREFIX = 'ycm_'
|
||||
|
@ -25,9 +25,9 @@ from retries import retries
|
||||
from requests_futures.sessions import FuturesSession
|
||||
from ycm.unsafe_thread_pool_executor import UnsafeThreadPoolExecutor
|
||||
from ycm import vimsupport
|
||||
from ycm import utils
|
||||
from ycm.utils import ToUtf8Json
|
||||
from ycm.server.responses import ServerError, UnknownExtraConf
|
||||
from ycmd import utils
|
||||
from ycmd.utils import ToUtf8Json
|
||||
from ycmd.responses import ServerError, UnknownExtraConf
|
||||
|
||||
_HEADERS = {'content-type': 'application/json'}
|
||||
_EXECUTOR = UnsafeThreadPoolExecutor( max_workers = 30 )
|
||||
|
@ -20,7 +20,7 @@
|
||||
import vim
|
||||
from ycm.client.base_request import BaseRequest, BuildRequestData, ServerError
|
||||
from ycm import vimsupport
|
||||
from ycm.utils import ToUtf8IfNeeded
|
||||
from ycmd.utils import ToUtf8IfNeeded
|
||||
|
||||
def _EnsureBackwardsCompatibility( arguments ):
|
||||
if arguments and arguments[ 0 ] == 'GoToDefinitionElseDeclaration':
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
from ycm import base
|
||||
from ycm import vimsupport
|
||||
from ycm.utils import ToUtf8IfNeeded
|
||||
from ycmd.utils import ToUtf8IfNeeded
|
||||
from ycm.client.base_request import ( BaseRequest, BuildRequestData,
|
||||
JsonFromFuture )
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ycm import vimsupport
|
||||
from ycm.server.responses import UnknownExtraConf
|
||||
from ycmd.responses import UnknownExtraConf
|
||||
from ycm.client.base_request import ( BaseRequest, BuildRequestData,
|
||||
JsonFromFuture )
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
import vim
|
||||
from ycm import vimsupport
|
||||
from ycm import base
|
||||
from ycm.completers.completer import Completer
|
||||
from ycmd.completers.completer import Completer
|
||||
from ycm.client.base_request import BuildRequestData
|
||||
|
||||
OMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!'
|
@ -21,7 +21,7 @@ import os
|
||||
from nose.tools import eq_
|
||||
from ycm.test_utils import MockVimModule
|
||||
vim_mock = MockVimModule()
|
||||
from ycm.completers.general import syntax_parse
|
||||
from ycm import syntax_parse
|
||||
|
||||
|
||||
def ContentsOfTestFile( test_file ):
|
@ -20,8 +20,8 @@
|
||||
import vim
|
||||
import os
|
||||
import json
|
||||
from ycm.utils import ToUtf8IfNeeded
|
||||
from ycm import user_options_store
|
||||
from ycmd.utils import ToUtf8IfNeeded
|
||||
from ycmd import user_options_store
|
||||
|
||||
BUFFER_COMMAND_MAP = { 'same-buffer' : 'edit',
|
||||
'horizontal-split' : 'split',
|
||||
|
@ -25,11 +25,11 @@ import signal
|
||||
import base64
|
||||
from subprocess import PIPE
|
||||
from ycm import vimsupport
|
||||
from ycm import utils
|
||||
from ycmd import utils
|
||||
from ycm.diagnostic_interface import DiagnosticInterface
|
||||
from ycm.completers.all.omni_completer import OmniCompleter
|
||||
from ycm.completers.general import syntax_parse
|
||||
from ycm.completers.completer_utils import FiletypeCompleterExistsForFiletype
|
||||
from ycm.omni_completer import OmniCompleter
|
||||
from ycm import syntax_parse
|
||||
from ycmd.completers.completer_utils import FiletypeCompleterExistsForFiletype
|
||||
from ycm.client.ycmd_keepalive import YcmdKeepalive
|
||||
from ycm.client.base_request import BaseRequest, BuildRequestData
|
||||
from ycm.client.command_request import SendCommandRequest
|
||||
@ -37,7 +37,7 @@ from ycm.client.completion_request import CompletionRequest
|
||||
from ycm.client.omni_completion_request import OmniCompletionRequest
|
||||
from ycm.client.event_notification import ( SendEventNotificationAsync,
|
||||
EventNotification )
|
||||
from ycm.server.responses import ServerError
|
||||
from ycmd.responses import ServerError
|
||||
|
||||
try:
|
||||
from UltiSnips import UltiSnips_Manager
|
||||
@ -363,7 +363,7 @@ class YouCompleteMe( object ):
|
||||
|
||||
def _PathToServerScript():
|
||||
dir_of_current_script = os.path.dirname( os.path.abspath( __file__ ) )
|
||||
return os.path.join( dir_of_current_script, 'server/ycmd.py' )
|
||||
return os.path.join( dir_of_current_script, '../../third_party/ycmd/ycmd' )
|
||||
|
||||
|
||||
def _AddUltiSnipsDataIfNeeded( extra_data ):
|
||||
|
@ -28,11 +28,11 @@ import waitress
|
||||
import signal
|
||||
import os
|
||||
import base64
|
||||
from ycm import user_options_store
|
||||
from ycm import extra_conf_store
|
||||
from ycm import utils
|
||||
from ycm.server.watchdog_plugin import WatchdogPlugin
|
||||
from ycm.server.hmac_plugin import HmacPlugin
|
||||
from ycmd import user_options_store
|
||||
from ycmd import extra_conf_store
|
||||
from ycmd import utils
|
||||
from ycmd.watchdog_plugin import WatchdogPlugin
|
||||
from ycmd.hmac_plugin import HmacPlugin
|
||||
|
||||
def YcmCoreSanityCheck():
|
||||
if 'ycm_core' in sys.modules:
|
||||
@ -126,7 +126,7 @@ def Main():
|
||||
# This can't be a top-level import because it transitively imports
|
||||
# ycm_core which we want to be imported ONLY after extra conf
|
||||
# preload has executed.
|
||||
from ycm.server import handlers
|
||||
from ycmd import handlers
|
||||
handlers.UpdateUserOptions( options )
|
||||
SetUpSignalHandler(args.stdout, args.stderr, args.keep_logfiles)
|
||||
handlers.app.install( WatchdogPlugin( args.idle_suicide_seconds ) )
|
@ -21,11 +21,10 @@ import os
|
||||
import logging
|
||||
import ycm_core
|
||||
from collections import defaultdict
|
||||
from ycm.completers.general_completer import GeneralCompleter
|
||||
# from ycm.completers.general import syntax_parse
|
||||
from ycm import utils
|
||||
from ycm.utils import ToUtf8IfNeeded
|
||||
from ycm.server import responses
|
||||
from ycmd.completers.general_completer import GeneralCompleter
|
||||
from ycmd import utils
|
||||
from ycmd.utils import ToUtf8IfNeeded
|
||||
from ycmd import responses
|
||||
|
||||
MAX_IDENTIFIER_COMPLETIONS_RETURNED = 10
|
||||
SYNTAX_FILENAME = 'YCM_PLACEHOLDER_FOR_SYNTAX'
|
||||
|
@ -18,7 +18,7 @@
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from nose.tools import eq_
|
||||
from ycm.completers.all import identifier_completer
|
||||
from ycmd.completers.all import identifier_completer
|
||||
|
||||
|
||||
def GetCursorIdentifier_StartOfLine_test():
|
||||
|
2
third_party/ycmd/ycmd/completers/c/hook.py
vendored
2
third_party/ycmd/ycmd/completers/c/hook.py
vendored
@ -18,7 +18,7 @@
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ycm_core
|
||||
from ycm.completers.cpp.clang_completer import ClangCompleter
|
||||
from ycmd.completers.cpp.clang_completer import ClangCompleter
|
||||
|
||||
def GetCompleter( user_options ):
|
||||
if ycm_core.HasClangSupport():
|
||||
|
@ -20,15 +20,15 @@
|
||||
import abc
|
||||
import threading
|
||||
from collections import defaultdict
|
||||
from ycm.utils import ToUtf8IfNeeded, ForceSemanticCompletion, RunningInsideVim
|
||||
from ycmd.utils import ToUtf8IfNeeded, ForceSemanticCompletion, RunningInsideVim
|
||||
|
||||
if RunningInsideVim():
|
||||
from ycm_client_support import FilterAndSortCandidates
|
||||
else:
|
||||
from ycm_core import FilterAndSortCandidates
|
||||
|
||||
from ycm.completers.completer_utils import TriggersForFiletype
|
||||
from ycm.server.responses import NoDiagnosticSupport
|
||||
from ycmd.completers.completer_utils import TriggersForFiletype
|
||||
from ycmd.responses import NoDiagnosticSupport
|
||||
|
||||
NO_USER_COMMANDS = 'This completer does not define any commands.'
|
||||
|
||||
@ -70,7 +70,7 @@ class Completer( object ):
|
||||
"foo.bar", the user query is "bar" and completions matching this string should
|
||||
be shown. It should return the list of candidates. The format of the result
|
||||
can be a list of strings or a more complicated list of dictionaries. Use
|
||||
ycm.server.responses.BuildCompletionData to build the detailed response. See
|
||||
ycmd.responses.BuildCompletionData to build the detailed response. See
|
||||
clang_completer.py to see how its used in practice.
|
||||
|
||||
Again, you probably want to override ComputeCandidatesInner().
|
||||
|
@ -19,9 +19,7 @@
|
||||
|
||||
from collections import defaultdict
|
||||
from nose.tools import eq_
|
||||
from ycm.test_utils import MockVimModule
|
||||
vim_mock = MockVimModule()
|
||||
from ycm.completers import completer_utils
|
||||
from ycmd.completers import completer_utils
|
||||
|
||||
|
||||
def FiletypeTriggerDictFromSpec_Works_test():
|
||||
|
@ -19,11 +19,11 @@
|
||||
|
||||
from collections import defaultdict
|
||||
import ycm_core
|
||||
from ycm.server import responses
|
||||
from ycm import extra_conf_store
|
||||
from ycm.utils import ToUtf8IfNeeded
|
||||
from ycm.completers.completer import Completer
|
||||
from ycm.completers.cpp.flags import Flags, PrepareFlagsForClang
|
||||
from ycmd import responses
|
||||
from ycmd import extra_conf_store
|
||||
from ycmd.utils import ToUtf8IfNeeded
|
||||
from ycmd.completers.completer import Completer
|
||||
from ycmd.completers.cpp.flags import Flags, PrepareFlagsForClang
|
||||
|
||||
CLANG_FILETYPES = set( [ 'c', 'cpp', 'objc', 'objcpp' ] )
|
||||
MIN_LINES_IN_FILE_TO_PARSE = 5
|
||||
|
@ -20,9 +20,9 @@
|
||||
import ycm_core
|
||||
import os
|
||||
import inspect
|
||||
from ycm import extra_conf_store
|
||||
from ycm.utils import ToUtf8IfNeeded
|
||||
from ycm.server.responses import NoExtraConfDetected
|
||||
from ycmd import extra_conf_store
|
||||
from ycmd.utils import ToUtf8IfNeeded
|
||||
from ycmd.responses import NoExtraConfDetected
|
||||
|
||||
INCLUDE_FLAGS = [ '-isystem', '-I', '-iquote', '--sysroot=', '-isysroot',
|
||||
'-include' ]
|
||||
|
2
third_party/ycmd/ycmd/completers/cpp/hook.py
vendored
2
third_party/ycmd/ycmd/completers/cpp/hook.py
vendored
@ -18,7 +18,7 @@
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ycm_core
|
||||
from ycm.completers.cpp.clang_completer import ClangCompleter
|
||||
from ycmd.completers.cpp.clang_completer import ClangCompleter
|
||||
|
||||
def GetCompleter( user_options ):
|
||||
if ycm_core.HasClangSupport():
|
||||
|
@ -21,9 +21,9 @@
|
||||
from collections import defaultdict
|
||||
import os
|
||||
import glob
|
||||
from ycm.completers.completer import Completer
|
||||
from ycm.server import responses
|
||||
from ycm import utils
|
||||
from ycmd.completers.completer import Completer
|
||||
from ycmd import responses
|
||||
from ycmd import utils
|
||||
import urllib2
|
||||
import urllib
|
||||
import urlparse
|
||||
@ -41,7 +41,7 @@ FILE_TOO_SHORT_MESSAGE = (
|
||||
NO_DIAGNOSTIC_MESSAGE = 'No diagnostic for current line!'
|
||||
PATH_TO_OMNISHARP_BINARY = os.path.join(
|
||||
os.path.abspath( os.path.dirname( __file__ ) ),
|
||||
'../../../../third_party/OmniSharpServer/OmniSharp/bin/Debug/OmniSharp.exe' )
|
||||
'../../../../OmniSharpServer/OmniSharp/bin/Debug/OmniSharp.exe' )
|
||||
|
||||
|
||||
#TODO: Handle this better than dummy classes
|
||||
|
2
third_party/ycmd/ycmd/completers/cs/hook.py
vendored
2
third_party/ycmd/ycmd/completers/cs/hook.py
vendored
@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ycm.completers.cs.cs_completer import CsharpCompleter
|
||||
from ycmd.completers.cs.cs_completer import CsharpCompleter
|
||||
|
||||
def GetCompleter( user_options ):
|
||||
return CsharpCompleter( user_options )
|
||||
|
@ -20,11 +20,11 @@ import os
|
||||
import re
|
||||
from collections import defaultdict
|
||||
|
||||
from ycm.completers.completer import Completer
|
||||
from ycm.completers.cpp.clang_completer import InCFamilyFile
|
||||
from ycm.completers.cpp.flags import Flags
|
||||
from ycm.utils import ToUtf8IfNeeded
|
||||
from ycm.server import responses
|
||||
from ycmd.completers.completer import Completer
|
||||
from ycmd.completers.cpp.clang_completer import InCFamilyFile
|
||||
from ycmd.completers.cpp.flags import Flags
|
||||
from ycmd.utils import ToUtf8IfNeeded
|
||||
from ycmd import responses
|
||||
|
||||
EXTRA_INFO_MAP = { 1 : '[File]', 2 : '[Dir]', 3 : '[File&Dir]' }
|
||||
|
||||
|
@ -18,10 +18,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ycm.completers.completer import Completer
|
||||
from ycm.completers.all.identifier_completer import IdentifierCompleter
|
||||
from ycm.completers.general.filename_completer import FilenameCompleter
|
||||
from ycm.completers.general.ultisnips_completer import UltiSnipsCompleter
|
||||
from ycmd.completers.completer import Completer
|
||||
from ycmd.completers.all.identifier_completer import IdentifierCompleter
|
||||
from ycmd.completers.general.filename_completer import FilenameCompleter
|
||||
from ycmd.completers.general.ultisnips_completer import UltiSnipsCompleter
|
||||
|
||||
|
||||
class GeneralCompleterStore( Completer ):
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
import os
|
||||
from nose.tools import eq_
|
||||
from ycm.completers.general.filename_completer import FilenameCompleter
|
||||
from ycm import user_options_store
|
||||
from ycmd.completers.general.filename_completer import FilenameCompleter
|
||||
from ycmd import user_options_store
|
||||
|
||||
test_dir = os.path.dirname( os.path.abspath( __file__ ) )
|
||||
data_dir = os.path.join( test_dir, "testdata", "filename_completer" )
|
||||
|
@ -18,8 +18,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ycm.completers.general_completer import GeneralCompleter
|
||||
from ycm.server import responses
|
||||
from ycmd.completers.general_completer import GeneralCompleter
|
||||
from ycmd import responses
|
||||
|
||||
|
||||
class UltiSnipsCompleter( GeneralCompleter ):
|
||||
|
@ -17,7 +17,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ycm.completers.completer import Completer
|
||||
from ycmd.completers.completer import Completer
|
||||
|
||||
class GeneralCompleter( Completer ):
|
||||
"""
|
||||
|
@ -18,7 +18,7 @@
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ycm_core
|
||||
from ycm.completers.cpp.clang_completer import ClangCompleter
|
||||
from ycmd.completers.cpp.clang_completer import ClangCompleter
|
||||
|
||||
def GetCompleter( user_options ):
|
||||
if ycm_core.HasClangSupport():
|
||||
|
@ -18,7 +18,7 @@
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ycm_core
|
||||
from ycm.completers.cpp.clang_completer import ClangCompleter
|
||||
from ycmd.completers.cpp.clang_completer import ClangCompleter
|
||||
|
||||
def GetCompleter( user_options ):
|
||||
if ycm_core.HasClangSupport():
|
||||
|
@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ycm.completers.python.jedi_completer import JediCompleter
|
||||
from ycmd.completers.python.jedi_completer import JediCompleter
|
||||
|
||||
def GetCompleter( user_options ):
|
||||
return JediCompleter( user_options )
|
||||
|
@ -19,8 +19,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ycm.completers.completer import Completer
|
||||
from ycm.server import responses
|
||||
from ycmd.completers.completer import Completer
|
||||
from ycmd import responses
|
||||
|
||||
try:
|
||||
import jedi
|
||||
|
4
third_party/ycmd/ycmd/extra_conf_store.py
vendored
4
third_party/ycmd/ycmd/extra_conf_store.py
vendored
@ -26,8 +26,8 @@ import string
|
||||
import sys
|
||||
import logging
|
||||
from threading import Lock
|
||||
from ycm import user_options_store
|
||||
from ycm.server.responses import UnknownExtraConf, YCM_EXTRA_CONF_FILENAME
|
||||
from ycmd import user_options_store
|
||||
from ycmd.responses import UnknownExtraConf, YCM_EXTRA_CONF_FILENAME
|
||||
from fnmatch import fnmatch
|
||||
|
||||
|
||||
|
10
third_party/ycmd/ycmd/handlers.py
vendored
10
third_party/ycmd/ycmd/handlers.py
vendored
@ -26,7 +26,7 @@ except ImportError as e:
|
||||
'Error importing ycm_core. Are you sure you have placed a '
|
||||
'version 3.2+ libclang.[so|dll|dylib] in folder "{0}"? '
|
||||
'See the Installation Guide in the docs. Full error: {1}'.format(
|
||||
path.realpath( path.join( path.abspath( __file__ ), '../../..' ) ),
|
||||
path.realpath( path.join( path.abspath( __file__ ), '../..' ) ),
|
||||
str( e ) ) )
|
||||
|
||||
import atexit
|
||||
@ -36,10 +36,10 @@ import bottle
|
||||
import httplib
|
||||
from bottle import request, response
|
||||
import server_state
|
||||
from ycm import user_options_store
|
||||
from ycm.server.responses import BuildExceptionResponse
|
||||
from ycm.server import hmac_plugin
|
||||
from ycm import extra_conf_store
|
||||
from ycmd import user_options_store
|
||||
from ycmd.responses import BuildExceptionResponse
|
||||
from ycmd import hmac_plugin
|
||||
from ycmd import extra_conf_store
|
||||
|
||||
|
||||
# num bytes for the request body buffer; request.json only works if the request
|
||||
|
2
third_party/ycmd/ycmd/hmac_plugin.py
vendored
2
third_party/ycmd/ycmd/hmac_plugin.py
vendored
@ -21,7 +21,7 @@ import logging
|
||||
import httplib
|
||||
from base64 import b64decode, b64encode
|
||||
from bottle import request, response, abort
|
||||
from ycm import utils
|
||||
from ycmd import utils
|
||||
|
||||
_HMAC_HEADER = 'x-ycm-hmac'
|
||||
|
||||
|
6
third_party/ycmd/ycmd/server_state.py
vendored
6
third_party/ycmd/ycmd/server_state.py
vendored
@ -19,9 +19,9 @@
|
||||
|
||||
import imp
|
||||
import os
|
||||
from ycm.utils import ForceSemanticCompletion
|
||||
from ycm.completers.general.general_completer_store import GeneralCompleterStore
|
||||
from ycm.completers.completer_utils import PathToFiletypeCompleterPluginLoader
|
||||
from ycmd.utils import ForceSemanticCompletion
|
||||
from ycmd.completers.general.general_completer_store import GeneralCompleterStore
|
||||
from ycmd.completers.completer_utils import PathToFiletypeCompleterPluginLoader
|
||||
|
||||
|
||||
class ServerState( object ):
|
||||
|
9
third_party/ycmd/ycmd/server_utils.py
vendored
9
third_party/ycmd/ycmd/server_utils.py
vendored
@ -21,14 +21,9 @@ import sys
|
||||
import os
|
||||
|
||||
def SetUpPythonPath():
|
||||
# We want to have the YouCompleteMe/python directory on the Python PATH
|
||||
# because all the code already assumes that it's there. This is a relic from
|
||||
# before the client/server architecture.
|
||||
# TODO: Fix things so that this is not needed anymore when we split ycmd into
|
||||
# a separate repository.
|
||||
sys.path.insert( 0, os.path.join(
|
||||
os.path.dirname( os.path.abspath( __file__ ) ),
|
||||
'../..' ) )
|
||||
'..' ) )
|
||||
|
||||
from ycm import utils
|
||||
from ycmd import utils
|
||||
utils.AddThirdPartyFoldersToSysPath()
|
||||
|
@ -18,9 +18,7 @@
|
||||
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from nose.tools import eq_
|
||||
from ycm.test_utils import MockVimModule
|
||||
vim_mock = MockVimModule()
|
||||
from ycm.extra_conf_store import _PathsToAllParentFolders
|
||||
from ycmd.extra_conf_store import _PathsToAllParentFolders
|
||||
|
||||
|
||||
def PathsToAllParentFolders_Basic_test():
|
||||
|
2
third_party/ycmd/ycmd/tests/test_utils.py
vendored
2
third_party/ycmd/ycmd/tests/test_utils.py
vendored
@ -20,7 +20,7 @@
|
||||
import os
|
||||
import time
|
||||
from .. import handlers
|
||||
from ycm import user_options_store
|
||||
from ycmd import user_options_store
|
||||
|
||||
def BuildRequest( **kwargs ):
|
||||
filepath = kwargs[ 'filepath' ] if 'filepath' in kwargs else '/foo'
|
||||
|
3
third_party/ycmd/ycmd/user_options_store.py
vendored
3
third_party/ycmd/ycmd/user_options_store.py
vendored
@ -42,8 +42,7 @@ def LoadDefaults():
|
||||
|
||||
def DefaultOptions():
|
||||
settings_path = os.path.join(
|
||||
os.path.dirname( os.path.abspath( __file__ ) ),
|
||||
'server/default_settings.json' )
|
||||
os.path.dirname( os.path.abspath( __file__ ) ), 'default_settings.json' )
|
||||
with open( settings_path ) as f:
|
||||
return json.loads( f.read() )
|
||||
|
||||
|
26
third_party/ycmd/ycmd/utils.py
vendored
26
third_party/ycmd/ycmd/utils.py
vendored
@ -191,15 +191,35 @@ def TerminateProcess( pid ):
|
||||
os.kill( pid, signal.SIGTERM )
|
||||
|
||||
|
||||
def AncestorFolders( path ):
|
||||
folder = os.path.abspath( path )
|
||||
while True:
|
||||
parent = os.path.dirname( folder )
|
||||
if parent == folder:
|
||||
break
|
||||
folder = parent
|
||||
yield folder
|
||||
|
||||
|
||||
def PathToNearestThirdPartyFolder( path ):
|
||||
for folder in AncestorFolders( path ):
|
||||
path_to_third_party = os.path.join( folder, 'third_party' )
|
||||
if os.path.isdir( path_to_third_party ):
|
||||
return path_to_third_party
|
||||
return None
|
||||
|
||||
|
||||
def AddThirdPartyFoldersToSysPath():
|
||||
path_to_third_party = os.path.join(
|
||||
os.path.dirname( os.path.abspath( __file__ ) ),
|
||||
'../../third_party' )
|
||||
path_to_third_party = PathToNearestThirdPartyFolder( __file__ )
|
||||
if not path_to_third_party:
|
||||
raise RuntimeError(
|
||||
'No third_party folder found for: {0}'.format( __file__) )
|
||||
|
||||
for folder in os.listdir( path_to_third_party ):
|
||||
sys.path.insert( 0, os.path.realpath( os.path.join( path_to_third_party,
|
||||
folder ) ) )
|
||||
|
||||
|
||||
def ForceSemanticCompletion( request_data ):
|
||||
return ( 'force_semantic' in request_data and
|
||||
bool( request_data[ 'force_semantic' ] ) )
|
||||
|
2
third_party/ycmd/ycmd/watchdog_plugin.py
vendored
2
third_party/ycmd/ycmd/watchdog_plugin.py
vendored
@ -20,7 +20,7 @@
|
||||
import time
|
||||
import os
|
||||
import copy
|
||||
from ycm import utils
|
||||
from ycmd import utils
|
||||
from threading import Thread, Lock
|
||||
|
||||
# This class implements the Bottle plugin API:
|
||||
|
Loading…
Reference in New Issue
Block a user