Skip to content

Fix bug: !err && stats && stats.isFile will always return true. Fix typos #8897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "缺少 lldb-mi 可执行文件的依赖项“{0}”。",
"lldb.search.paths": "搜索范围:",
"lldb.install.help": "要解决此问题,请通过 Apple App Store 安装 XCode,或通过在终端窗口运行“{0}”来安装 XCode 命令行工具。",
"envfale.failed": "未能使用 {0}。原因: {1}",
"envfile.failed": "未能使用 {0}。原因: {1}",
"replacing.sourcepath": "正在将 {0}“{1}”替换为“{2}”。",
"replacing.targetpath": "正在将 {0}“{1}”替换为“{2}”。",
"replacing.editorPath": "正在将 {0}“{1}”替换为“{2}”。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "缺少 lldb-mi 可執行檔的相依性 '{0}'。",
"lldb.search.paths": "已在下列位置中搜尋:",
"lldb.install.help": "若要解決此問題,請透過 Apple App Store 安裝 XCode,或在終端機視窗中執行 '{0}' 以安裝 XCode 命令列工具。",
"envfale.failed": "無法使用 {0}。原因: {1}",
"envfile.failed": "無法使用 {0}。原因: {1}",
"replacing.sourcepath": "正在以 '{2}' 取代 {0} '{1}'。",
"replacing.targetpath": "正在以 '{2}' 取代 {0} '{1}'。",
"replacing.editorPath": "正在以 '{2}' 取代 {0} '{1}'。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "Chybí závislosti {0} pro spustitelný soubor lldb-mi.",
"lldb.search.paths": "Prohledáno:",
"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.",
"envfale.failed": "Nepovedlo se použít {0}. Příčina: {1}",
"envfile.failed": "Nepovedlo se použít {0}. Příčina: {1}",
"replacing.sourcepath": "{1} v {0} se nahrazuje za {2}.",
"replacing.targetpath": "{1} v {0} se nahrazuje za {2}.",
"replacing.editorPath": "Nahrazuje se {0} {1} za {2}.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "Fehlende Abhängigkeit \"{0}\" für ausführbare LLDB-MI-Datei.",
"lldb.search.paths": "Gesucht in:",
"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.",
"envfale.failed": "Fehler beim Verwenden von \"{0}\". Grund: {1}",
"envfile.failed": "Fehler beim Verwenden von \"{0}\". Grund: {1}",
"replacing.sourcepath": "{0} \"{1}\" wird durch \"{2}\" ersetzt.",
"replacing.targetpath": "{0} \"{1}\" wird durch \"{2}\" ersetzt.",
"replacing.editorPath": "{0} \"{1}\" wird durch \"{2}\" ersetzt.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "Falta la dependencia \"{0}\" para el ejecutable lldb-mi.",
"lldb.search.paths": "Buscado en:",
"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.",
"envfale.failed": "No se pudo usar {0}. Motivo: {1}",
"envfile.failed": "No se pudo usar {0}. Motivo: {1}",
"replacing.sourcepath": "Reemplazando {0} \"{1}\" por \"{2}\".",
"replacing.targetpath": "Reemplazando {0} \"{1}\" por \"{2}\".",
"replacing.editorPath": "Reemplazando el {0} \"{1}\" por \"{2}\".",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "La dépendance '{0}' est manquante pour l'exécutable lldb-mi.",
"lldb.search.paths": "Recherche effectuée dans :",
"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.",
"envfale.failed": "L'utilisation de {0} a échoué. Motif : {1}",
"envfile.failed": "L'utilisation de {0} a échoué. Motif : {1}",
"replacing.sourcepath": "Remplacement de {0} '{1}' par '{2}'.",
"replacing.targetpath": "Remplacement de {0} '{1}' par '{2}'.",
"replacing.editorPath": "Remplacement de {0} '{1}' par '{2}'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "Manca la dipendenza '{0}' per l'eseguibile lldb-mi.",
"lldb.search.paths": "Ricerca effettuata in:",
"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.",
"envfale.failed": "Non è stato possibile usare {0}. Motivo: {1}",
"envfile.failed": "Non è stato possibile usare {0}. Motivo: {1}",
"replacing.sourcepath": "Sostituzione di {0} '{1}' con '{2}'.",
"replacing.targetpath": "Sostituzione di {0} '{1}' con '{2}'.",
"replacing.editorPath": "Sostituzione di {0} '{1}' con '{2}'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "lldb-mi 実行可能ファイルの依存関係 '{0}' が見つかりません。",
"lldb.search.paths": "検索対象:",
"lldb.install.help": "この問題を解決するには、Apple App Store から XCode をインストールするか、またはターミナル ウィンドウで '{0}' を実行して XCode コマンド ライン ツールをインストールしてください。",
"envfale.failed": "{0} を使用できませんでした。理由: {1}",
"envfile.failed": "{0} を使用できませんでした。理由: {1}",
"replacing.sourcepath": "{0} '{1}' を '{2}' と置き換えています。",
"replacing.targetpath": "{0} '{1}' を '{2}' と置き換えています。",
"replacing.editorPath": "{0} の '{1}' を '{2}' と置き換えています。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "lldb-mi 실행 파일에 대한 '{0}' 종속성이 없습니다.",
"lldb.search.paths": "다음에서 검색됨:",
"lldb.install.help": "이 문제를 해결하려면 Apple App Store를 통해 XCode를 설치하거나, 터미널 창에서 '{0}'을(를) 실행하여 XCode 명령줄 도구를 설치하세요.",
"envfale.failed": "{0}을(를) 사용하지 못했습니다. 이유: {1}",
"envfile.failed": "{0}을(를) 사용하지 못했습니다. 이유: {1}",
"replacing.sourcepath": "{0} '{1}'을(를) '{2}'(으)로 바꾸는 중입니다.",
"replacing.targetpath": "{0} '{1}'을(를) '{2}'(으)로 바꾸는 중입니다.",
"replacing.editorPath": "{0} '{1}'을(를) '{2}'(으)로 바꾸는 중입니다.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "Brak zależności „{0}” dla pliku wykonywalnego lldb-mi.",
"lldb.search.paths": "Wyszukano w:",
"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.",
"envfale.failed": "Nie można użyć elementu {0}. Przyczyna: {1}",
"envfile.failed": "Nie można użyć elementu {0}. Przyczyna: {1}",
"replacing.sourcepath": "Zamienianie wartości zmiennej {0} z „{1}” na „{2}”.",
"replacing.targetpath": "Zamienianie wartości zmiennej {0} z „{1}” na „{2}”.",
"replacing.editorPath": "Zamienianie elementu {0} „{1}” na element „{2}”.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "Dependência ausente '{0}' no executável lldb-mi.",
"lldb.search.paths": "Pesquisado em:",
"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.",
"envfale.failed": "Falha ao usar {0}. Motivo: {1}",
"envfile.failed": "Falha ao usar {0}. Motivo: {1}",
"replacing.sourcepath": "Substituindo {0} '{1}' por '{2}'.",
"replacing.targetpath": "Substituindo {0} '{1}' por '{2}'.",
"replacing.editorPath": "Substituindo '{1}' do {0} por '{2}'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "Отсутствует зависимость \"{0}\" для исполняемого файла lldb-mi.",
"lldb.search.paths": "Поиск был выполнен в следующих расположениях:",
"lldb.install.help": "Чтобы устранить эту проблему, установите XCode через Apple App Store или установите средства командной строки XCode, выполнив команду \"{0}\" в окне терминала.",
"envfale.failed": "Не удалось использовать {0}. Причина: {1}",
"envfile.failed": "Не удалось использовать {0}. Причина: {1}",
"replacing.sourcepath": "Выполняется замена значения {0} с \"{1}\" на \"{2}\".",
"replacing.targetpath": "Выполняется замена значения {0} с \"{1}\" на \"{2}\".",
"replacing.editorPath": "Выполняется замена {0} \"{1}\" на \"{2}\".",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lldb.find.failed": "lldb-mi yürütülebilir dosyası için '{0}' bağımlılığı eksik.",
"lldb.search.paths": "Şurada arandı:",
"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.",
"envfale.failed": "{0} kullanılamadı. Neden: {1}",
"envfile.failed": "{0} kullanılamadı. Neden: {1}",
"replacing.sourcepath": "{0} değişkeninin '{1}' olan değeri '{2}' olarak değiştiriliyor.",
"replacing.targetpath": "{0} değişkeninin '{1}' olan değeri '{2}' olarak değiştiriliyor.",
"replacing.editorPath": "'{1}' adlı {0}, '{2}' ile değiştiriliyor.",
Expand Down
28 changes: 14 additions & 14 deletions Extension/src/Debugger/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,20 @@ export class CppConfigurationProvider implements vscode.DebugConfigurationProvid
private provider: IConfigurationAssetProvider;
// Keep a list of tasks detected by cppBuildTaskProvider.
private detectedBuildTasks: CppBuildTask[];
protected static recentBuildTaskLable: string;
protected static recentBuildTaskLabel: string;

