Skip to content

Commit 7e67216

Browse files
authored
Merge branch 'master' into master
2 parents 9e6b32b + 323d4b6 commit 7e67216

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ def GetPossiblePythonLibraryDirectories():
292292
return [
293293
sysconfig.get_config_var( 'LIBPL' ),
294294
p.join( prefix, 'lib64' ),
295+
p.join( prefix, 'lib/64' ),
295296
p.join( prefix, 'lib' )
296297
]
297298

cpp/ycm/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ if ( USE_CLANG_COMPLETER AND
5757
set( LIBCLANG_DIRNAME
5858
"libclang-${CLANG_VERSION}-amd64-unknown-freebsd13" )
5959
set( LIBCLANG_SHA256
60-
"0d3e808e04d4ebb6023402310316799b6c9c4220763fd13d7691dc24969ce4c4" )
60+
"6efd6cc111939766dde6873fbd371280c13ffbb3c7fae193d5f66bd988ccf440" )
6161
else()
6262
set( LIBCLANG_DIRNAME
6363
"libclang-${CLANG_VERSION}-i386-unknown-freebsd13" )
6464
set( LIBCLANG_SHA256
65-
"6efd6cc111939766dde6873fbd371280c13ffbb3c7fae193d5f66bd988ccf440" )
66-
endif()
65+
"0d3e808e04d4ebb6023402310316799b6c9c4220763fd13d7691dc24969ce4c4" )
66+
endif()
6767
elseif ( CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)" )
6868
set( LIBCLANG_DIRNAME "libclang-${CLANG_VERSION}-aarch64-linux-gnu" )
6969
set( LIBCLANG_SHA256

cpp/ycm/ClangCompleter/TranslationUnit.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,21 @@ void TranslationUnit::UpdateLatestDiagnostics() {
482482
clang_disposeDiagnostic ),
483483
clang_translation_unit_ );
484484

485-
if ( diagnostic.kind_ != DiagnosticKind::INFORMATION ) {
486-
latest_diagnostics_.push_back( diagnostic );
485+
if ( diagnostic.kind_ == DiagnosticKind::INFORMATION ) {
486+
continue;
487487
}
488+
489+
// Sometimes libclang returns invalid ranges causing ycm in trouble
490+
// Specially editing incomplete macros
491+
diagnostic.ranges_.erase( std::remove_if( diagnostic.ranges_.begin(),
492+
diagnostic.ranges_.end(),
493+
[]( const auto &range ) -> bool {
494+
return range.start_.line_number_ == 0 ||
495+
range.start_.column_number_ == 0 ||
496+
range.end_.line_number_ == 0 ||
497+
range.end_.column_number_ == 0;
498+
} ), diagnostic.ranges_.end() );
499+
latest_diagnostics_.push_back( diagnostic );
488500
}
489501
}
490502

ycmd/completers/cpp/flags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
# checks prefixes).
3535
INCLUDE_FLAGS = [ '-isystem', '-I', '-iquote', '-isysroot', '--sysroot',
3636
'-gcc-toolchain', '-include-pch', '-include', '-iframework',
37-
'-F', '-imacros', '-idirafter', '-B' ]
38-
INCLUDE_FLAGS_WIN_STYLE = [ '/I' ]
37+
'-F', '-imacros', '-idirafter', '-B', '-imsvc' ]
38+
INCLUDE_FLAGS_WIN_STYLE = [ '/I', '-imsvc' ]
3939
PATH_FLAGS = [ '--sysroot=' ] + INCLUDE_FLAGS
4040

4141
# We need to remove --fcolor-diagnostics because it will cause shell escape

ycmd/tests/clang/diagnostics_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ def test_Diagnostics_LocationExtent_MissingSemicolon( self, app ):
265265
'location': LocationMatcher( filepath, 8, 7 ),
266266
'location_extent': RangeMatcher( filepath, ( 8, 7 ), ( 8, 11 ) ),
267267
'ranges': contains_exactly(
268-
# FIXME: empty ranges from libclang should be ignored.
269-
RangeMatcher( '', ( 0, 0 ), ( 0, 0 ) ),
270268
RangeMatcher( filepath, ( 8, 7 ), ( 8, 11 ) )
271269
),
272270
'text': equal_to( 'constructor cannot have a return type' ),

0 commit comments

Comments
 (0)