Skip to content

Commit 9ea7328

Browse files
authored
Fix bug: !err && stats && stats.isFile will always return true. Fix typos (#8897)
1 parent ef59264 commit 9ea7328

File tree

14 files changed

+27
-27
lines changed

14 files changed

+27
-27
lines changed

Extension/i18n/chs/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "缺少 lldb-mi 可执行文件的依赖项“{0}”。",
1818
"lldb.search.paths": "搜索范围:",
1919
"lldb.install.help": "要解决此问题,请通过 Apple App Store 安装 XCode,或通过在终端窗口运行“{0}”来安装 XCode 命令行工具。",
20-
"envfale.failed": "未能使用 {0}。原因: {1}",
20+
"envfile.failed": "未能使用 {0}。原因: {1}",
2121
"replacing.sourcepath": "正在将 {0}“{1}”替换为“{2}”。",
2222
"replacing.targetpath": "正在将 {0}“{1}”替换为“{2}”。",
2323
"replacing.editorPath": "正在将 {0}“{1}”替换为“{2}”。",

Extension/i18n/cht/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "缺少 lldb-mi 可執行檔的相依性 '{0}'。",
1818
"lldb.search.paths": "已在下列位置中搜尋:",
1919
"lldb.install.help": "若要解決此問題,請透過 Apple App Store 安裝 XCode,或在終端機視窗中執行 '{0}' 以安裝 XCode 命令列工具。",
20-
"envfale.failed": "無法使用 {0}。原因: {1}",
20+
"envfile.failed": "無法使用 {0}。原因: {1}",
2121
"replacing.sourcepath": "正在以 '{2}' 取代 {0} '{1}'。",
2222
"replacing.targetpath": "正在以 '{2}' 取代 {0} '{1}'。",
2323
"replacing.editorPath": "正在以 '{2}' 取代 {0} '{1}'。",

Extension/i18n/csy/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "Chybí závislosti {0} pro spustitelný soubor lldb-mi.",
1818
"lldb.search.paths": "Prohledáno:",
1919
"lldb.install.help": "Pokud chcete tento problém vyřešit, buď nainstalujte XCode přes obchod Apple App Store, nebo v okně terminálu spusťte {0}, aby se nainstalovaly nástroje příkazového řádku XCode.",
20-
"envfale.failed": "Nepovedlo se použít {0}. Příčina: {1}",
20+
"envfile.failed": "Nepovedlo se použít {0}. Příčina: {1}",
2121
"replacing.sourcepath": "{1} v {0} se nahrazuje za {2}.",
2222
"replacing.targetpath": "{1} v {0} se nahrazuje za {2}.",
2323
"replacing.editorPath": "Nahrazuje se {0} {1} za {2}.",

Extension/i18n/deu/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "Fehlende Abhängigkeit \"{0}\" für ausführbare LLDB-MI-Datei.",
1818
"lldb.search.paths": "Gesucht in:",
1919
"lldb.install.help": "Um dieses Problem zu beheben, installieren Sie entweder XCode über den Apple App Store, oder installieren Sie die XCode-Befehlszeilentools, indem Sie \"{0}\" in einem Terminalfenster ausführen.",
20-
"envfale.failed": "Fehler beim Verwenden von \"{0}\". Grund: {1}",
20+
"envfile.failed": "Fehler beim Verwenden von \"{0}\". Grund: {1}",
2121
"replacing.sourcepath": "{0} \"{1}\" wird durch \"{2}\" ersetzt.",
2222
"replacing.targetpath": "{0} \"{1}\" wird durch \"{2}\" ersetzt.",
2323
"replacing.editorPath": "{0} \"{1}\" wird durch \"{2}\" ersetzt.",

Extension/i18n/esn/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "Falta la dependencia \"{0}\" para el ejecutable lldb-mi.",
1818
"lldb.search.paths": "Buscado en:",
1919
"lldb.install.help": "Para resolver este problema, instale XCode mediante App Store de Apple o instale las herramientas de línea de comandos de XCode ejecutando \"{0}\" en una ventana de terminal.",
20-
"envfale.failed": "No se pudo usar {0}. Motivo: {1}",
20+
"envfile.failed": "No se pudo usar {0}. Motivo: {1}",
2121
"replacing.sourcepath": "Reemplazando {0} \"{1}\" por \"{2}\".",
2222
"replacing.targetpath": "Reemplazando {0} \"{1}\" por \"{2}\".",
2323
"replacing.editorPath": "Reemplazando el {0} \"{1}\" por \"{2}\".",

Extension/i18n/fra/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "La dépendance '{0}' est manquante pour l'exécutable lldb-mi.",
1818
"lldb.search.paths": "Recherche effectuée dans :",
1919
"lldb.install.help": "Pour résoudre ce problème, installez XCode via l'Apple App Store ou installez les outils en ligne de commande XCode en exécutant '{0}' dans une fenêtre de terminal.",
20-
"envfale.failed": "L'utilisation de {0} a échoué. Motif : {1}",
20+
"envfile.failed": "L'utilisation de {0} a échoué. Motif : {1}",
2121
"replacing.sourcepath": "Remplacement de {0} '{1}' par '{2}'.",
2222
"replacing.targetpath": "Remplacement de {0} '{1}' par '{2}'.",
2323
"replacing.editorPath": "Remplacement de {0} '{1}' par '{2}'.",

Extension/i18n/ita/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "Manca la dipendenza '{0}' per l'eseguibile lldb-mi.",
1818
"lldb.search.paths": "Ricerca effettuata in:",
1919
"lldb.install.help": "Per risolvere questo problema, installare Xcode tramite Apple App Store oppure installare gli strumenti da riga di comando di Xcode eseguendo '{0}' in una finestra di terminale.",
20-
"envfale.failed": "Non è stato possibile usare {0}. Motivo: {1}",
20+
"envfile.failed": "Non è stato possibile usare {0}. Motivo: {1}",
2121
"replacing.sourcepath": "Sostituzione di {0} '{1}' con '{2}'.",
2222
"replacing.targetpath": "Sostituzione di {0} '{1}' con '{2}'.",
2323
"replacing.editorPath": "Sostituzione di {0} '{1}' con '{2}'.",

Extension/i18n/jpn/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "lldb-mi 実行可能ファイルの依存関係 '{0}' が見つかりません。",
1818
"lldb.search.paths": "検索対象:",
1919
"lldb.install.help": "この問題を解決するには、Apple App Store から XCode をインストールするか、またはターミナル ウィンドウで '{0}' を実行して XCode コマンド ライン ツールをインストールしてください。",
20-
"envfale.failed": "{0} を使用できませんでした。理由: {1}",
20+
"envfile.failed": "{0} を使用できませんでした。理由: {1}",
2121
"replacing.sourcepath": "{0} '{1}' を '{2}' と置き換えています。",
2222
"replacing.targetpath": "{0} '{1}' を '{2}' と置き換えています。",
2323
"replacing.editorPath": "{0} の '{1}' を '{2}' と置き換えています。",

Extension/i18n/kor/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "lldb-mi 실행 파일에 대한 '{0}' 종속성이 없습니다.",
1818
"lldb.search.paths": "다음에서 검색됨:",
1919
"lldb.install.help": "이 문제를 해결하려면 Apple App Store를 통해 XCode를 설치하거나, 터미널 창에서 '{0}'을(를) 실행하여 XCode 명령줄 도구를 설치하세요.",
20-
"envfale.failed": "{0}을(를) 사용하지 못했습니다. 이유: {1}",
20+
"envfile.failed": "{0}을(를) 사용하지 못했습니다. 이유: {1}",
2121
"replacing.sourcepath": "{0} '{1}'을(를) '{2}'(으)로 바꾸는 중입니다.",
2222
"replacing.targetpath": "{0} '{1}'을(를) '{2}'(으)로 바꾸는 중입니다.",
2323
"replacing.editorPath": "{0} '{1}'을(를) '{2}'(으)로 바꾸는 중입니다.",

Extension/i18n/plk/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "Brak zależności „{0}” dla pliku wykonywalnego lldb-mi.",
1818
"lldb.search.paths": "Wyszukano w:",
1919
"lldb.install.help": "Aby rozwiązać ten problem, zainstaluj środowisko XCode za pośrednictwem sklepu Apple App Store lub zainstaluj narzędzia wiersza polecenia środowiska XCode, uruchamiając polecenie „{0}” w oknie terminala.",
20-
"envfale.failed": "Nie można użyć elementu {0}. Przyczyna: {1}",
20+
"envfile.failed": "Nie można użyć elementu {0}. Przyczyna: {1}",
2121
"replacing.sourcepath": "Zamienianie wartości zmiennej {0} z „{1}” na „{2}”.",
2222
"replacing.targetpath": "Zamienianie wartości zmiennej {0} z „{1}” na „{2}”.",
2323
"replacing.editorPath": "Zamienianie elementu {0} „{1}” na element „{2}”.",

Extension/i18n/ptb/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "Dependência ausente '{0}' no executável lldb-mi.",
1818
"lldb.search.paths": "Pesquisado em:",
1919
"lldb.install.help": "Para resolver esse problema, instale o XCode por meio da Apple App Store ou instale as Ferramentas de Linha de Comando do XCode executando '{0}' em uma janela de Terminal.",
20-
"envfale.failed": "Falha ao usar {0}. Motivo: {1}",
20+
"envfile.failed": "Falha ao usar {0}. Motivo: {1}",
2121
"replacing.sourcepath": "Substituindo {0} '{1}' por '{2}'.",
2222
"replacing.targetpath": "Substituindo {0} '{1}' por '{2}'.",
2323
"replacing.editorPath": "Substituindo '{1}' do {0} por '{2}'.",

Extension/i18n/rus/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "Отсутствует зависимость \"{0}\" для исполняемого файла lldb-mi.",
1818
"lldb.search.paths": "Поиск был выполнен в следующих расположениях:",
1919
"lldb.install.help": "Чтобы устранить эту проблему, установите XCode через Apple App Store или установите средства командной строки XCode, выполнив команду \"{0}\" в окне терминала.",
20-
"envfale.failed": "Не удалось использовать {0}. Причина: {1}",
20+
"envfile.failed": "Не удалось использовать {0}. Причина: {1}",
2121
"replacing.sourcepath": "Выполняется замена значения {0} с \"{1}\" на \"{2}\".",
2222
"replacing.targetpath": "Выполняется замена значения {0} с \"{1}\" на \"{2}\".",
2323
"replacing.editorPath": "Выполняется замена {0} \"{1}\" на \"{2}\".",

Extension/i18n/trk/src/Debugger/configurationProvider.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lldb.find.failed": "lldb-mi yürütülebilir dosyası için '{0}' bağımlılığı eksik.",
1818
"lldb.search.paths": "Şurada arandı:",
1919
"lldb.install.help": "Bu sorunu çözmek için, Apple App Store üzerinden XCode'u yükleyin ya da bir Terminal penceresinde '{0}' çalıştırarak XCode Komut Satırı Araçları'nı yükleyin.",
20-
"envfale.failed": "{0} kullanılamadı. Neden: {1}",
20+
"envfile.failed": "{0} kullanılamadı. Neden: {1}",
2121
"replacing.sourcepath": "{0} değişkeninin '{1}' olan değeri '{2}' olarak değiştiriliyor.",
2222
"replacing.targetpath": "{0} değişkeninin '{1}' olan değeri '{2}' olarak değiştiriliyor.",
2323
"replacing.editorPath": "'{1}' adlı {0}, '{2}' ile değiştiriliyor.",

Extension/src/Debugger/configurationProvider.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,20 @@ export class CppConfigurationProvider implements vscode.DebugConfigurationProvid
111111
private provider: IConfigurationAssetProvider;
112112
// Keep a list of tasks detected by cppBuildTaskProvider.
113113
private detectedBuildTasks: CppBuildTask[];
114-
protected static recentBuildTaskLable: string;
114+
protected static recentBuildTaskLabel: string;
115115

116116
public constructor(provider: IConfigurationAssetProvider, type: DebuggerType) {
117117
this.provider = provider;
118118
this.type = type;
119119
this.detectedBuildTasks = [];
120120
}
121121

122-
public static get recentBuildTaskLableStr(): string {
123-
return CppConfigurationProvider.recentBuildTaskLable;
122+
public static get recentBuildTaskLabelStr(): string {
123+
return CppConfigurationProvider.recentBuildTaskLabel;
124124
}
125125

126-
public static set recentBuildTaskLableStr(recentTask: string) {
127-
CppConfigurationProvider.recentBuildTaskLable = recentTask;
126+
public static set recentBuildTaskLabelStr(recentTask: string) {
127+
CppConfigurationProvider.recentBuildTaskLabel = recentTask;
128128
}
129129

130130
/**
@@ -205,7 +205,7 @@ export class CppConfigurationProvider implements vscode.DebugConfigurationProvid
205205
if (isMacARM64) {
206206
// Workaround to build and debug x86_64 on macARM64 by default.
207207
// Remove this workaround when native debugging for macARM64 is supported.
208-
newConfig.targetArchtecture = "x86_64";
208+
newConfig.targetArchitecture = "x86_64";
209209
}
210210
if (task.isDefault) {
211211
newConfig.isDefault = true;
@@ -247,7 +247,7 @@ export class CppConfigurationProvider implements vscode.DebugConfigurationProvid
247247
return resolve(newConfig);
248248
} else {
249249
fs.stat(debuggerPath, (err, stats: fs.Stats) => {
250-
if (!err && stats && stats.isFile) {
250+
if (!err && stats && stats.isFile()) {
251251
newConfig.miDebuggerPath = debuggerPath;
252252
} else {
253253
newConfig.miDebuggerPath = path.join("/usr", "bin", debuggerName);
@@ -436,7 +436,7 @@ export class CppConfigurationProvider implements vscode.DebugConfigurationProvid
436436
delete config.envFile;
437437
} catch (errJS) {
438438
const e: Error = errJS as Error;
439-
throw new Error(localize("envfale.failed", "Failed to use {0}. Reason: {1}", "envFile", e.message));
439+
throw new Error(localize("envfile.failed", "Failed to use {0}. Reason: {1}", "envFile", e.message));
440440
}
441441
}
442442
}
@@ -561,8 +561,8 @@ abstract class DefaultConfigurationProvider implements IConfigurationAssetProvid
561561
const completionItems: vscode.CompletionItem[] = [];
562562

563563
this.configurations.forEach(configuration => {
564-
completionItems.push(convertConfigurationSnippetToCompetionItem(configuration.GetLaunchConfiguration()));
565-
completionItems.push(convertConfigurationSnippetToCompetionItem(configuration.GetAttachConfiguration()));
564+
completionItems.push(convertConfigurationSnippetToCompletionItem(configuration.GetLaunchConfiguration()));
565+
completionItems.push(convertConfigurationSnippetToCompletionItem(configuration.GetAttachConfiguration()));
566566
});
567567

568568
return completionItems;
@@ -636,7 +636,7 @@ class LinuxConfigurationProvider extends DefaultConfigurationProvider {
636636
}
637637
}
638638

639-
function convertConfigurationSnippetToCompetionItem(snippet: IConfigurationSnippet): vscode.CompletionItem {
639+
function convertConfigurationSnippetToCompletionItem(snippet: IConfigurationSnippet): vscode.CompletionItem {
640640
const item: vscode.CompletionItem = new vscode.CompletionItem(snippet.label, vscode.CompletionItemKind.Snippet);
641641

642642
item.insertText = snippet.bodyText;
@@ -721,7 +721,7 @@ export async function buildAndDebug(textEditor: vscode.TextEditor, cppVsDbgProvi
721721
} else {
722722
let sortedItems: MenuItem[] = [];
723723
// Find the recently used task and place it at the top of quickpick list.
724-
const recentTask: MenuItem[] = items.filter(item => item.configuration.preLaunchTask === CppConfigurationProvider.recentBuildTaskLableStr);
724+
const recentTask: MenuItem[] = items.filter(item => item.configuration.preLaunchTask === CppConfigurationProvider.recentBuildTaskLabelStr);
725725
if (recentTask.length !== 0) {
726726
recentTask[0].detail = TaskConfigStatus.recentlyUsed;
727727
sortedItems.push(recentTask[0]);
@@ -748,11 +748,11 @@ export async function buildAndDebug(textEditor: vscode.TextEditor, cppVsDbgProvi
748748
try {
749749
if (folder) {
750750
await cppBuildTaskProvider.checkBuildTaskExists(selection.configuration.preLaunchTask);
751-
CppConfigurationProvider.recentBuildTaskLableStr = selection.configuration.preLaunchTask;
751+
CppConfigurationProvider.recentBuildTaskLabelStr = selection.configuration.preLaunchTask;
752752
} else {
753753
// In case of single mode file, remove the preLaunch task from the debug configuration and run it here instead.
754754
await cppBuildTaskProvider.runBuildTask(selection.configuration.preLaunchTask);
755-
CppConfigurationProvider.recentBuildTaskLableStr = selection.configuration.preLaunchTask;
755+
CppConfigurationProvider.recentBuildTaskLabelStr = selection.configuration.preLaunchTask;
756756
selection.configuration.preLaunchTask = undefined;
757757
}
758758
} catch (errJS) {

0 commit comments

Comments
 (0)