Fixing str/unicode mismatch
Sending a unicode filepath to CompilationDatabase doesn't work and causes exceptions; it has to be a (utf-8 encoded) str object.
This commit is contained in:
parent
433b3b64f0
commit
47a0048f34
@ -103,6 +103,7 @@ class Flags( object ):
|
|||||||
|
|
||||||
|
|
||||||
def _CallExtraConfFlagsForFile( module, filename, client_data ):
|
def _CallExtraConfFlagsForFile( module, filename, client_data ):
|
||||||
|
filename = ToUtf8IfNeeded( filename )
|
||||||
# For the sake of backwards compatibility, we need to first check whether the
|
# For the sake of backwards compatibility, we need to first check whether the
|
||||||
# FlagsForFile function in the extra conf module even allows keyword args.
|
# FlagsForFile function in the extra conf module even allows keyword args.
|
||||||
if inspect.getargspec( module.FlagsForFile ).keywords:
|
if inspect.getargspec( module.FlagsForFile ).keywords:
|
||||||
|
@ -22,6 +22,7 @@ import re
|
|||||||
from ycm.completers.completer import Completer
|
from ycm.completers.completer import Completer
|
||||||
from ycm.completers.cpp.clang_completer import InCFamilyFile
|
from ycm.completers.cpp.clang_completer import InCFamilyFile
|
||||||
from ycm.completers.cpp.flags import Flags
|
from ycm.completers.cpp.flags import Flags
|
||||||
|
from ycm.utils import ToUtf8IfNeeded
|
||||||
from ycm.server import responses
|
from ycm.server import responses
|
||||||
|
|
||||||
class FilenameCompleter( Completer ):
|
class FilenameCompleter( Completer ):
|
||||||
@ -55,7 +56,7 @@ class FilenameCompleter( Completer ):
|
|||||||
def AtIncludeStatementStart( self, request_data ):
|
def AtIncludeStatementStart( self, request_data ):
|
||||||
start_column = request_data[ 'start_column' ]
|
start_column = request_data[ 'start_column' ]
|
||||||
current_line = request_data[ 'line_value' ]
|
current_line = request_data[ 'line_value' ]
|
||||||
filepath = request_data[ 'filepath' ]
|
filepath = ToUtf8IfNeeded( request_data[ 'filepath' ] )
|
||||||
filetypes = request_data[ 'file_data' ][ filepath ][ 'filetypes' ]
|
filetypes = request_data[ 'file_data' ][ filepath ][ 'filetypes' ]
|
||||||
return ( InCFamilyFile( filetypes ) and
|
return ( InCFamilyFile( filetypes ) and
|
||||||
self._include_start_regex.match(
|
self._include_start_regex.match(
|
||||||
@ -76,7 +77,7 @@ class FilenameCompleter( Completer ):
|
|||||||
def ComputeCandidatesInner( self, request_data ):
|
def ComputeCandidatesInner( self, request_data ):
|
||||||
current_line = request_data[ 'line_value' ]
|
current_line = request_data[ 'line_value' ]
|
||||||
start_column = request_data[ 'start_column' ]
|
start_column = request_data[ 'start_column' ]
|
||||||
filepath = request_data[ 'filepath' ]
|
filepath = ToUtf8IfNeeded( request_data[ 'filepath' ] )
|
||||||
filetypes = request_data[ 'file_data' ][ filepath ][ 'filetypes' ]
|
filetypes = request_data[ 'file_data' ][ filepath ][ 'filetypes' ]
|
||||||
line = current_line[ :start_column ]
|
line = current_line[ :start_column ]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user