Commit ee7d73fd authored by Onur Aslan's avatar Onur Aslan

Imported Upstream version 0+20160327+git1b76af4

parent 8c750fc8
This diff is collapsed.
......@@ -2,15 +2,17 @@ version: '{build}'
environment:
matrix:
- arch: 32
python: 35
# We only test Python 2.7 on 64 bits.
- arch: 64
python: 27
- arch: 64
python: 35
install:
- git submodule update --init --recursive
- ps: $env:python = if ($env:arch -eq 32) { 'C:\Python27' } else { 'C:\Python27-x64' }
- appveyor DownloadFile https://bootstrap.pypa.io/get-pip.py
- set PATH=%python%;%python%\Scripts;%PATH%
- python get-pip.py
- pip install -r python\test_requirements.txt
- ci\appveyor\appveyor_install.bat
build_script:
- python run_tests.py
# Disable automatic tests
test: off
cache:
- '%LOCALAPPDATA%\pip\cache' # Python packages from pip
......@@ -30,6 +30,29 @@ let s:moved_vertically_in_insert_mode = 0
let s:previous_num_chars_on_current_line = strlen( getline('.') )
function! s:UsingPython2()
" I'm willing to bet quite a bit that sooner or later, somebody will ask us to
" make it configurable which version of Python we use.
if has('python')
return 1
endif
return 0
endfunction
let s:using_python2 = s:UsingPython2()
let s:python_until_eof = s:using_python2 ? "python << EOF" : "python3 << EOF"
let s:python_command = s:using_python2 ? "py " : "py3 "
function! s:Pyeval( eval_string )
if s:using_python2
return pyeval( a:eval_string )
endif
return py3eval( a:eval_string )
endfunction
function! youcompleteme#Enable()
" When vim is in diff mode, don't run
if &diff
......@@ -120,17 +143,22 @@ endfunction
function! youcompleteme#GetErrorCount()
return pyeval( 'ycm_state.GetErrorCount()' )
return s:Pyeval( 'ycm_state.GetErrorCount()' )
endfunction
function! youcompleteme#GetWarningCount()
return pyeval( 'ycm_state.GetWarningCount()' )
return s:Pyeval( 'ycm_state.GetWarningCount()' )
endfunction
function! s:SetUpPython() abort
python << EOF
exec s:python_until_eof
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
import sys
import traceback
......@@ -340,7 +368,7 @@ function! s:SetUpCpoptions()
" This prevents the display of "Pattern not found" & similar messages during
" completion. This is only available since Vim 7.4.314
if pyeval( 'vimsupport.VimVersionAtLeast("7.4.314")' )
if s:Pyeval( 'vimsupport.VimVersionAtLeast("7.4.314")' )
set shortmess+=c
endif
endfunction
......@@ -383,12 +411,12 @@ endfunction
function! s:OnVimLeave()
py ycm_state.OnVimLeave()
exec s:python_command "ycm_state.OnVimLeave()"
endfunction
function! s:OnCompleteDone()
py ycm_state.OnCompleteDone()
exec s:python_command "ycm_state.OnCompleteDone()"
endfunction
......@@ -421,7 +449,7 @@ function! s:OnBufferVisit()
call s:SetOmnicompleteFunc()
endif
py ycm_state.OnBufferVisit()
exec s:python_command "ycm_state.OnBufferVisit()"
call s:OnFileReadyToParse()
endfunction
......@@ -431,7 +459,8 @@ function! s:OnBufferUnload( deleted_buffer_file )
return
endif
py ycm_state.OnBufferUnload( vim.eval( 'a:deleted_buffer_file' ) )
exec s:python_command "ycm_state.OnBufferUnload("
\ "vim.eval( 'a:deleted_buffer_file' ) )"
endfunction
......@@ -454,11 +483,11 @@ function! s:OnFileReadyToParse()
" reparsing the file again. If we sent the new parse request first, then
" the response would always be pending when we called
" HandleFileParseRequest.
py ycm_state.HandleFileParseRequest()
exec s:python_command "ycm_state.HandleFileParseRequest()"
let buffer_changed = b:changedtick != b:ycm_changedtick.file_ready_to_parse
if buffer_changed
py ycm_state.OnFileReadyToParse()
exec s:python_command "ycm_state.OnFileReadyToParse()"
endif
let b:ycm_changedtick.file_ready_to_parse = b:changedtick
endfunction
......@@ -471,7 +500,7 @@ endfunction
function! s:SetOmnicompleteFunc()
if pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
if s:Pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
let &omnifunc = 'youcompleteme#OmniComplete'
let &l:omnifunc = 'youcompleteme#OmniComplete'
......@@ -489,7 +518,7 @@ function! s:OnCursorMovedInsertMode()
return
endif
py ycm_state.OnCursorMoved()
exec s:python_command "ycm_state.OnCursorMoved()"
call s:UpdateCursorMoved()
" Basically, we need to only trigger the completion menu when the user has
......@@ -515,7 +544,7 @@ function! s:OnCursorMovedInsertMode()
" We have to make sure we correctly leave omnifunc mode even when the user
" inserts something like a "operator[]" candidate string which fails
" CurrentIdentifierFinished check.
if s:omnifunc_mode && !pyeval( 'base.LastEnteredCharIsIdentifierChar()')
if s:omnifunc_mode && !s:Pyeval( 'base.LastEnteredCharIsIdentifierChar()')
let s:omnifunc_mode = 0
endif
endfunction
......@@ -527,7 +556,7 @@ function! s:OnCursorMovedNormalMode()
endif
call s:OnFileReadyToParse()
py ycm_state.OnCursorMoved()
exec s:python_command "ycm_state.OnCursorMoved()"
endfunction
......@@ -538,7 +567,7 @@ function! s:OnInsertLeave()
let s:omnifunc_mode = 0
call s:OnFileReadyToParse()
py ycm_state.OnInsertLeave()
exec s:python_command "ycm_state.OnInsertLeave()"
if g:ycm_autoclose_preview_window_after_completion ||
\ g:ycm_autoclose_preview_window_after_insertion
call s:ClosePreviewWindowIfNeeded()
......@@ -601,10 +630,10 @@ endfunction
function! s:IdentifierFinishedOperations()
if !pyeval( 'base.CurrentIdentifierFinished()' )
if !s:Pyeval( 'base.CurrentIdentifierFinished()' )
return
endif
py ycm_state.OnCurrentIdentifierFinished()
exec s:python_command "ycm_state.OnCurrentIdentifierFinished()"
let s:omnifunc_mode = 0
endfunction
......@@ -613,7 +642,8 @@ endfunction
function! s:InsideCommentOrString()
" Has to be col('.') -1 because col('.') doesn't exist at this point. We are
" in insert mode when this func is called.
let syntax_group = synIDattr( synIDtrans( synID( line( '.' ), col( '.' ) - 1, 1 ) ), 'name')
let syntax_group = synIDattr(
\ synIDtrans( synID( line( '.' ), col( '.' ) - 1, 1 ) ), 'name')
if stridx(syntax_group, 'Comment') > -1
return 1
......@@ -642,7 +672,7 @@ endfunction
function! s:OnBlankLine()
return pyeval( 'not vim.current.line or vim.current.line.isspace()' )
return s:Pyeval( 'not vim.current.line or vim.current.line.isspace()' )
endfunction
......@@ -678,7 +708,7 @@ function! s:InvokeCompletion()
endfunction
python << EOF
exec s:python_until_eof
def GetCompletionsInner():
request = ycm_state.GetCurrentCompletionRequest()
request.Start()
......@@ -692,8 +722,8 @@ EOF
function! s:GetCompletions()
py results = GetCompletionsInner()
let results = pyeval( 'results' )
exec s:python_command "results = GetCompletionsInner()"
let results = s:Pyeval( 'results' )
return results
endfunction
......@@ -718,11 +748,11 @@ function! youcompleteme#Complete( findstart, base )
return -2
endif
if !pyeval( 'ycm_state.IsServerAlive()' )
if !s:Pyeval( 'ycm_state.IsServerAlive()' )
return -2
endif
py ycm_state.CreateCompletionRequest()
return pyeval( 'base.CompletionStartColumn()' )
exec s:python_command "ycm_state.CreateCompletionRequest()"
return s:Pyeval( 'base.CompletionStartColumn()' )
else
return s:GetCompletions()
endif
......@@ -731,12 +761,13 @@ endfunction
function! youcompleteme#OmniComplete( findstart, base )
if a:findstart
if !pyeval( 'ycm_state.IsServerAlive()' )
if !s:Pyeval( 'ycm_state.IsServerAlive()' )
return -2
endif
let s:omnifunc_mode = 1
py ycm_state.CreateCompletionRequest( force_semantic = True )
return pyeval( 'base.CompletionStartColumn()' )
exec s:python_command "ycm_state.CreateCompletionRequest("
\ "force_semantic = True )"
return s:Pyeval( 'base.CompletionStartColumn()' )
else
return s:GetCompletions()
endif
......@@ -744,23 +775,23 @@ endfunction
function! youcompleteme#ServerPid()
return pyeval( 'ycm_state.ServerPid()' )
return s:Pyeval( 'ycm_state.ServerPid()' )
endfunction
function! s:RestartServer()
py ycm_state.RestartServer()
exec s:python_command "ycm_state.RestartServer()"
endfunction
function! s:ShowDetailedDiagnostic()
py ycm_state.ShowDetailedDiagnostic()
exec s:python_command "ycm_state.ShowDetailedDiagnostic()"
endfunction
function! s:DebugInfo()
echom "Printing YouCompleteMe debug information..."
let debug_info = pyeval( 'ycm_state.DebugInfo()' )
let debug_info = s:Pyeval( 'ycm_state.DebugInfo()' )
for line in split( debug_info, "\n" )
echom '-- ' . line
endfor
......@@ -770,8 +801,9 @@ endfunction
function! s:ToggleLogs(...)
let stderr = a:0 == 0 || a:1 !=? 'stdout'
let stdout = a:0 == 0 || a:1 !=? 'stderr'
py ycm_state.ToggleLogs( stdout = vimsupport.GetBoolValue( 'l:stdout' ),
\ stderr = vimsupport.GetBoolValue( 'l:stderr' ) )
exec s:python_command "ycm_state.ToggleLogs("
\ "stdout = vimsupport.GetBoolValue( 'l:stdout' ),"
\ "stderr = vimsupport.GetBoolValue( 'l:stderr' ) )"
endfunction
......@@ -793,8 +825,8 @@ function! s:CompleterCommand(...)
let arguments = arguments[1:]
endif
py ycm_state.SendCommandRequest( vim.eval( 'l:arguments' ),
\ vim.eval( 'l:completer' ) )
exec s:python_command "ycm_state.SendCommandRequest("
\ "vim.eval( 'l:arguments' ), vim.eval( 'l:completer' ) ) "
endfunction
......@@ -814,21 +846,21 @@ endfunction
function! youcompleteme#SubCommandsComplete( arglead, cmdline, cursorpos )
return join( pyeval( 'ycm_state.GetDefinedSubcommands()' ),
return join( s:Pyeval( 'ycm_state.GetDefinedSubcommands()' ),
\ "\n")
endfunction
function! s:ForceCompile()
if !pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
if !s:Pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
echom "Native filetype completion not supported for current file, "
\ . "cannot force recompilation."
return 0
endif
echom "Forcing compilation, this will block Vim until done."
py ycm_state.OnFileReadyToParse()
py ycm_state.HandleFileParseRequest( True )
exec s:python_command "ycm_state.OnFileReadyToParse()"
exec s:python_command "ycm_state.HandleFileParseRequest( True )"
return 1
endfunction
......@@ -849,7 +881,7 @@ function! s:ShowDiagnostics()
return
endif
if pyeval( 'ycm_state.PopulateLocationListWithLatestDiagnostics()' )
if s:Pyeval( 'ycm_state.PopulateLocationListWithLatestDiagnostics()' )
if g:ycm_open_loclist_on_ycm_diags
lopen
endif
......
git submodule update --init --recursive
:: Batch script will not exit if a command returns an error, so we manually do
:: it for commands that may fail.
if %errorlevel% neq 0 exit /b %errorlevel%
::
:: Python configuration
::
if %arch% == 32 (
set python_path=C:\Python%python%
) else (
set python_path=C:\Python%python%-x64
)
set PATH=%python_path%;%python_path%\Scripts;%PATH%
python --version
:: When using Python 3 on AppVeyor, CMake will always pick the 64 bit
:: libraries. We specifically tell CMake the right path to the libraries
:: according to the architecture.
if %python% == 35 (
set EXTRA_CMAKE_ARGS="-DPYTHON_LIBRARY=%python_path%\libs\python%python%.lib"
)
appveyor DownloadFile https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install -r python\test_requirements.txt
if %errorlevel% neq 0 exit /b %errorlevel%
# OS X-specific installation
# There's a homebrew bug which causes brew update to fail the first time. Run
# it twice to workaround. https://github.com/Homebrew/homebrew/issues/42553
brew update || brew update
# List of homebrew formulae to install in the order they appear.
# These are dependencies of pyenv.
REQUIREMENTS="ninja
readline
autoconf
pkg-config
openssl"
# Install pyenv and dependencies
for pkg in $REQUIREMENTS; do
# Install package, or upgrade it if it is already installed
brew install $pkg || brew outdated $pkg || brew upgrade $pkg
done
# In order to work with ycmd, python *must* be built as a shared library. The
# most compatible way to do this on OS X is with --enable-framework. This is
# set via the PYTHON_CONFIGURE_OPTS option
export PYTHON_CONFIGURE_OPTS="--enable-framework"
......@@ -2,30 +2,54 @@
set -ev
YCMD_VENV_DIR=${HOME}/venvs/ycmd_test
####################
# OS-specific setup
####################
# Requirements of OS-specific install:
# - install any software which is not installed by Travis configuration
# - create (but don't activate) a virtualenv for the python version
# ${YCMD_PYTHON_VERSION} in the directory ${YCMD_VENV_DIR}, e.g.
# virtualenv -p python${YCMD_PYTHON_VERSION} ${YCMD_VENV_DIR}
source travis/travis_install.${TRAVIS_OS_NAME}.sh
# virtualenv doesn't copy python-config https://github.com/pypa/virtualenv/issues/169
# but our build system uses it
cp /usr/bin/python${YCMD_PYTHON_VERSION}-config ${YCMD_VENV_DIR}/bin/python-config
# virtualenv script is noisy, so don't print every command
set +v
source ${YCMD_VENV_DIR}/bin/activate
set -v
# - set up everything necessary so that pyenv can build python
source ci/travis/travis_install.${TRAVIS_OS_NAME}.sh
#############
# pyenv setup
#############
# DON'T exit if error
set +e
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git fetch --tags
git checkout v20160202
# Exit if error
set -e
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
if [ "${YCM_PYTHON_VERSION}" == "2.6" ]; then
PYENV_VERSION="2.6.6"
elif [ "${YCM_PYTHON_VERSION}" == "2.7" ]; then
PYENV_VERSION="2.7.6"
else
PYENV_VERSION="3.3.6"
fi
pyenv install --skip-existing ${PYENV_VERSION}
pyenv rehash
pyenv global ${PYENV_VERSION}
# It is quite easy to get the above series of steps wrong. Verify that the
# version of python actually in the path and used is the version that was
# requested, and fail the build if we broke the travis setup
python_version=$(python -c 'import sys; print "{0}.{1}".format( sys.version_info[0], sys.version_info[1] )')
echo "Checking python version (actual ${python_version} vs expected ${YCMD_PYTHON_VERSION})"
test ${python_version} == ${YCMD_PYTHON_VERSION}
python_version=$(python -c 'import sys; print( "{0}.{1}".format( sys.version_info[0], sys.version_info[1] ) )')
echo "Checking python version (actual ${python_version} vs expected ${YCM_PYTHON_VERSION})"
test ${python_version} == ${YCM_PYTHON_VERSION}
############
# pip setup
############
pip install -U pip wheel setuptools
pip install -r python/test_requirements.txt
......
This diff is collapsed.
......@@ -6,11 +6,6 @@ import sys
import os.path as p
import glob
major, minor = sys.version_info[ 0 : 2 ]
if major != 2 or minor < 6:
sys.exit( 'The build script requires Python version >= 2.6 and < 3.0; '
'your version of Python is ' + sys.version )
DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
DIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' )
......
......@@ -33,10 +33,10 @@ elseif v:version < 703 || (v:version == 703 && !has('patch598'))
\ echohl None
call s:restore_cpo()
finish
elseif !has( 'python' )
elseif !has( 'python' ) && !has( 'python3' )
echohl WarningMsg |
\ echomsg "YouCompleteMe unavailable: requires Vim compiled with " .
\ "Python 2.x support" |
\ "Python (2.6+ or 3.3+) support" |
\ echohl None
call s:restore_cpo()
finish
......@@ -126,8 +126,9 @@ let g:ycm_server_keep_logfiles =
let g:ycm_extra_conf_vim_data =
\ get( g:, 'ycm_extra_conf_vim_data', [] )
let g:ycm_path_to_python_interpreter =
\ get( g:, 'ycm_path_to_python_interpreter', '' )
let g:ycm_server_python_interpreter =
\ get( g:, 'ycm_server_python_interpreter',
\ get( g:, 'ycm_path_to_python_interpreter', '' ) )
let g:ycm_show_diagnostics_ui =
\ get( g:, 'ycm_show_diagnostics_ui',
......
......@@ -15,6 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
from future.utils import iteritems
from ycm import vimsupport
from ycmd import user_options_store
from ycmd import request_wrap
......@@ -29,7 +38,7 @@ def BuildServerConf():
vim_globals = vimsupport.GetReadOnlyVimGlobals( force_python_objects = True )
server_conf = {}
for key, value in vim_globals.items():
for key, value in iteritems( vim_globals ):
if not key.startswith( YCM_VAR_PREFIX ):
continue
try:
......@@ -45,7 +54,7 @@ def BuildServerConf():
def LoadJsonDefaultsIntoVim():
defaults = user_options_store.DefaultOptions()
vim_defaults = {}
for key, value in defaults.iteritems():
for key, value in iteritems( defaults ):
vim_defaults[ 'ycm_' + key ] = value
vimsupport.LoadDictIntoVimGlobals( vim_defaults, overwrite = False )
......@@ -115,10 +124,10 @@ def AdjustCandidateInsertionText( candidates ):
new_candidates = []
for candidate in candidates:
if type( candidate ) is dict:
if isinstance( candidate, dict ):
new_candidate = candidate.copy()
if not 'abbr' in new_candidate:
if 'abbr' not in new_candidate:
new_candidate[ 'abbr' ] = new_candidate[ 'word' ]
new_candidate[ 'word' ] = NewCandidateInsertionText(
......@@ -127,7 +136,7 @@ def AdjustCandidateInsertionText( candidates ):
new_candidates.append( new_candidate )
elif type( candidate ) is str:
elif isinstance( candidate, str ) or isinstance( candidate, bytes ):
new_candidates.append(
{ 'abbr': candidate,
'word': NewCandidateInsertionText( candidate, text_after_cursor ) } )
......
......@@ -15,9 +15,18 @@
# You should have received a copy of the GNU General Public License
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
import requests
import urlparse
import urllib.parse
import json
from future.utils import native
from base64 import b64decode, b64encode
from retries import retries
from requests_futures.sessions import FuturesSession
......@@ -33,7 +42,9 @@ _EXECUTOR = UnsafeThreadPoolExecutor( max_workers = 30 )
_DEFAULT_TIMEOUT_SEC = 30
_HMAC_HEADER = 'x-ycm-hmac'
class BaseRequest( object ):
def __init__( self ):
pass
......@@ -129,11 +140,11 @@ class BaseRequest( object ):
@staticmethod
def _ExtraHeaders( method, request_uri, request_body = None ):
if not request_body:
request_body = ''
request_body = bytes( b'' )
headers = dict( _HEADERS )
headers[ _HMAC_HEADER ] = b64encode(
CreateRequestHmac( method,
urlparse.urlparse( request_uri ).path,
CreateRequestHmac( ToBytes( method ),
ToBytes( urllib.parse.urlparse( request_uri ).path ),
request_body,
BaseRequest.hmac_secret ) )
return headers
......@@ -180,7 +191,7 @@ def HandleServerException( exception ):
# up often and isn't something that's actionable by the user.
if 'already being parsed' in serialized_exception:
return
vimsupport.PostVimMessage( serialized_exception )
vimsupport.PostMultiLineNotice( serialized_exception )
def _ToUtf8Json( data ):
......@@ -196,11 +207,13 @@ def _ValidateResponseObject( response ):
def _BuildUri( handler ):
return urlparse.urljoin( BaseRequest.server_location, handler )
return native( ToBytes( urllib.parse.urljoin( BaseRequest.server_location,
handler ) ) )
SERVER_HEALTHY = False
def _CheckServerIsHealthyWithCache():
global SERVER_HEALTHY
......@@ -208,7 +221,7 @@ def _CheckServerIsHealthyWithCache():
request_uri = _BuildUri( 'healthy' )
response = requests.get( request_uri,
headers = BaseRequest._ExtraHeaders(
'GET', request_uri, '' ) )
'GET', request_uri, bytes( b'' ) ) )
_ValidateResponseObject( response )
response.raise_for_status()
return response.json()
......
......@@ -15,8 +15,20 @@
# You should have received a copy of the GNU General Public License
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
from requests.exceptions import ReadTimeout
import vim
from ycm.client.base_request import BaseRequest, BuildRequestData, ServerError
from ycmd.responses import ServerError
from ycm.client.base_request import ( BaseRequest, BuildRequestData,
HandleServerException )
from ycm import vimsupport
from ycmd.utils import ToUnicode
......@@ -45,8 +57,8 @@ class CommandRequest( BaseRequest ):
try:
self._response = self.PostDataToHandler( request_data,
'run_completer_command' )
except ServerError as e:
vimsupport.PostMultiLineNotice( e )
except ( ServerError, ReadTimeout ) as e:
HandleServerException( e )
def Response( self ):
......@@ -97,7 +109,7 @@ class CommandRequest( BaseRequest ):
try:
vimsupport.ReplaceChunks( chunks )
except RuntimeError as e:
vimsupport.PostMultiLineNotice( e.message )
vimsupport.PostMultiLineNotice( str( e ) )
def _HandleBasicResponse( self ):
......
......@@ -15,8 +15,20 @@
# You should have received a copy of the GNU General Public License
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
from requests.exceptions import ReadTimeout
from ycm.client.base_request import ( BaseRequest, BuildRequestData,
HandleServerException )
from ycmd.responses import ServerError
class CompleterAvailableRequest( BaseRequest ):
def __init__( self, filetypes ):
......@@ -31,7 +43,7 @@ class CompleterAvailableRequest( BaseRequest ):
try:
self._response = self.PostDataToHandler( request_data,
'semantic_completion_available' )
except Exception as e:
except ( ServerError, ReadTimeout ) as e:
HandleServerException( e )
......
......@@ -15,10 +15,21 @@
# You should have received a copy of the GNU General Public License
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
from ycmd.utils import ToBytes, ToUnicode
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
from requests.exceptions import ReadTimeout
from ycmd.utils import ToUnicode
from ycm.client.base_request import ( BaseRequest, JsonFromFuture,
HandleServerException,
MakeServerException )
from ycmd.responses import ServerError
TIMEOUT_SECONDS = 0.5
......@@ -45,12 +56,12 @@ class CompletionRequest( BaseRequest ):