Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
Update changelog
Fix activation logic to handle windows arm64 (and cleanup older logic).
  • Loading branch information
auott committed Jul 20, 2021
1 parent e50ea7f commit a624d6f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* Update OmniSharp version to 1.37.13
* Update Roslyn to 4.0.0-2.21354.7 (PR: [omnisharp-roslyn#2189](https://github.com/OmniSharp/omnisharp-roslyn/pull/2189))
* Update included Build Tools to match .NET SDK 6 Preview 6 (PR: [omnisharp-roslyn#2187](https://github.com/OmniSharp/omnisharp-roslyn/pull/2187))
* Debugger changes:
* Added support for win10-arm64 debugging (PR: [#4672](https://github.com/OmniSharp/omnisharp-vscode/pull/4672))

## 1.23.13 (July 13th, 2021)
* Fixes Razor editing support (PR: [#4642](https://github.com/OmniSharp/omnisharp-vscode/pull/4642))
Expand Down
23 changes: 14 additions & 9 deletions src/coreclr-debug/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export async function activate(thisExtension: vscode.Extension<CSharpExtensionEx
_debugUtil = new CoreClrDebugUtil(context.extensionPath);

if (!CoreClrDebugUtil.existsSync(_debugUtil.debugAdapterDir())) {
let isInvalidArchitecture: boolean = await checkForInvalidArchitecture(platformInformation, eventStream);
if (!isInvalidArchitecture) {
let isValidArchitecture: boolean = await checkForInvalidArchitecture(platformInformation, eventStream);
if (!isValidArchitecture) {
eventStream.post(new DebuggerPrerequisiteFailure("[ERROR]: C# Extension failed to install the debugger package."));
showInstallErrorMessage(eventStream);
}
Expand All @@ -37,27 +37,32 @@ export async function activate(thisExtension: vscode.Extension<CSharpExtensionEx
context.subscriptions.push(vscode.debug.registerDebugAdapterDescriptorFactory('clr', factory));
}

async function checkForInvalidArchitecture(platformInformation: PlatformInformation, eventStream: EventStream): Promise<boolean> {
async function isValidArchitecture(platformInformation: PlatformInformation, eventStream: EventStream): Promise<boolean> {
if (platformInformation) {
if (platformInformation.isMacOS()) {
if (platformInformation.architecture === "arm64") {
eventStream.post(new DebuggerPrerequisiteWarning(`[WARNING]: arm64 macOS is not officially supported by the .NET Core debugger. You may experience unexpected issues when running in this configuration.`));
return false;
return true;
}

// Validate we are on compatiable macOS version if we are x86_64
if ((platformInformation.architecture !== "x86_64") ||
(platformInformation.architecture === "x86_64" && !CoreClrDebugUtil.isMacOSSupported())) {
eventStream.post(new DebuggerPrerequisiteFailure("[ERROR] The debugger cannot be installed. The debugger requires macOS 10.12 (Sierra) or newer."));
return true;
return false;
}

return true;
}
else if (platformInformation.architecture !== "x86_64") {
if (platformInformation.isWindows() && platformInformation.architecture === "x86") {
else if (platformInformation.isWindows()) {
if (platformInformation.architecture === "x86") {
eventStream.post(new DebuggerPrerequisiteWarning(`[WARNING]: x86 Windows is not currently supported by the .NET Core debugger. Debugging will not be available.`));
} else {
eventStream.post(new DebuggerPrerequisiteWarning(`[WARNING]: Processor architecture '${platformInformation.architecture}' is not currently supported by the .NET Core debugger. Debugging will not be available.`));
return false;
}

return true;
}
else {
return true;
}
}
Expand Down

0 comments on commit a624d6f

Please sign in to comment.