From 50e0f8685ad6efeb35268eb912395182a0a3ddd0 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 13 Sep 2024 11:22:51 -0700 Subject: [PATCH 1/6] Show the reload window message when caseSensitiveFileSupport is changed. (#12700) * Show the reload window message when caseSensitiveFileSupport is changed. --- Extension/src/LanguageServer/client.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 79463dd11..30d016d33 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -838,6 +838,7 @@ export class DefaultClient implements Client { public lastCustomBrowseConfiguration: PersistentFolderState | undefined; public lastCustomBrowseConfigurationProviderId: PersistentFolderState | undefined; public lastCustomBrowseConfigurationProviderVersion: PersistentFolderState | undefined; + public currentCaseSensitiveFileSupport: PersistentWorkspaceState | undefined; private registeredProviders: PersistentFolderState | undefined; private configStateReceived: ConfigStateReceived = { compilers: false, compileCommands: false, configProviders: undefined, timeout: false }; @@ -1457,6 +1458,9 @@ export class DefaultClient implements Client { const workspaceSettings: CppSettings = new CppSettings(); const workspaceOtherSettings: OtherSettings = new OtherSettings(); const workspaceFolderSettingsParams: WorkspaceFolderSettingsParams[] = this.getAllWorkspaceFolderSettings(); + if (this.currentCaseSensitiveFileSupport && workspaceSettings.isCaseSensitiveFileSupportEnabled !== this.currentCaseSensitiveFileSupport.Value) { + void util.promptForReloadWindowDueToSettingsChange(); + } return { filesAssociations: workspaceOtherSettings.filesAssociations, workspaceFallbackEncoding: workspaceOtherSettings.filesEncoding, @@ -1484,7 +1488,7 @@ export class DefaultClient implements Client { } private async createLanguageClient(): Promise { - const currentCaseSensitiveFileSupport: PersistentWorkspaceState = new PersistentWorkspaceState("CPP.currentCaseSensitiveFileSupport", false); + this.currentCaseSensitiveFileSupport = new PersistentWorkspaceState("CPP.currentCaseSensitiveFileSupport", false); let resetDatabase: boolean = false; const serverModule: string = getLanguageServerFileName(); const exeExists: boolean = fs.existsSync(serverModule); @@ -1527,9 +1531,9 @@ export class DefaultClient implements Client { } const workspaceSettings: CppSettings = new CppSettings(); - if (workspaceSettings.isCaseSensitiveFileSupportEnabled !== currentCaseSensitiveFileSupport.Value) { + if (workspaceSettings.isCaseSensitiveFileSupportEnabled !== this.currentCaseSensitiveFileSupport.Value) { resetDatabase = true; - currentCaseSensitiveFileSupport.Value = workspaceSettings.isCaseSensitiveFileSupportEnabled; + this.currentCaseSensitiveFileSupport.Value = workspaceSettings.isCaseSensitiveFileSupportEnabled; } const cacheStoragePath: string = util.getCacheStoragePath(); From ccc07f5adb7534b84f3a022e4a150b14ad09ede6 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 13 Sep 2024 11:33:44 -0700 Subject: [PATCH 2/6] Enable log diagnostics without a C/C++ file active. (#12701) --- Extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index 359a0a909..664c5b6cb 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -5864,7 +5864,7 @@ }, { "command": "C_Cpp.LogDiagnostics", - "when": "editorLangId =~ /^(c|(cuda-)?cpp)$/ && !(config.C_Cpp.intelliSenseEngine =~ /^[dD]isabled$/)" + "when": "!(config.C_Cpp.intelliSenseEngine =~ /^[dD]isabled$/)" }, { "command": "C_Cpp.RescanWorkspace", From cd4ef2329fa1d919da74e5fb43fbc808c0aa45af Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 13 Sep 2024 11:38:42 -0700 Subject: [PATCH 3/6] Update changelog. (#12710) --- Extension/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 113d2687d..5fd30556e 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -3,6 +3,7 @@ ## Version 1.22.3: September 12, 2024 ### Enhancement * Add support for providing additional context information to Copilot Chat. [PR #12685](https://github.com/microsoft/vscode-cpptools/pull/12685) + * Currently, it requires `"C_Cpp.experimentalFeatures": "enabled"` and typing `#cpp` in the chat. ### Bug Fixes * Fix the compiler selection control not keeping the list in sync with contents of the textbox. [#7427](https://github.com/microsoft/vscode-cpptools/issues/7427) From 970f95bfea8a0b23bac5965b9fce6c3c508f18f7 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 18 Sep 2024 03:18:14 -0700 Subject: [PATCH 4/6] Update IntelliSense loc strings. (#12726) --- Extension/bin/messages/cs/messages.json | 12 +++++----- Extension/bin/messages/de/messages.json | 12 +++++----- Extension/bin/messages/es/messages.json | 12 +++++----- Extension/bin/messages/fr/messages.json | 12 +++++----- Extension/bin/messages/it/messages.json | 28 +++++++++++----------- Extension/bin/messages/ja/messages.json | 12 +++++----- Extension/bin/messages/ko/messages.json | 12 +++++----- Extension/bin/messages/pl/messages.json | 12 +++++----- Extension/bin/messages/pt-br/messages.json | 12 +++++----- Extension/bin/messages/ru/messages.json | 12 +++++----- Extension/bin/messages/tr/messages.json | 12 +++++----- Extension/bin/messages/zh-cn/messages.json | 12 +++++----- Extension/bin/messages/zh-tw/messages.json | 12 +++++----- 13 files changed, 86 insertions(+), 86 deletions(-) diff --git a/Extension/bin/messages/cs/messages.json b/Extension/bin/messages/cs/messages.json index 1af8bee7e..db0402333 100644 --- a/Extension/bin/messages/cs/messages.json +++ b/Extension/bin/messages/cs/messages.json @@ -1410,7 +1410,7 @@ "Striktní režim je nekompatibilní se zpracováním oboru názvů std jako aliasu pro globální obor názvů.", "v rozšíření makra %s %p", "", - "", + null, "[rozšíření makra %d není zobrazené]", "v rozšíření makra v %p", "neplatný název symbolického operandu %sq", @@ -1505,7 +1505,7 @@ "Chyba příkazového řádku", "vnitřní chyba", "Vnitřní chyba", - null, + "-D", null, "Došlo k dosažení limitu chyb.", "Smyčka interní chyby", @@ -1524,7 +1524,7 @@ "převodní jazyk (7)", "převodní jazyk (8)", "převodní jazyk (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "neplatný znak pro literál char16_t", null, "Nerozpoznaná konvence volání %s, musí být jednou z:", - null, + "%s", null, null, "Nadřízený typ typu výčtu musí být integrální typ.", @@ -2953,9 +2953,9 @@ "Neplatná hodnota sady pragma %s pro funkci s omezením AMP", "Překrývající se specifikátory omezení nejsou povolené.", "Specifikátory omezení destruktoru musejí pokrývat sjednocení specifikátorů omezení všech konstruktorů.", - "", + "error", "Pro nostdlib se vyžaduje aspoň jedno nucené použití.", - "", + "error-type", null, null, null, diff --git a/Extension/bin/messages/de/messages.json b/Extension/bin/messages/de/messages.json index 14666db3c..433ce5dc2 100644 --- a/Extension/bin/messages/de/messages.json +++ b/Extension/bin/messages/de/messages.json @@ -1410,7 +1410,7 @@ "Der Strict-Modus ist mit dem Behandeln des Namespaces \"std\" als Alias für den globalen Namespace inkompatibel.", "In Erweiterung von Makro \"%s\" %p", "", - "", + null, "[%d Makroerweiterungen werden nicht angezeigt.]", "In Makroerweiterung bei %p", "Ungültiger symbolischer Operandname \"%sq\".", @@ -1505,7 +1505,7 @@ "Befehlszeilenfehler", "Interner Fehler.", "Interner Fehler.", - null, + "-D", null, "Fehlerlimit erreicht.", "Interne Fehlerschleife", @@ -1524,7 +1524,7 @@ "Zwischensprache (7)", "Zwischensprache (8)", "Zwischensprache (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "Ungültiges Zeichen für char16_t-Literal.", null, "Unbekannte Aufrufkonvention \"%s\", muss eine der folgenden Optionen sein:", - null, + "%s", null, null, "Der zugrunde liegende Typ des Enumerationstyps muss ein integraler Typ sein.", @@ -2953,9 +2953,9 @@ "Unzulässiger Wert für Pragmapaket \"%s\" für die auf AMP begrenzte Funktion.", "Überlappende Einschränkungsspezifizierer sind unzulässig.", "Die Einschränkungsspezifizierer des Destruktors müssen die Union der Einschränkungsspezifizierer für alle Konstruktoren abdecken.", - "", + "Fehler", "Für \"nostdlib\" ist mindestens eine erzwungene Verwendung erforderlich.", - "", + "Fehlertyp", null, null, null, diff --git a/Extension/bin/messages/es/messages.json b/Extension/bin/messages/es/messages.json index 3225a42f1..6465299d8 100644 --- a/Extension/bin/messages/es/messages.json +++ b/Extension/bin/messages/es/messages.json @@ -1410,7 +1410,7 @@ "el modo strict no es compatible con el trato del espacio de nombres std como alias para el espacio de nombres global", "en la expansión de macro '%s' %p,", "", - "", + null, "[ las expansiones de macro %d no se muestran ]", "en expansión de macro en %p", "nombre de operando simbólico %sq no válido", @@ -1505,7 +1505,7 @@ "Error de la línea de comandos", "Error interno", "Error interno", - null, + "-D", null, "Se ha alcanzado el límite de error.", "Bucle de error interno", @@ -1524,7 +1524,7 @@ "lenguaje intermedio (7)", "lenguaje intermedio (8)", "lenguaje intermedio (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "carácter no válido para el literal char16_t", null, "convención de llamada %s no reconocida, debe ser una de las siguientes:", - null, + "%s", null, null, "el tipo subyacente del tipo de enumeración debe ser un tipo entero", @@ -2953,9 +2953,9 @@ "valor de pragma pack %s no válido para la función con restricción amp", "no se permiten especificadores de restricción superpuestos", "los especificadores de restricción del destructor deben cubrir la unión de los especificadores de restricción de todos los constructores", - "", + "error", "nostdlib requiere al menos un uso forzado", - "", + "error-type", null, null, null, diff --git a/Extension/bin/messages/fr/messages.json b/Extension/bin/messages/fr/messages.json index a47e86e4f..7a32a0c3c 100644 --- a/Extension/bin/messages/fr/messages.json +++ b/Extension/bin/messages/fr/messages.json @@ -1410,7 +1410,7 @@ "le mode strict est incompatible avec le traitement de namespace std en tant qu'alias pour l'espace de noms global", "dans l'expansion macro '%s' %p", "", - "", + null, "[ %d expansions macro non affichées ]", "dans l'expansion macro à %p", "nom d'opérande symbolique non valide %sq", @@ -1505,7 +1505,7 @@ "Erreur de ligne de commande", "erreur interne", "Erreur interne", - null, + "-D", null, "Limitation d'erreur atteinte.", "Boucle d'erreur interne", @@ -1524,7 +1524,7 @@ "langage intermédiaire (7)", "langage intermédiaire (8)", "langage intermédiaire (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "caractère non valide pour le littéral char16_t", null, "convention d'appel inconnue %s, doit être l'une des suivantes :", - null, + "%s", null, null, "le type sous-jacent du type enum doit être un type intégral", @@ -2953,9 +2953,9 @@ "valeur de pragma pack non conforme %s pour la fonction à restriction amp", "spécificateurs de restriction en chevauchement non autorisés", "les spécificateurs de restriction du destructeur doivent couvrir l'union des spécificateurs de restriction sur tous les constructeurs", - "", + "erreur", "nostdlib nécessite au moins un using forcé", - "", + "type d’erreur", null, null, null, diff --git a/Extension/bin/messages/it/messages.json b/Extension/bin/messages/it/messages.json index e5c7937ae..29646d72c 100644 --- a/Extension/bin/messages/it/messages.json +++ b/Extension/bin/messages/it/messages.json @@ -453,15 +453,15 @@ "omissione di %sq non conforme allo standard", "impossibile specificare il tipo restituito in una funzione di conversione", "rilevato durante:", - "creazione di un'istanza del contesto %p1 del modello %nt1", - "generazione implicita del contesto %p1 del modello %nt1", + "creazione di un'istanza del contesto %nt %p", + "generazione implicita del contesto %nt %p", "ricorsione eccessiva durante la creazione di un'istanza di %n", "%sq non è una funzione o un membro dati statici", "l'argomento di tipo %t1 è incompatibile con il parametro del modello di tipo %t2", "non è possibile eseguire un'inizializzazione che richiede un tipo temporaneo o una conversione", "se si dichiara %sq, il parametro della funzione verrà nascosto", "il valore iniziale del riferimento a non const deve essere un lvalue", - "definizione implicita del contesto %p del modello %nt", + "definizione implicita del contesto %nt %p", "'template' non consentito", "%t non è un modello di classe", null, @@ -526,7 +526,7 @@ "chiamata funzione non const per l'oggetto const (anacronismo)", "un'istruzione dipendente non può essere una dichiarazione", "il tipo di un parametro non può essere void", - "creazione di un'istanza del contesto %p1 della classe %na1", + "creazione di un'istanza del contesto %na %p", "elaborazione dell'elenco degli argomenti di modello per %na %p", "operatore non consentito in un'espressione di argomento del modello", "con il blocco try è richiesto almeno un gestore", @@ -682,11 +682,11 @@ "directory PCH non valida: %s", "previsto __except o __finally", "un'istruzione __leave può essere utilizzata solo in un blocco __try", - "rilevato durante la creazione di un'istanza del contesto %p del modello %nt", - "rilevato durante la generazione implicita del contesto %p1 del modello %nt1", - "rilevato durante la creazione di un'istanza del contesto %p della classe %na", + "rilevato durante la creazione di un'istanza del contesto %nt %p", + "rilevato durante la generazione implicita del contesto %nt %p", + "rilevato durante la creazione di un'istanza del contesto %na %p", "rilevato durante l'elaborazione dell'elenco degli argomenti di modello per %na %p", - "rilevato durante la definizione implicita del contesto %p1 del modello %nt1", + "rilevato durante la definizione implicita del contesto %nt %p", "%sq non trovato nello stack di allineamento compressione", "stack di allineamento compressione vuoto", "è possibile utilizzare l'opzione RTTI solo quando si esegue la compilazione nel linguaggio C++", @@ -1410,7 +1410,7 @@ "modalità strict incompatibile con lo spazio dei nomi std utilizzato come alias dello spazio dei nomi globale", "nell'espansione della macro '%s' %p", "", - "", + null, "[ espansioni della macro %d non visualizzate ]", "nell'espansione della macro in %p", "nome di operando simbolico %sq non valido", @@ -1505,7 +1505,7 @@ "Errore nella riga di comando", "errore interno", "Errore interno", - null, + "-D", null, "Limite di errore raggiunto.", "Ciclo di errore interno", @@ -1524,7 +1524,7 @@ "linguaggio intermedio (7)", "linguaggio intermedio (8)", "linguaggio intermedio (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "carattere non valido per il valore letterale char16_t", null, "convenzione di chiamata %s non riconosciuta. Deve essere una delle seguenti:", - null, + "%s", null, null, "il tipo sottostante del tipo enumerazione deve essere un tipo integrale", @@ -2953,9 +2953,9 @@ "il valore %s del pacchetto pragma per la funzione con restrizioni AMP non è valido", "gli identificatori di limitazione sovrapposti non sono consentiti", "gli identificatori di limitazione del distruttore devono coprire l'unione degli identificatori di limitazione in tutti i costruttori", - "", + "errore", "con nostdlib è richiesta almeno un'opzione Forced Using", - "", + "tipo di errore", null, null, null, diff --git a/Extension/bin/messages/ja/messages.json b/Extension/bin/messages/ja/messages.json index 9ef4cd4de..c4df6c5f8 100644 --- a/Extension/bin/messages/ja/messages.json +++ b/Extension/bin/messages/ja/messages.json @@ -1410,7 +1410,7 @@ "strict モードはグローバル名前空間に対するエイリアスとしての名前空間 std の取り扱いと互換性がありません", "マクロ '%s' %p の展開で、", "<不明>", - "", + null, "[ %d マクロの展開は示されていません ]", "%p の場所でのマクロの展開で", "シンボル オペランド名 %sq が無効です", @@ -1505,7 +1505,7 @@ "コマンド ライン エラー", "内部エラー", "内部エラー", - null, + "-D", null, "エラーの上限に達しました。", "内部エラー ループ", @@ -1524,7 +1524,7 @@ "中間言語 (7)", "中間言語 (8)", "中間言語 (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "char16_t リテラルには無効な文字です", null, "呼び出し規約 %s は認識されないため、次のいずれかを使用する必要があります:", - null, + "%s", null, null, "列挙型の基になる型は整数型である必要があります", @@ -2953,9 +2953,9 @@ "amp 制限関数に無効な pragma pack 値 %s ", "重複した制限指定子は許可されていません", "デストラクターの制限指定子は、すべてのコンストラクターの制限指定子の和集合を対象とする必要があります", - "", + "エラー", "nostdlib には少なくとも 1 つの強制された using が必要です", - "", + "エラーの種類", null, null, null, diff --git a/Extension/bin/messages/ko/messages.json b/Extension/bin/messages/ko/messages.json index af4cf82ad..d357af164 100644 --- a/Extension/bin/messages/ko/messages.json +++ b/Extension/bin/messages/ko/messages.json @@ -1410,7 +1410,7 @@ "strict 모드가 std 네임스페이스를 전역 네임스페이스에 대한 별칭으로 처리하는 방식과 호환되지 않습니다.", "매크로 '%s' %p의 확장,", "<알 수 없음>", - "", + null, "[ %d 매크로 확장이 표시되지 않음 ]", "%p의 매크로 확장", "기호화된 피연산자 이름 %sq이(가) 잘못되었습니다.", @@ -1505,7 +1505,7 @@ "명령줄 오류", "내부 오류", "내부 오류", - null, + "-D", null, "오류 한계에 도달했습니다.", "내부 오류 루프", @@ -1524,7 +1524,7 @@ "중간 언어 (7)", "중간 언어 (8)", "중간 언어 (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "char16_t 리터럴에 대한 잘못된 문자", null, "인식할 수 없는 호출 규칙 %s, 다음 중 하나여야 함:", - null, + "%s", null, null, "열거형 형식의 내부 형식은 정수 계열 형식이어야 합니다.", @@ -2953,9 +2953,9 @@ "amp 제한 함수의 pragma pack 값 %s이(가) 잘못되었습니다.", "겹치는 제한 지정자는 사용할 수 없습니다.", "소멸자의 제한 지정자는 모든 생성자에 대한 제한 지정자의 공용 구조체를 지정해야 합니다.", - "", + "오류", "nostdlib에는 한 번 이상의 강제 사용이 필요합니다.", - "", + "error-type", null, null, null, diff --git a/Extension/bin/messages/pl/messages.json b/Extension/bin/messages/pl/messages.json index e0757384f..0dac450c8 100644 --- a/Extension/bin/messages/pl/messages.json +++ b/Extension/bin/messages/pl/messages.json @@ -1410,7 +1410,7 @@ "tryb z ograniczeniami jest niezgodny z traktowaniem przestrzeni nazw std jako aliasu dla globalnej przestrzeni nazw", "w rozwinięciu makra „%s” %p", "", - "", + null, "[liczba niewyświetlanych rozwinięć makr: %d]", "w rozszerzeniu makra w położeniu %p", "nieprawidłowa nazwa symboliczna argumentu operacji %sq", @@ -1505,7 +1505,7 @@ "Błąd wiersza polecenia", "błąd wewnętrzny", "Błąd wewnętrzny", - null, + "-D", null, "Osiągnięto limit błędów.", "Pętla błędu wewnętrznego", @@ -1524,7 +1524,7 @@ "język pośredni (7)", "język pośredni (8)", "język pośredni (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "nieprawidłowy znak dla literału char16_t", null, "nierozpoznana konwencja wywoływania %s. Musi ona być jedną z następujących:", - null, + "%s", null, null, "typ bazowy typu wyliczenia musi być typem całkowitoliczbowym", @@ -2953,9 +2953,9 @@ "niedozwolona wartość dyrektywy pragma pack %s dla funkcji z ograniczeniem amp", "nakładające się specyfikatory ograniczenia są niedozwolone", "specyfikatory ograniczenia destruktora muszą obejmować unię specyfikatorów ograniczenia na wszystkich konstruktorach", - "", + "błąd", "element nostdlib wymaga co najmniej jednego wymuszonego użycia", - "", + "error-type", null, null, null, diff --git a/Extension/bin/messages/pt-br/messages.json b/Extension/bin/messages/pt-br/messages.json index 50ccf861c..d0749eccc 100644 --- a/Extension/bin/messages/pt-br/messages.json +++ b/Extension/bin/messages/pt-br/messages.json @@ -1410,7 +1410,7 @@ "o modo estrito é incompatível com o tratamento do namespace padrão como um alias para o namespace global", "na expansão da macro '%s' %p", "", - "", + null, "[ %d expansões de macro não mostradas ]", "na expansão da macro em %p", "nome de operando simbólico inválido %sq", @@ -1505,7 +1505,7 @@ "Erro de linha de comando", "erro interno", "Erro interno", - null, + "-D", null, "Limite de erro atingido.", "Laço de erro interno", @@ -1524,7 +1524,7 @@ "linguagem intermediária (7)", "linguagem intermediária (8)", "linguagem intermediária (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "caractere inválido para literal char16_t", null, "convenção de chamadas não reconhecida %s, deve ser um dos:", - null, + "%s", null, null, "o tipo subjacente da enumeração deve ser integral", @@ -2953,9 +2953,9 @@ "valor do pacote pragma %s ilícito para a função restrita por amp", "não é permitido sobrepor especificadores restritos", "os especificadores restritos do destruidor devem conter a união dos especificadores restritos em todos os construtores", - "", + "erro", "o nostdlib exige pelo menos um uso forçado", - "", + "tipo de erro", null, null, null, diff --git a/Extension/bin/messages/ru/messages.json b/Extension/bin/messages/ru/messages.json index e5a7a90da..ff6f4454d 100644 --- a/Extension/bin/messages/ru/messages.json +++ b/Extension/bin/messages/ru/messages.json @@ -1410,7 +1410,7 @@ "строгий режим несовместим с обработкой пространства имен std в качестве псевдонима для глобального пространства имен", "в расширении макроса \"%s\" %p", "<НЕТ ДАННЫХ>", - "", + null, "[ расширение макроса \"%d\" не показано ]", "в расширении макроса в %p", "недопустимое имя символьного операнда %sq", @@ -1505,7 +1505,7 @@ "Ошибка в командной строке", "внутренняя ошибка", "Внутренняя ошибка", - null, + "-D", null, "Достигнут предел ошибок.", "Внутренний цикл ошибки", @@ -1524,7 +1524,7 @@ "промежуточный язык (7)", "промежуточный язык (8)", "промежуточный язык (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "недопустимый знак для литерала char16_t", null, "нераспознанное соглашение о вызовах %s; необходимо использовать одно из следующих:", - null, + "%s", null, null, "базовый тип для перечисляемого типа должен быть целочисленным", @@ -2953,9 +2953,9 @@ "Недопустимое значение pragma pack %s для функции со спецификатором ограничения amp.", "перекрывающиеся описатели restrict запрещены", "описатели restrict деструктора должны охватывать объединение описателей restrict всех конструкторов", - "", + "ошибка", "для nostdlib требуется по меньшей мере одна директива forced using", - "", + "тип ошибки", null, null, null, diff --git a/Extension/bin/messages/tr/messages.json b/Extension/bin/messages/tr/messages.json index 7a55ab51b..a84368e92 100644 --- a/Extension/bin/messages/tr/messages.json +++ b/Extension/bin/messages/tr/messages.json @@ -1410,7 +1410,7 @@ "katı mod, std ad uzayının genel ad uzayı için bir diğer ad olarak değerlendirilmesi ile uyumsuz", "makro '%s' genişletilmesinde %p,", "", - "", + null, "[%d makro genişletmesi gösterilmiyor ]", "%p konumunda makro genişletmesinde", "geçersiz sembolik işlenen adı %sq", @@ -1505,7 +1505,7 @@ "Komut satırı hatası", "iç hata", "İç hata", - null, + "-D", null, "Hata sınırına ulaşıldı.", "İç hata döngüsü", @@ -1524,7 +1524,7 @@ "ara dil (7)", "ara dil (8)", "ara dil (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "char16_t sabit değeri için geçersiz karakter", null, "çağrı kuralı %s tanınmıyor, şunlardan biri olmalıdır:", - null, + "%s", null, null, "Sabit listesi türünün temel alınan türü bir tam sayı türü olmalıdır", @@ -2953,9 +2953,9 @@ "AMP ile sınırlı işlev için pragma paket değeri (%s) geçersiz", "örtüşen kısıtlama tanımlayıcılarına izin verilmiyor", "yıkıcının kısıtlama tanımlayıcıları, tüm oluşturuculardaki kısıtlama tanımlayıcılarının birleşimini kapsamalıdır", - "", + "hata", "nostdlib en az bir zorunlu kullanım gerektirir", - "", + "error-type", null, null, null, diff --git a/Extension/bin/messages/zh-cn/messages.json b/Extension/bin/messages/zh-cn/messages.json index af786d1e4..3def6317d 100644 --- a/Extension/bin/messages/zh-cn/messages.json +++ b/Extension/bin/messages/zh-cn/messages.json @@ -1410,7 +1410,7 @@ "严格模式与将命名空间标准视为全局命名空间的别名不兼容", "在宏“%s”%p 的扩展中", "<未知>", - "", + null, "[ %d 宏扩展未显示]", "在 %p 的宏扩展中", "符号操作数名称 %sq 无效", @@ -1505,7 +1505,7 @@ "命令行错误", "内部错误", "内部错误", - null, + "-D", null, "达到错误限制。", "内部错误循环", @@ -1524,7 +1524,7 @@ "中间语言(7)", "中间语言(8)", "中间语言(9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "char16_t 文本的无效字符", null, "无法识别的调用约定 %s,必须为以下内容之一:", - null, + "%s", null, null, "枚举类型的基础类型必须是整型", @@ -2953,9 +2953,9 @@ "受 AMP 限制的函数的 pragma 包值 %s 非法", "限制说明符不可重叠", "析构函数的限制说明符必须包含所有构造函数的限制说明符的联合部分", - "", + "错误", "nostdlib 要求至少使用一个强制 using", - "", + "error-type", null, null, null, diff --git a/Extension/bin/messages/zh-tw/messages.json b/Extension/bin/messages/zh-tw/messages.json index 7cf9f7d3a..5ab723beb 100644 --- a/Extension/bin/messages/zh-tw/messages.json +++ b/Extension/bin/messages/zh-tw/messages.json @@ -1410,7 +1410,7 @@ "strict 模式不相容,因為將命名空間 std 視為全域命名空間的別名", "在巨集 '%s' %p 的展開中", "<未知>", - "", + null, "[ 未顯示 %d 個巨集展開 ]", "在 %p 的巨集展開中", "無效的符號運算元名稱 %sq", @@ -1505,7 +1505,7 @@ "命令列錯誤", "內部錯誤", "內部錯誤", - null, + "-D", null, "已達錯誤限制。", "內部錯誤迴圈", @@ -1524,7 +1524,7 @@ "中繼語言 (7)", "中繼語言 (8)", "中繼語言 (9)", - null, + "PCH", null, null, null, @@ -1537,7 +1537,7 @@ "char16_t literal 的字元無效", null, "無法辨認的呼叫慣例 %s,必須是下列其中一個: ", - null, + "%s", null, null, "列舉類型的基礎類型必須是整數類型", @@ -2953,9 +2953,9 @@ "AMP 限制涵式中有不合法的 pragma 套件值 %s", "不允許重疊的限制指定名稱", "解構函式的限制規範必須涵蓋所有建構函式的限制規範聯集", - "", + "error", "nostdlib 至少需要一個強制 Using", - "", + "error-type", null, null, null, From 458ef304e8d4fbce2546f04e3c2dcb7c6bc47d0b Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson <49173979+Colengms@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:35:00 -0700 Subject: [PATCH 5/6] Rework custom config requests (#12727) --- Extension/src/LanguageServer/client.ts | 141 +++++++----------- .../src/LanguageServer/protocolFilter.ts | 4 +- 2 files changed, 51 insertions(+), 94 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 30d016d33..481aa9499 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -246,15 +246,6 @@ interface CompileCommandsPaths extends WorkspaceFolderParams { paths: string[]; } -interface QueryTranslationUnitSourceParams extends WorkspaceFolderParams { - uri: string; - ignoreExisting: boolean; -} - -interface QueryTranslationUnitSourceResult { - candidates: string[]; -} - interface GetDiagnosticsResult { diagnostics: string; } @@ -554,7 +545,6 @@ export interface ChatContextResult { const PreInitializationRequest: RequestType = new RequestType('cpptools/preinitialize'); const InitializationRequest: RequestType = new RequestType('cpptools/initialize'); const QueryCompilerDefaultsRequest: RequestType = new RequestType('cpptools/queryCompilerDefaults'); -const QueryTranslationUnitSourceRequest: RequestType = new RequestType('cpptools/queryTranslationUnitSource'); const SwitchHeaderSourceRequest: RequestType = new RequestType('cpptools/didSwitchHeaderSource'); const GetDiagnosticsRequest: RequestType = new RequestType('cpptools/getDiagnostics'); export const GetDocumentSymbolRequest: RequestType = new RequestType('cpptools/getDocumentSymbols'); @@ -744,7 +734,7 @@ export interface Client { onRegisterCustomConfigurationProvider(provider: CustomConfigurationProvider1): Thenable; updateCustomConfigurations(requestingProvider?: CustomConfigurationProvider1): Thenable; updateCustomBrowseConfiguration(requestingProvider?: CustomConfigurationProvider1): Thenable; - provideCustomConfiguration(docUri: vscode.Uri, requestFile?: string, replaceExisting?: boolean): Promise; + provideCustomConfiguration(docUri: vscode.Uri): Promise; logDiagnostics(): Promise; rescanFolder(): Promise; toggleReferenceResultsView(): void; @@ -1871,9 +1861,6 @@ export class DefaultClient implements Client { } await this.clearCustomConfigurations(); - await Promise.all([ - ...[...this.trackedDocuments].map(([_uri, document]) => this.provideCustomConfiguration(document.uri, undefined, true)) - ]); } public async updateCustomBrowseConfiguration(requestingProvider?: CustomConfigurationProvider1): Promise { @@ -2023,68 +2010,42 @@ export class DefaultClient implements Client { return this.languageClient.sendNotification(RescanFolderNotification); } - public async provideCustomConfiguration(docUri: vscode.Uri, requestFile?: string, replaceExisting?: boolean): Promise { + public async provideCustomConfiguration(docUri: vscode.Uri): Promise { const onFinished: () => void = () => { - if (requestFile) { - void this.languageClient.sendNotification(FinishedRequestCustomConfig, { uri: requestFile }); - } + void this.languageClient.sendNotification(FinishedRequestCustomConfig, { uri: docUri.toString() }); }; - const providerId: string | undefined = this.configurationProvider; - if (!providerId) { - onFinished(); - return; - } - const provider: CustomConfigurationProvider1 | undefined = getCustomConfigProviders().get(providerId); - if (!provider || !provider.isReady) { - onFinished(); - return; - } try { - DefaultClient.isStarted.reset(); - const resultCode = await this.provideCustomConfigurationAsync(docUri, requestFile, replaceExisting, provider); + const providerId: string | undefined = this.configurationProvider; + if (!providerId) { + return; + } + const provider: CustomConfigurationProvider1 | undefined = getCustomConfigProviders().get(providerId); + if (!provider || !provider.isReady) { + return; + } + const resultCode = await this.provideCustomConfigurationAsync(docUri, provider); telemetry.logLanguageServerEvent('provideCustomConfiguration', { providerId, resultCode }); } finally { onFinished(); - DefaultClient.isStarted.resolve(); } } - private async provideCustomConfigurationAsync(docUri: vscode.Uri, requestFile: string | undefined, replaceExisting: boolean | undefined, provider: CustomConfigurationProvider1): Promise { + private async provideCustomConfigurationAsync(docUri: vscode.Uri, provider: CustomConfigurationProvider1): Promise { const tokenSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource(); - const params: QueryTranslationUnitSourceParams = { - uri: docUri.toString(), - ignoreExisting: !!replaceExisting, - workspaceFolderUri: this.RootUri?.toString() - }; - - const response: QueryTranslationUnitSourceResult = await this.languageClient.sendRequest(QueryTranslationUnitSourceRequest, params); - if (!response.candidates || response.candidates.length === 0) { - // If we didn't receive any candidates, no configuration is needed. - return "noCandidates"; - } - // Need to loop through candidates, to see if we can get a custom configuration from any of them. // Wrap all lookups in a single task, so we can apply a timeout to the entire duration. const provideConfigurationAsync: () => Thenable = async () => { - const uris: vscode.Uri[] = []; - for (let i: number = 0; i < response.candidates.length; ++i) { - const candidate: string = response.candidates[i]; - const tuUri: vscode.Uri = vscode.Uri.parse(candidate); - try { - if (await provider.canProvideConfiguration(tuUri, tokenSource.token)) { - uris.push(tuUri); - } - } catch (err) { - console.warn("Caught exception from canProvideConfiguration"); + try { + if (!await provider.canProvideConfiguration(docUri, tokenSource.token)) { + return []; } - } - if (!uris.length) { - return []; + } catch (err) { + console.warn("Caught exception from canProvideConfiguration"); } let configs: util.Mutable[] = []; try { - configs = await provider.provideConfigurations(uris, tokenSource.token); + configs = await provider.provideConfigurations([docUri], tokenSource.token); } catch (err) { console.warn("Caught exception from provideConfigurations"); } @@ -2132,39 +2093,42 @@ export class DefaultClient implements Client { try { const configs: SourceFileConfigurationItem[] | undefined = await this.callTaskWithTimeout(provideConfigurationAsync, configProviderTimeout, tokenSource); if (configs && configs.length > 0) { - this.sendCustomConfigurations(configs, provider.version, requestFile !== undefined); + this.sendCustomConfigurations(configs, provider.version); } else { result = "noConfigurations"; } } catch (err) { result = "timeout"; - if (!requestFile) { - const settings: CppSettings = new CppSettings(this.RootUri); - if (settings.isConfigurationWarningsEnabled && !this.isExternalHeader(docUri) && !vscode.debug.activeDebugSession) { - const dismiss: string = localize("dismiss.button", "Dismiss"); - const disable: string = localize("disable.warnings.button", "Disable Warnings"); - const configName: string | undefined = this.configuration.CurrentConfiguration?.name; - if (!configName) { - return "noConfigName"; - } - let message: string = localize("unable.to.provide.configuration", - "{0} is unable to provide IntelliSense configuration information for '{1}'. Settings from the '{2}' configuration will be used instead.", - provider.name, docUri.fsPath, configName); - if (err) { - message += ` (${err})`; - } + const settings: CppSettings = new CppSettings(this.RootUri); + if (settings.isConfigurationWarningsEnabled && !this.isExternalHeader(docUri) && !vscode.debug.activeDebugSession) { + const dismiss: string = localize("dismiss.button", "Dismiss"); + const disable: string = localize("disable.warnings.button", "Disable Warnings"); + const configName: string | undefined = this.configuration.CurrentConfiguration?.name; + if (!configName) { + return "noConfigName"; + } + let message: string = localize("unable.to.provide.configuration", + "{0} is unable to provide IntelliSense configuration information for '{1}'. Settings from the '{2}' configuration will be used instead.", + provider.name, docUri.fsPath, configName); + if (err) { + message += ` (${err})`; + } - if (await vscode.window.showInformationMessage(message, dismiss, disable) === disable) { - settings.toggleSetting("configurationWarnings", "enabled", "disabled"); - } + if (await vscode.window.showInformationMessage(message, dismiss, disable) === disable) { + settings.toggleSetting("configurationWarnings", "enabled", "disabled"); } } } return result; } - private async handleRequestCustomConfig(requestFile: string): Promise { - await this.provideCustomConfiguration(vscode.Uri.file(requestFile), requestFile); + private handleRequestCustomConfig(file: string): void { + const uri: vscode.Uri = vscode.Uri.file(file); + const client: Client = clients.getClientFor(uri); + if (client instanceof DefaultClient) { + const defaultClient: DefaultClient = client as DefaultClient; + void defaultClient.provideCustomConfiguration(uri).catch(logAndReturn.undefined); + } } private isExternalHeader(uri: vscode.Uri): boolean { @@ -2386,13 +2350,7 @@ export class DefaultClient implements Client { this.languageClient.onNotification(CompileCommandsPathsNotification, (e) => void this.promptCompileCommands(e)); this.languageClient.onNotification(ReferencesNotification, (e) => this.processReferencesPreview(e)); this.languageClient.onNotification(ReportReferencesProgressNotification, (e) => this.handleReferencesProgress(e)); - this.languageClient.onNotification(RequestCustomConfig, (requestFile: string) => { - const client: Client = clients.getClientFor(vscode.Uri.file(requestFile)); - if (client instanceof DefaultClient) { - const defaultClient: DefaultClient = client as DefaultClient; - void defaultClient.handleRequestCustomConfig(requestFile); - } - }); + this.languageClient.onNotification(RequestCustomConfig, (e) => this.handleRequestCustomConfig(e)); this.languageClient.onNotification(IntelliSenseResultNotification, (e) => this.handleIntelliSenseResult(e)); this.languageClient.onNotification(PublishRefactorDiagnosticsNotification, publishRefactorDiagnostics); RegisterCodeAnalysisNotifications(this.languageClient); @@ -3078,7 +3036,7 @@ export class DefaultClient implements Client { util.isOptionalArrayOfString(input.configuration.forcedInclude); } - private sendCustomConfigurations(configs: any, providerVersion: Version, wasRequested: boolean): void { + private sendCustomConfigurations(configs: any, providerVersion: Version): void { // configs is marked as 'any' because it is untrusted data coming from a 3rd-party. We need to sanitize it before sending it to the language server. if (!configs || !(configs instanceof Array)) { console.warn("discarding invalid SourceFileConfigurationItems[]: " + configs); @@ -3144,9 +3102,10 @@ export class DefaultClient implements Client { workspaceFolderUri: this.RootUri?.toString() }; - if (wasRequested) { - void this.languageClient.sendNotification(CustomConfigurationHighPriorityNotification, params).catch(logAndReturn.undefined); - } + // We send the higher priority notification to ensure we don't deadlock if the request is blocking the queue. + // We send the normal priority notification to avoid a race that could result in a redundant request when racing with + // the reset of custom configurations. + void this.languageClient.sendNotification(CustomConfigurationHighPriorityNotification, params).catch(logAndReturn.undefined); void this.languageClient.sendNotification(CustomConfigurationNotification, params).catch(logAndReturn.undefined); } @@ -4092,7 +4051,7 @@ class NullClient implements Client { onRegisterCustomConfigurationProvider(provider: CustomConfigurationProvider1): Thenable { return Promise.resolve(); } updateCustomConfigurations(requestingProvider?: CustomConfigurationProvider1): Thenable { return Promise.resolve(); } updateCustomBrowseConfiguration(requestingProvider?: CustomConfigurationProvider1): Thenable { return Promise.resolve(); } - provideCustomConfiguration(docUri: vscode.Uri, requestFile?: string, replaceExisting?: boolean): Promise { return Promise.resolve(); } + provideCustomConfiguration(docUri: vscode.Uri): Promise { return Promise.resolve(); } logDiagnostics(): Promise { return Promise.resolve(); } rescanFolder(): Promise { return Promise.resolve(); } toggleReferenceResultsView(): void { } diff --git a/Extension/src/LanguageServer/protocolFilter.ts b/Extension/src/LanguageServer/protocolFilter.ts index 4bc3e45fe..742727241 100644 --- a/Extension/src/LanguageServer/protocolFilter.ts +++ b/Extension/src/LanguageServer/protocolFilter.ts @@ -43,7 +43,6 @@ export function createProtocolFilter(): Middleware { client.sendDidChangeSettings(); document = await vscode.languages.setTextDocumentLanguage(document, "cpp"); } - await client.provideCustomConfiguration(document.uri, undefined); // client.takeOwnership() will call client.TrackedDocuments.add() again, but that's ok. It's a Set. client.onDidOpenTextDocument(document); client.takeOwnership(document); @@ -52,8 +51,7 @@ export function createProtocolFilter(): Middleware { // For a file already open when we activate, sometimes we don't get any notifications about visible // or active text editors, visible ranges, or text selection. As a workaround, we trigger // onDidChangeVisibleTextEditors here, only for the first file opened. - if (!anyFileOpened) - { + if (!anyFileOpened) { anyFileOpened = true; const cppEditors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => util.isCpp(e.document)); await client.onDidChangeVisibleTextEditors(cppEditors); From e4ae0b7fdfe32c929353eac3b6be6e1db63bcd4c Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson <49173979+Colengms@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:50:29 -0700 Subject: [PATCH 6/6] Update version and changelog for 1.22.4 (#12733) --- Extension/CHANGELOG.md | 10 ++++++++++ Extension/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 5fd30556e..6366bcc56 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,15 @@ # C/C++ for Visual Studio Code Changelog +## Version 1.22.4: September 19, 2024 +### Enhancements +* Performance improvements related to how custom configurations are processed. [#12632](https://github.com/microsoft/vscode-cpptools/issues/12632) +* Performance improvements related to LSP request processing. + +### Bug Fixes +* Fix some crashes with recursive includes. [#12643](https://github.com/microsoft/vscode-cpptools/issues/12643) +* Possibly fix a crash in `find_existing_intellisense_client`. [#12666](https://github.com/microsoft/vscode-cpptools/issues/12666) +* Fix issues applying `files.exclude` settings when `C_Cpp.caseSensitiveFileSupport` is enabled. [#12672](https://github.com/microsoft/vscode-cpptools/issues/12672) + ## Version 1.22.3: September 12, 2024 ### Enhancement * Add support for providing additional context information to Copilot Chat. [PR #12685](https://github.com/microsoft/vscode-cpptools/pull/12685) diff --git a/Extension/package.json b/Extension/package.json index 664c5b6cb..81633633e 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2,7 +2,7 @@ "name": "cpptools", "displayName": "C/C++", "description": "C/C++ IntelliSense, debugging, and code browsing.", - "version": "1.22.3-main", + "version": "1.22.4-main", "publisher": "ms-vscode", "icon": "LanguageCCPP_color_128x.png", "readme": "README.md",