Skip to content

Commit d787290

Browse files
committed
Rename id and provide try catch
1 parent 0468a8b commit d787290

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

src/coreclr-debug/activate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ export async function getAdapterExecutionCommand(platformInfo: PlatformInformati
133133
installLock = await common.installFileExists(debuggerPackage.installPath, common.InstallFileType.Lock);
134134
}
135135

136-
//todo: check if the debugger install.lock is present
137136
if (!installLock) {
138137
eventStream.post(new DebuggerNotInstalledFailure());
139138
throw new Error('The C# extension is still downloading packages. Please see progress in the output window below.');

src/packageManager/AbsolutePathPackage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { IPackage } from "./IPackage";
88
import { AbsolutePath } from "./AbsolutePath";
99

1010
export class AbsolutePathPackage implements IPackage{
11-
constructor(public Id: string,
11+
constructor(public id: string,
1212
public description: string,
1313
public url: string,
1414
public platforms: string[],
@@ -22,7 +22,7 @@ export class AbsolutePathPackage implements IPackage{
2222

2323
public static getAbsolutePathPackage(pkg: Package, extensionPath: string) {
2424
return new AbsolutePathPackage(
25-
pkg.Id,
25+
pkg.id,
2626
pkg.description,
2727
pkg.url,
2828
pkg.platforms,

src/packageManager/IPackage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
export interface IPackage {
7-
Id: string;
7+
id: string;
88
description: string;
99
url: string;
1010
fallbackUrl?: string;

src/packageManager/PackageManager.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { EventStream } from '../EventStream';
1313
import { NetworkSettingsProvider } from "../NetworkSettings";
1414
import { filterPackages } from "./PackageFilterer";
1515
import { AbsolutePathPackage } from "./AbsolutePathPackage";
16-
import { touchInstallFile, InstallFileType, deleteInstallFile } from "../common";
16+
import { touchInstallFile, InstallFileType, deleteInstallFile, installFileExists } from "../common";
1717
import { InstallationFailure } from "../omnisharp/loggingEvents";
1818
import { mkdirpSync } from "fs-extra";
1919

@@ -46,7 +46,12 @@ export async function DownloadAndInstallPackages(packages: Package[], provider:
4646
}
4747
}
4848
finally {
49-
await deleteInstallFile(pkg.installPath, InstallFileType.Begin);
49+
try {
50+
if (installFileExists(pkg.installPath, InstallFileType.Begin)) {
51+
await deleteInstallFile(pkg.installPath, InstallFileType.Begin);
52+
}
53+
}
54+
catch (error) { }
5055
}
5156
}
5257
}

src/tools/GetRuntimeDependencyWithId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ export function getRuntimeDependencyPackageWithId(packageId: string, packageJSON
1212
let runtimeDependencies = GetRunTimeDependenciesPackages(packageJSON);
1313
let absolutePathPackages = runtimeDependencies.map(pkg => AbsolutePathPackage.getAbsolutePathPackage(pkg, extensionPath));
1414
let platformSpecificPackage = filterPlatformPackages(absolutePathPackages, platformInfo);
15-
return platformSpecificPackage.find(pkg => pkg.Id == packageId);
15+
return platformSpecificPackage.find(pkg => pkg.id == packageId);
1616
}

0 commit comments

Comments
 (0)