mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 10:44:41 +01:00
Use InImport pointing to C++ imports in ConvertLocInFile() instead of adding a separate InCppImport when emitting (#5614)
I believe we will need to eventually add the specific C++ import information in `LocId`. This also seems to fix the `LanguageServerDiagnosticInWrongFile` issue (#5604). We're still not in the state we want to be according to https://github.com/carbon-language/carbon-lang/pull/5246#issuecomment-2784301206. Will look into removing the location part from the `"In file included from ..."` line. Part of #5245.
This commit is contained in:
@@ -19,20 +19,6 @@ constexpr Kind Kinds[] = {
|
||||
#include "toolchain/diagnostics/diagnostic_kind.def"
|
||||
};
|
||||
|
||||
// TODO: LanguageServerDiagnosticInWrongFile currently has coverage, but
|
||||
// mainly due to incorrect behavior in C++ diagnostics. See
|
||||
// language_server/testdata/text_document/open_with_cpp_nonexistent.carbon.
|
||||
// Leaving this TODO here until it's more precisely tested, because the C++
|
||||
// diagnostics should be fixed (removing coverage); see below TODO.
|
||||
//
|
||||
// TODO: This can only fire if the first message in a diagnostic is rooted
|
||||
// in a file other than the file being compiled. The language server
|
||||
// currently only supports compiling one file at a time. Do one of:
|
||||
// - When imports are supported, find a diagnostic whose first message isn't
|
||||
// in the current file.
|
||||
// - Require all diagnostics produced by compiling have their first location
|
||||
// be in the file being compiled, never an import.
|
||||
// Kind::LanguageServerDiagnosticInWrongFile,
|
||||
constexpr Kind UntestedKinds[] = {
|
||||
// These exist only for unit tests.
|
||||
Kind::TestDiagnostic,
|
||||
@@ -56,6 +42,15 @@ constexpr Kind UntestedKinds[] = {
|
||||
|
||||
// This is a little long but is tested in lex/numeric_literal_test.cpp.
|
||||
Kind::TooManyDigits,
|
||||
|
||||
// TODO: This can only fire if the first message in a diagnostic is rooted
|
||||
// in a file other than the file being compiled. The language server
|
||||
// currently only supports compiling one file at a time. Do one of:
|
||||
// - When imports are supported, find a diagnostic whose first message isn't
|
||||
// in the current file.
|
||||
// - Require all diagnostics produced by compiling have their first location
|
||||
// be in the file being compiled, never an import.
|
||||
Kind::LanguageServerDiagnosticInWrongFile,
|
||||
};
|
||||
|
||||
// Looks for diagnostic kinds that aren't covered by a file_test.
|
||||
|
||||
Reference in New Issue
Block a user