diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index c39fad6869..a7a9667f8d 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,13 @@ # C/C++ for Visual Studio Code Change Log +## Version 1.3.0-insiders2: March 25, 2021 +## Bug Fixes +* Fix a spurious asterisk being inserted on a new line if the previous line starts with an asterisk. [#5733](https://github.com/microsoft/vscode-cpptools/issues/5733) +* Fix random crashes of cpptools-srv during shutdown. [#7161](https://github.com/microsoft/vscode-cpptools/issues/7161) +* Change `C_Cpp.autocompleteAddParentheses` to be false by default. [#7199](https://github.com/microsoft/vscode-cpptools/issues/7199) +* Fix auto add parentheses incorrectly occurring with template methods. [#7203](https://github.com/microsoft/vscode-cpptools/issues/7203) +* Fix auto adding parentheses incorrectly occurring with type names. [#7209](https://github.com/microsoft/vscode-cpptools/issues/7209) + ## Version 1.3.0-insiders: March 18, 2021 ## Enhancements * Add parentheses to function calls with autocomplete. [#882](https://github.com/microsoft/vscode-cpptools/issues/882) diff --git a/Extension/cpptools.json b/Extension/cpptools.json index 9e72e62ee3..881916b175 100644 --- a/Extension/cpptools.json +++ b/Extension/cpptools.json @@ -4,5 +4,5 @@ "recursiveIncludes": 100, "gotoDefIntelliSense": 100, "enhancedColorization": 100, - "minimumVSCodeVersion": "1.52.0" + "minimumVSCodeVersion": "1.53.0" } \ No newline at end of file diff --git a/Extension/i18n/chs/src/nativeStrings.i18n.json b/Extension/i18n/chs/src/nativeStrings.i18n.json index c16d5ad248..6a6946aa50 100644 --- a/Extension/i18n/chs/src/nativeStrings.i18n.json +++ b/Extension/i18n/chs/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "未能在路径 \"{0}\" 处查询编译器以获得默认标准版本。已对此编译器禁用编译器查询。", "unrecognized_language_standard_version": "编译器查询返回了无法识别的语言标准版本。将改用受支持的最新版本。", "intellisense_process_crash_detected": "检测到 IntelliSense 进程崩溃。", - "return_values_label": "Return values:" + "return_values_label": "返回值:" } \ No newline at end of file diff --git a/Extension/i18n/cht/src/nativeStrings.i18n.json b/Extension/i18n/cht/src/nativeStrings.i18n.json index 37bb355286..04156e0ce0 100644 --- a/Extension/i18n/cht/src/nativeStrings.i18n.json +++ b/Extension/i18n/cht/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "無法查詢位於路徑 \"{0}\" 的編譯器預設標準版本。已停用此編譯器的編譯器查詢。", "unrecognized_language_standard_version": "編譯器查詢傳回無法辨識的語言標準版本。將改用支援的最新版本。", "intellisense_process_crash_detected": "偵測到 IntelliSense 流程損毀。", - "return_values_label": "Return values:" + "return_values_label": "傳回值:" } \ No newline at end of file diff --git a/Extension/i18n/csy/src/nativeStrings.i18n.json b/Extension/i18n/csy/src/nativeStrings.i18n.json index 4479b5bd43..16e208f2c1 100644 --- a/Extension/i18n/csy/src/nativeStrings.i18n.json +++ b/Extension/i18n/csy/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "Nepovedlo se dotázat kompilátor na cestě {0} na výchozí standardní verze. Dotazování je pro tento kompilátor zakázané.", "unrecognized_language_standard_version": "Dotaz na kompilátor vrátil nerozpoznanou standardní verzi jazyka. Místo ní se použije nejnovější podporovaná verze.", "intellisense_process_crash_detected": "Zjistilo se chybové ukončení procesu IntelliSense.", - "return_values_label": "Return values:" + "return_values_label": "Návratové hodnoty:" } \ No newline at end of file diff --git a/Extension/i18n/deu/src/nativeStrings.i18n.json b/Extension/i18n/deu/src/nativeStrings.i18n.json index 00268ee13b..684a5cf314 100644 --- a/Extension/i18n/deu/src/nativeStrings.i18n.json +++ b/Extension/i18n/deu/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "Der Compiler im Pfad \"{0}\" konnte nicht nach standardmäßigen Standardversionen abgefragt werden. Die Compilerabfrage ist für diesen Compiler deaktiviert.", "unrecognized_language_standard_version": "Die Compilerabfrage hat eine unbekannte Sprachstandardversion zurückgegeben. Stattdessen wird die neueste unterstützte Version verwendet.", "intellisense_process_crash_detected": "IntelliSense-Prozessabsturz erkannt.", - "return_values_label": "Return values:" + "return_values_label": "Rückgabewerte:" } \ No newline at end of file diff --git a/Extension/i18n/esn/src/nativeStrings.i18n.json b/Extension/i18n/esn/src/nativeStrings.i18n.json index 723d86e0b1..aa08d62928 100644 --- a/Extension/i18n/esn/src/nativeStrings.i18n.json +++ b/Extension/i18n/esn/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "No se pudo consultar el compilador en la ruta de acceso \"{0}\" para las versiones estándar predeterminadas. La consulta del compilador está deshabilitada para este.", "unrecognized_language_standard_version": "La consulta del compilador devolvió una versión estándar del lenguaje no reconocida. En su lugar se usará la última versión admitida.", "intellisense_process_crash_detected": "Se ha detectado un bloqueo del proceso de IntelliSense.", - "return_values_label": "Return values:" + "return_values_label": "Valores devueltos:" } \ No newline at end of file diff --git a/Extension/i18n/fra/src/nativeStrings.i18n.json b/Extension/i18n/fra/src/nativeStrings.i18n.json index 16fbef7f73..b70509c019 100644 --- a/Extension/i18n/fra/src/nativeStrings.i18n.json +++ b/Extension/i18n/fra/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "Échec de l'interrogation du compilateur sur le chemin \"{0}\" pour les versions normalisées par défaut. L'interrogation du compilateur est désactivée pour ce compilateur.", "unrecognized_language_standard_version": "L'interrogation du compilateur a retourné une version de norme de langage non reconnue. La toute dernière version prise en charge va être utilisée à la place.", "intellisense_process_crash_detected": "Détection d'un plantage du processus IntelliSense.", - "return_values_label": "Return values:" + "return_values_label": "Valeurs de retour :" } \ No newline at end of file diff --git a/Extension/i18n/jpn/src/nativeStrings.i18n.json b/Extension/i18n/jpn/src/nativeStrings.i18n.json index 4254a34fdb..389729d02a 100644 --- a/Extension/i18n/jpn/src/nativeStrings.i18n.json +++ b/Extension/i18n/jpn/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "既定の標準バージョンのパス \"{0}\" でコンパイラをクエリできませんでした。このコンパイラでは、コンパイラのクエリが無効になっています。", "unrecognized_language_standard_version": "コンパイラ クエリにより、認識されない言語標準バージョンが返されました。代わりに、サポートされている最新のバージョンが使用されます。", "intellisense_process_crash_detected": "IntelliSense プロセスのクラッシュが検出されました。", - "return_values_label": "Return values:" + "return_values_label": "戻り値:" } \ No newline at end of file diff --git a/Extension/i18n/kor/src/nativeStrings.i18n.json b/Extension/i18n/kor/src/nativeStrings.i18n.json index 1cd9b21ebb..8bba410f32 100644 --- a/Extension/i18n/kor/src/nativeStrings.i18n.json +++ b/Extension/i18n/kor/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "기본 표준 버전에 대해 경로 \"{0}\"에서 컴파일러를 쿼리하지 못했습니다. 이 컴파일러에 대해서는 컴파일러 쿼리를 사용할 수 없습니다.", "unrecognized_language_standard_version": "컴파일러 쿼리에서 인식할 수 없는 언어 표준 버전을 반환했습니다. 지원되는 최신 버전이 대신 사용됩니다.", "intellisense_process_crash_detected": "IntelliSense 프로세스 크래시가 감지되었습니다.", - "return_values_label": "Return values:" + "return_values_label": "반환 값:" } \ No newline at end of file diff --git a/Extension/i18n/plk/src/nativeStrings.i18n.json b/Extension/i18n/plk/src/nativeStrings.i18n.json index b56d48edce..33dd562b4b 100644 --- a/Extension/i18n/plk/src/nativeStrings.i18n.json +++ b/Extension/i18n/plk/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "Nie można wykonać zapytań dotyczących kompilatora w ścieżce „{0}” dla domyślnych wersji standardowych. Wykonywanie zapytań dotyczących kompilatora jest wyłączone dla tego kompilatora.", "unrecognized_language_standard_version": "Zapytanie kompilatora zwróciło nierozpoznaną wersję standardu języka. Zamiast tego zostanie użyta najnowsza obsługiwana wersja.", "intellisense_process_crash_detected": "Wykryto awarię procesu funkcji IntelliSense.", - "return_values_label": "Return values:" + "return_values_label": "Wartości zwracane:" } \ No newline at end of file diff --git a/Extension/i18n/ptb/src/nativeStrings.i18n.json b/Extension/i18n/ptb/src/nativeStrings.i18n.json index 078ffffe47..317fa66afc 100644 --- a/Extension/i18n/ptb/src/nativeStrings.i18n.json +++ b/Extension/i18n/ptb/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "Falha ao consultar compilador no caminho \"{0}\" para as versões padrão. A consulta do compilador está desabilitada para este compilador.", "unrecognized_language_standard_version": "A consulta do compilador retornou uma versão do padrão de linguagem não reconhecida. Nesse caso, será usada a última versão com suporte.", "intellisense_process_crash_detected": "Falha detectada no processo do IntelliSense.", - "return_values_label": "Return values:" + "return_values_label": "Valores retornados:" } \ No newline at end of file diff --git a/Extension/i18n/rus/src/nativeStrings.i18n.json b/Extension/i18n/rus/src/nativeStrings.i18n.json index 670110c892..bc0fbb30a3 100644 --- a/Extension/i18n/rus/src/nativeStrings.i18n.json +++ b/Extension/i18n/rus/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "Не удалось запросить компилятор по пути \"{0}\" для стандартных версий по умолчанию. Запросы для этого компилятора отключены.", "unrecognized_language_standard_version": "Проба компилятора возвратила нераспознанную версию стандарта языка. Вместо этого будет использоваться последняя поддерживаемая версия.", "intellisense_process_crash_detected": "Обнаружен сбой процесса IntelliSense.", - "return_values_label": "Return values:" + "return_values_label": "Возвращаемые значения:" } \ No newline at end of file diff --git a/Extension/i18n/trk/package.i18n.json b/Extension/i18n/trk/package.i18n.json index e3e3908582..00aef41887 100644 --- a/Extension/i18n/trk/package.i18n.json +++ b/Extension/i18n/trk/package.i18n.json @@ -167,7 +167,7 @@ "c_cpp.configuration.vcpkg.enabled.markdownDescription": "[vcpkg bağımlılık yöneticisi](https://aka.ms/vcpkg/) için tümleştirme hizmetlerini etkinleştirin.", "c_cpp.configuration.addNodeAddonIncludePaths.description": "nan ve node-addon-api bağımlılık olduğunda bunlardan ekleme yolları ekleyin.", "c_cpp.configuration.renameRequiresIdentifier.description": "True ise, 'Sembolü Yeniden Adlandır' işlemi için geçerli bir C/C++ tanımlayıcısı gerekir.", - "c_cpp.configuration.autocompleteAddParentheses.description": "If true, autocomplete will automatically add \"(\" after function calls, in which case \")\" may also be added, depending on the value of the \"editor.autoClosingBrackets\" setting.", + "c_cpp.configuration.autocompleteAddParentheses.description": "True ise otomatik tamamla özelliği, işlev çağrılarından sonra otomatik olarak \"(\" ekler. Bazı durumlarda \"editor.autoClosingBrackets\" ayarının değerine bağlı olarak \")\" karakteri de eklenebilir.", "c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "True ise, hata ayıklayıcı kabuk komut değiştirme eski kesme işaretini (`) kullanır.", "c_cpp.contributes.views.cppReferencesView.title": "C/C++: Diğer başvuru sonuçları", "c_cpp.debuggers.pipeTransport.description": "Mevcut olduğunda, hata ayıklayıcısına, VS Code ile MI özellikli hata ayıklayıcısı arka uç yürütülebilir dosyası (gdb gibi) arasında standart giriş/çıkış geçişi sağlayan bir kanal olarak görev yapacak başka bir yürütülebilir dosya aracılığıyla uzak bilgisayara bağlanmasını söyler.", diff --git a/Extension/i18n/trk/src/nativeStrings.i18n.json b/Extension/i18n/trk/src/nativeStrings.i18n.json index 941f5b1007..42ae2aa927 100644 --- a/Extension/i18n/trk/src/nativeStrings.i18n.json +++ b/Extension/i18n/trk/src/nativeStrings.i18n.json @@ -207,5 +207,5 @@ "failed_to_query_for_standard_version": "Varsayılan standart sürümler için \"{0}\" yolundaki derleyici sorgulanamadı. Derleyici sorgulaması bu derleyici için devre dışı bırakıldı.", "unrecognized_language_standard_version": "Derleyici sorgusu, tanınmayan bir dil standardı sürümü döndürdü. Bunun yerine desteklenen en güncel sürüm kullanılacak.", "intellisense_process_crash_detected": "IntelliSense işlem kilitlenmesi saptandı.", - "return_values_label": "Return values:" + "return_values_label": "Dönüş değerleri:" } \ No newline at end of file diff --git a/Extension/package.json b/Extension/package.json index b9bc3c8bdf..2c8565816e 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -11,7 +11,7 @@ }, "license": "SEE LICENSE IN LICENSE.txt", "engines": { - "vscode": "^1.52.0" + "vscode": "^1.53.0" }, "bugs": { "url": "https://github.com/Microsoft/vscode-cpptools/issues", @@ -1160,7 +1160,7 @@ }, "C_Cpp.autocompleteAddParentheses": { "type": "boolean", - "default": true, + "default": false, "description": "%c_cpp.configuration.autocompleteAddParentheses.description%", "scope": "resource" } @@ -2409,7 +2409,7 @@ "@types/plist": "^3.0.2", "@types/semver": "^7.1.0", "@types/tmp": "^0.1.0", - "@types/vscode": "1.52.0", + "@types/vscode": "1.53.0", "@types/webpack": "^4.39.0", "@types/which": "^1.3.2", "@types/yauzl": "^2.9.1", diff --git a/Extension/src/LanguageServer/languageConfig.ts b/Extension/src/LanguageServer/languageConfig.ts index 92e40c8f7b..504518a844 100644 --- a/Extension/src/LanguageServer/languageConfig.ts +++ b/Extension/src/LanguageServer/languageConfig.ts @@ -18,6 +18,12 @@ export interface CommentPattern { continue: string; } +interface Rules { + begin: vscode.OnEnterRule[]; + continue: vscode.OnEnterRule[]; + end: vscode.OnEnterRule[]; +} + const escapeChars: RegExp = /[\\\^\$\*\+\?\{\}\(\)\.\!\=\|\[\]\ \/]/; // characters that should be escaped. // Insert '\\' in front of regexp escape chars. @@ -47,28 +53,25 @@ function getMLSplitAfterPattern(): string { return "^\\s*\\*\\/$"; } +function getMLPreviousLinePattern(insert: string): string | undefined { + if (insert.startsWith("/*")) { + return `\\A(?=^(\\s*(\\/\\*\\*|\\*)).*)(?=(?!(\\s*\\*\\/)))`; + } + return undefined; +} + function getMLContinuePattern(insert: string): string | undefined { if (insert) { const match: string = escape(insert.trimRight()); if (match) { const right: string = escape(insert.substr(insert.trimRight().length)); - return `^\\s*${match}(${right}([^\\*]|\\*(?!\\/))*)?$`; + return `^(\\t|[ ])*${match}(${right}([^\\*]|\\*(?!\\/))*)?$`; } // else: if the continuation is just whitespace, vscode already does indentation preservation. } return undefined; } -function getMLEndPattern(insert: string): string | undefined { - const match: string = escape(insert.trimRight().trimLeft()); - if (match) { - return `^\\s*${match}[^/]*\\*\\/\\s*$`; - } - // else: if the continuation is just whitespace, don't mess with indentation - // since we don't know if this is a continuation line or not. - return undefined; -} - function getMLEmptyEndPattern(insert: string): string | undefined { insert = insert.trimRight(); if (insert !== "") { @@ -76,7 +79,17 @@ function getMLEmptyEndPattern(insert: string): string | undefined { insert = insert.substr(0, insert.length - 1); } const match: string = escape(insert.trimRight()); - return `^\\s*${match}\\*\\/\\s*$`; + return `^(\\t|[ ])*${match}\\*\\/\\s*$`; + } + // else: if the continuation is just whitespace, don't mess with indentation + // since we don't know if this is a continuation line or not. + return undefined; +} + +function getMLEndPattern(insert: string): string | undefined { + const match: string = escape(insert.trimRight().trimLeft()); + if (match) { + return `^(\\t|[ ])*${match}[^/]*\\*\\/\\s*$`; } // else: if the continuation is just whitespace, don't mess with indentation // since we don't know if this is a continuation line or not. @@ -135,25 +148,29 @@ function getMLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule | undef // When Enter is pressed while the cursor is after the continuation pattern function getMLContinuationRule(comment: CommentPattern): vscode.OnEnterRule | undefined { - const continuePattern: string | undefined = getMLContinuePattern(comment.continue); - if (continuePattern) { - return { - beforeText: new RegExp(continuePattern), - action: { - indentAction: vscode.IndentAction.None, - appendText: comment.continue.trimLeft() - } - }; + const previousLinePattern: string | undefined = getMLPreviousLinePattern(comment.begin); + if (previousLinePattern) { + const beforePattern: string | undefined = getMLContinuePattern(comment.continue); + if (beforePattern) { + return { + beforeText: new RegExp(beforePattern), + previousLineText: new RegExp(previousLinePattern), + action: { + indentAction: vscode.IndentAction.None, + appendText: comment.continue.trimLeft() + } + }; + } } return undefined; } // When Enter is pressed while the cursor is after '*/' (and '*/' plus leading whitespace is all that is on the line) function getMLEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined { - const endPattern: string | undefined = getMLEndPattern(comment.continue); - if (endPattern) { + const beforePattern: string | undefined = getMLEndPattern(comment.continue); + if (beforePattern) { return { - beforeText: new RegExp(endPattern), + beforeText: new RegExp(beforePattern), action: { indentAction: vscode.IndentAction.None, removeText: comment.continue.length - comment.continue.trimLeft().length @@ -165,10 +182,10 @@ function getMLEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined { // When Enter is pressed while the cursor is after the continuation pattern and '*/' function getMLEmptyEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined { - const endPattern: string | undefined = getMLEmptyEndPattern(comment.continue); - if (endPattern) { + const beforePattern: string | undefined = getMLEmptyEndPattern(comment.continue); + if (beforePattern) { return { - beforeText: new RegExp(endPattern), + beforeText: new RegExp(beforePattern), action: { indentAction: vscode.IndentAction.None, removeText: comment.continue.length - comment.continue.trimLeft().length @@ -180,9 +197,9 @@ function getMLEmptyEndRule(comment: CommentPattern): vscode.OnEnterRule | undefi // When the continue rule is different than the begin rule for single line comments function getSLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule { - const continuePattern: string = getSLBeginPattern(comment.begin); + const beforePattern: string = getSLBeginPattern(comment.begin); return { - beforeText: new RegExp(continuePattern), + beforeText: new RegExp(beforePattern), action: { indentAction: vscode.IndentAction.None, appendText: comment.continue.trimLeft() @@ -192,9 +209,9 @@ function getSLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule { // When Enter is pressed while the cursor is after the continuation pattern plus at least one other character. function getSLContinuationRule(comment: CommentPattern): vscode.OnEnterRule { - const continuePattern: string = getSLContinuePattern(comment.continue); + const beforePattern: string = getSLContinuePattern(comment.continue); return { - beforeText: new RegExp(continuePattern), + beforeText: new RegExp(beforePattern), action: { indentAction: vscode.IndentAction.None, appendText: comment.continue.trimLeft() @@ -204,9 +221,9 @@ function getSLContinuationRule(comment: CommentPattern): vscode.OnEnterRule { // When Enter is pressed while the cursor is immediately after the continuation pattern function getSLEndRule(comment: CommentPattern): vscode.OnEnterRule { - const endPattern: string = getSLEndPattern(comment.continue); + const beforePattern: string = getSLEndPattern(comment.continue); return { - beforeText: new RegExp(endPattern), + beforeText: new RegExp(beforePattern), action: { indentAction: vscode.IndentAction.None, removeText: comment.continue.length - comment.continue.trimLeft().length @@ -214,12 +231,6 @@ function getSLEndRule(comment: CommentPattern): vscode.OnEnterRule { }; } -interface Rules { - begin: vscode.OnEnterRule[]; - continue: vscode.OnEnterRule[]; - end: vscode.OnEnterRule[]; -} - export function getLanguageConfig(languageId: string): vscode.LanguageConfiguration { const settings: CppSettings = new CppSettings(); const patterns: (string | CommentPattern)[] | undefined = settings.commentContinuationPatterns; diff --git a/Extension/test/integrationTests/languageServer/languageServer.integration.test.ts b/Extension/test/integrationTests/languageServer/languageServer.integration.test.ts index 4db0b6c09d..5323759400 100644 --- a/Extension/test/integrationTests/languageServer/languageServer.integration.test.ts +++ b/Extension/test/integrationTests/languageServer/languageServer.integration.test.ts @@ -16,26 +16,27 @@ suite("multiline comment setting tests", function(): void { await testHelpers.activateCppExtension(); }); - const defaultRules: vscode.OnEnterRule[] = [ - { + const defaultMLRules: vscode.OnEnterRule[] = [ + { // e.g. /** | */ beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, afterText: /^\s*\*\/$/, action: { indentAction: vscode.IndentAction.IndentOutdent, appendText: ' * ' } }, - { + { // e.g. /** ...| beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, action: { indentAction: vscode.IndentAction.None, appendText: ' * ' } }, - { - beforeText: /^\s*\ \*(\ ([^\*]|\*(?!\/))*)?$/, + { // e.g. * ...| + beforeText: /^(\t|[ ])*\ \*(\ ([^\*]|\*(?!\/))*)?$/, + previousLineText: /\A(?=^(\s*(\/\*\*|\*)).*)(?=(?!(\s*\*\/)))/, action: { indentAction: vscode.IndentAction.None, appendText: '* ' } }, - { - beforeText: /^\s*\*\/\s*$/, + { // e.g. */| + beforeText: /^(\t|[ ])*\*\/\s*$/, action: { indentAction: vscode.IndentAction.None, removeText: 1 } }, - { - beforeText: /^\s*\*[^/]*\*\/\s*$/, + { // e.g. *-----*/| + beforeText: /^(\t|[ ])*\*[^/]*\*\/\s*$/, action: { indentAction: vscode.IndentAction.None, removeText: 1 } } ]; @@ -52,27 +53,27 @@ suite("multiline comment setting tests", function(): void { test("Check the default OnEnterRules for C", () => { const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**" ]).onEnterRules; - assert.deepEqual(rules, defaultRules); + assert.deepStrictEqual(rules, defaultMLRules); }); test("Check for removal of single line comment continuations for C", () => { const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('c', [ "/**", "///" ]).onEnterRules; - assert.deepEqual(rules, defaultRules); + assert.deepStrictEqual(rules, defaultMLRules); }); test("Check the default OnEnterRules for C++", () => { const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**" ]).onEnterRules; - assert.deepEqual(rules, defaultRules); + assert.deepStrictEqual(rules, defaultMLRules); }); test("Make sure duplicate rules are removed", () => { const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "/**", { begin: "/**", continue: " * " }, "/**" ]).onEnterRules; - assert.deepEqual(rules, defaultRules); + assert.deepStrictEqual(rules, defaultMLRules); }); test("Check single line rules for C++", () => { const rules: vscode.OnEnterRule[] = getLanguageConfigFromPatterns('cpp', [ "///" ]).onEnterRules; - assert.deepEqual(rules, defaultSLRules); + assert.deepStrictEqual(rules, defaultSLRules); }); });