Updating to latest ycmd
Since ycmd doesn't need 'query', 'start_column' and 'line_value' params, we don't send them anymore.
This commit is contained in:
parent
bb1114fe4c
commit
4cf9cfcdff
@ -623,9 +623,9 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
python << EOF
|
python << EOF
|
||||||
def GetCompletions( query ):
|
def GetCompletionsInner():
|
||||||
request = ycm_state.GetCurrentCompletionRequest()
|
request = ycm_state.GetCurrentCompletionRequest()
|
||||||
request.Start( query )
|
request.Start()
|
||||||
while not request.Done():
|
while not request.Done():
|
||||||
if bool( int( vim.eval( 'complete_check()' ) ) ):
|
if bool( int( vim.eval( 'complete_check()' ) ) ):
|
||||||
return { 'words' : [], 'refresh' : 'always'}
|
return { 'words' : [], 'refresh' : 'always'}
|
||||||
@ -635,8 +635,8 @@ def GetCompletions( query ):
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
function! s:CompletionsForQuery( query )
|
function! s:GetCompletions()
|
||||||
py results = GetCompletions( vim.eval( 'a:query' ) )
|
py results = GetCompletionsInner()
|
||||||
let results = pyeval( 'results' )
|
let results = pyeval( 'results' )
|
||||||
let s:searched_and_results_found = len( results.words ) != 0
|
let s:searched_and_results_found = len( results.words ) != 0
|
||||||
return results
|
return results
|
||||||
@ -669,7 +669,7 @@ function! youcompleteme#Complete( findstart, base )
|
|||||||
endif
|
endif
|
||||||
return pyeval( 'request.CompletionStartColumn()' )
|
return pyeval( 'request.CompletionStartColumn()' )
|
||||||
else
|
else
|
||||||
return s:CompletionsForQuery( a:base )
|
return s:GetCompletions()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -680,7 +680,7 @@ function! youcompleteme#OmniComplete( findstart, base )
|
|||||||
py request = ycm_state.CreateCompletionRequest( force_semantic = True )
|
py request = ycm_state.CreateCompletionRequest( force_semantic = True )
|
||||||
return pyeval( 'request.CompletionStartColumn()' )
|
return pyeval( 'request.CompletionStartColumn()' )
|
||||||
else
|
else
|
||||||
return s:CompletionsForQuery( a:base )
|
return s:GetCompletions()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import vim
|
|||||||
from ycm import vimsupport
|
from ycm import vimsupport
|
||||||
from ycmd import utils
|
from ycmd import utils
|
||||||
from ycmd import user_options_store
|
from ycmd import user_options_store
|
||||||
|
from ycmd import request_wrap
|
||||||
import ycm_client_support
|
import ycm_client_support
|
||||||
|
|
||||||
YCM_VAR_PREFIX = 'ycm_'
|
YCM_VAR_PREFIX = 'ycm_'
|
||||||
@ -55,19 +56,8 @@ def LoadJsonDefaultsIntoVim():
|
|||||||
|
|
||||||
|
|
||||||
def CompletionStartColumn():
|
def CompletionStartColumn():
|
||||||
"""Returns the 0-based index where the completion string should start. So if
|
return ( request_wrap.CompletionStartColumn(
|
||||||
the user enters:
|
vim.current.line, vimsupport.CurrentColumn() + 1 ) - 1 )
|
||||||
foo.bar^
|
|
||||||
with the cursor being at the location of the caret, then the starting column
|
|
||||||
would be the index of the letter 'b'.
|
|
||||||
"""
|
|
||||||
|
|
||||||
line = vim.current.line
|
|
||||||
start_column = vimsupport.CurrentColumn()
|
|
||||||
|
|
||||||
while start_column > 0 and utils.IsIdentifierChar( line[ start_column - 1 ] ):
|
|
||||||
start_column -= 1
|
|
||||||
return start_column
|
|
||||||
|
|
||||||
|
|
||||||
def CurrentIdentifierFinished():
|
def CurrentIdentifierFinished():
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
# 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/>.
|
||||||
|
|
||||||
import vim
|
|
||||||
import requests
|
import requests
|
||||||
import urlparse
|
import urlparse
|
||||||
from base64 import b64decode, b64encode
|
from base64 import b64decode, b64encode
|
||||||
@ -134,26 +133,18 @@ class BaseRequest( object ):
|
|||||||
hmac_secret = ''
|
hmac_secret = ''
|
||||||
|
|
||||||
|
|
||||||
def BuildRequestData( start_column = None,
|
def BuildRequestData( include_buffer_data = True ):
|
||||||
query = None,
|
|
||||||
include_buffer_data = True ):
|
|
||||||
if start_column is None:
|
|
||||||
start_column = 0
|
|
||||||
line, column = vimsupport.CurrentLineAndColumn()
|
line, column = vimsupport.CurrentLineAndColumn()
|
||||||
filepath = vimsupport.GetCurrentBufferFilepath()
|
filepath = vimsupport.GetCurrentBufferFilepath()
|
||||||
request_data = {
|
request_data = {
|
||||||
'filetypes': vimsupport.CurrentFiletypes(),
|
'filetypes': vimsupport.CurrentFiletypes(),
|
||||||
'line_num': line + 1,
|
'line_num': line + 1,
|
||||||
'column_num': column + 1,
|
'column_num': column + 1,
|
||||||
'start_column': start_column + 1,
|
|
||||||
'line_value': vim.current.line,
|
|
||||||
'filepath': filepath
|
'filepath': filepath
|
||||||
}
|
}
|
||||||
|
|
||||||
if include_buffer_data:
|
if include_buffer_data:
|
||||||
request_data[ 'file_data' ] = vimsupport.GetUnsavedAndCurrentBufferData()
|
request_data[ 'file_data' ] = vimsupport.GetUnsavedAndCurrentBufferData()
|
||||||
if query:
|
|
||||||
request_data[ 'query' ] = query
|
|
||||||
|
|
||||||
return request_data
|
return request_data
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class CompletionRequest( BaseRequest ):
|
|||||||
self._completion_start_column = base.CompletionStartColumn()
|
self._completion_start_column = base.CompletionStartColumn()
|
||||||
|
|
||||||
# This field is also used by the omni_completion_request subclass
|
# This field is also used by the omni_completion_request subclass
|
||||||
self.request_data = BuildRequestData( self._completion_start_column )
|
self.request_data = BuildRequestData()
|
||||||
if extra_data:
|
if extra_data:
|
||||||
self.request_data.update( extra_data )
|
self.request_data.update( extra_data )
|
||||||
|
|
||||||
@ -41,8 +41,7 @@ class CompletionRequest( BaseRequest ):
|
|||||||
return self._completion_start_column
|
return self._completion_start_column
|
||||||
|
|
||||||
|
|
||||||
def Start( self, query ):
|
def Start( self ):
|
||||||
self.request_data[ 'query' ] = query
|
|
||||||
self._response_future = self.PostDataToHandlerAsync( self.request_data,
|
self._response_future = self.PostDataToHandlerAsync( self.request_data,
|
||||||
'completions',
|
'completions',
|
||||||
TIMEOUT_SECONDS )
|
TIMEOUT_SECONDS )
|
||||||
|
@ -26,8 +26,7 @@ class OmniCompletionRequest( CompletionRequest ):
|
|||||||
self._omni_completer = omni_completer
|
self._omni_completer = omni_completer
|
||||||
|
|
||||||
|
|
||||||
def Start( self, query ):
|
def Start( self ):
|
||||||
self.request_data[ 'query' ] = query
|
|
||||||
self._results = self._omni_completer.ComputeCandidates( self.request_data )
|
self._results = self._omni_completer.ComputeCandidates( self.request_data )
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
import vim
|
import vim
|
||||||
from ycm import vimsupport
|
from ycm import vimsupport
|
||||||
from ycm import base
|
|
||||||
from ycmd.completers.completer import Completer
|
from ycmd.completers.completer import Completer
|
||||||
|
from ycmd.request_wrap import RequestWrap
|
||||||
from ycm.client.base_request import BuildRequestData
|
from ycm.client.base_request import BuildRequestData
|
||||||
|
|
||||||
OMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!'
|
OMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!'
|
||||||
@ -106,7 +106,6 @@ class OmniCompleter( Completer ):
|
|||||||
|
|
||||||
|
|
||||||
def _BuildRequestDataSubstitute():
|
def _BuildRequestDataSubstitute():
|
||||||
return BuildRequestData( start_column = base.CompletionStartColumn(),
|
return RequestWrap( BuildRequestData( include_buffer_data = False ) )
|
||||||
include_buffer_data = False )
|
|
||||||
|
|
||||||
|
|
||||||
|
2
third_party/ycmd
vendored
2
third_party/ycmd
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 7a14048fe2543287b8681544a8b428b409a93858
|
Subproject commit 5ed4d902c76369dcd653c59984c1996d7cdc16a5
|
Loading…
x
Reference in New Issue
Block a user