public constructor(provider: IConfigurationAssetProvider, type: DebuggerType) {
this.provider = provider;
this.type = type;
this.detectedBuildTasks = [];
}

public static get recentBuildTaskLableStr(): string {
return CppConfigurationProvider.recentBuildTaskLable;
public static get recentBuildTaskLabelStr(): string {
return CppConfigurationProvider.recentBuildTaskLabel;
}

public static set recentBuildTaskLableStr(recentTask: string) {
CppConfigurationProvider.recentBuildTaskLable = recentTask;
public static set recentBuildTaskLabelStr(recentTask: string) {
CppConfigurationProvider.recentBuildTaskLabel = recentTask;
}

/**
Expand Down Expand Up @@ -205,7 +205,7 @@ export class CppConfigurationProvider implements vscode.DebugConfigurationProvid
if (isMacARM64) {
// Workaround to build and debug x86_64 on macARM64 by default.
// Remove this workaround when native debugging for macARM64 is supported.
newConfig.targetArchtecture = "x86_64";
newConfig.targetArchitecture = "x86_64";
}
if (task.isDefault) {
newConfig.isDefault = true;
Expand Down Expand Up @@ -247,7 +247,7 @@ export class CppConfigurationProvider implements vscode.DebugConfigurationProvid
return resolve(newConfig);
} else {
fs.stat(debuggerPath, (err, stats: fs.Stats) => {
if (!err && stats && stats.isFile) {
if (!err && stats && stats.isFile()) {
newConfig.miDebuggerPath = debuggerPath;
} else {
newConfig.miDebuggerPath = path.join("/usr", "bin", debuggerName);
Expand Down Expand Up @@ -436,7 +436,7 @@ export class CppConfigurationProvider implements vscode.DebugConfigurationProvid
delete config.envFile;
} catch (errJS) {
const e: Error = errJS as Error;
throw new Error(localize("envfale.failed", "Failed to use {0}. Reason: {1}", "envFile", e.message));
throw new Error(localize("envfile.failed", "Failed to use {0}. Reason: {1}", "envFile", e.message));
}
}
}
Expand Down Expand Up @@ -561,8 +561,8 @@ abstract class DefaultConfigurationProvider implements IConfigurationAssetProvid
const completionItems: vscode.CompletionItem[] = [];

this.configurations.forEach(configuration => {
completionItems.push(convertConfigurationSnippetToCompetionItem(configuration.GetLaunchConfiguration()));
completionItems.push(convertConfigurationSnippetToCompetionItem(configuration.GetAttachConfiguration()));
completionItems.push(convertConfigurationSnippetToCompletionItem(configuration.GetLaunchConfiguration()));
completionItems.push(convertConfigurationSnippetToCompletionItem(configuration.GetAttachConfiguration()));
});

return completionItems;
Expand Down Expand Up @@ -636,7 +636,7 @@ class LinuxConfigurationProvider extends DefaultConfigurationProvider {
}
}

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

item.insertText = snippet.bodyText;
Expand Down Expand Up @@ -721,7 +721,7 @@ export async function buildAndDebug(textEditor: vscode.TextEditor, cppVsDbgProvi
} else {
let sortedItems: MenuItem[] = [];
// Find the recently used task and place it at the top of quickpick list.
const recentTask: MenuItem[] = items.filter(item => item.configuration.preLaunchTask === CppConfigurationProvider.recentBuildTaskLableStr);
const recentTask: MenuItem[] = items.filter(item => item.configuration.preLaunchTask === CppConfigurationProvider.recentBuildTaskLabelStr);
if (recentTask.length !== 0) {
recentTask[0].detail = TaskConfigStatus.recentlyUsed;
sortedItems.push(recentTask[0]);
Expand All @@ -748,11 +748,11 @@ export async function buildAndDebug(textEditor: vscode.TextEditor, cppVsDbgProvi
try {
if (folder) {
await cppBuildTaskProvider.checkBuildTaskExists(selection.configuration.preLaunchTask);
CppConfigurationProvider.recentBuildTaskLableStr = selection.configuration.preLaunchTask;
CppConfigurationProvider.recentBuildTaskLabelStr = selection.configuration.preLaunchTask;
} else {
// In case of single mode file, remove the preLaunch task from the debug configuration and run it here instead.
await cppBuildTaskProvider.runBuildTask(selection.configuration.preLaunchTask);
CppConfigurationProvider.recentBuildTaskLableStr = selection.configuration.preLaunchTask;
CppConfigurationProvider.recentBuildTaskLabelStr = selection.configuration.preLaunchTask;
selection.configuration.preLaunchTask = undefined;
}
} catch (errJS) {
Expand Down