Skip to content

Commit c60a11f

Browse files
authored
Merge branch 'master' into highlight-regex
2 parents cba7893 + 5103f49 commit c60a11f

File tree

7 files changed

+51
-16
lines changed

7 files changed

+51
-16
lines changed

debugger-launchjson.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,17 @@ To disable Source Link for all URLs, use `"sourceLinkOptions": { "*": { "enabled
309309
If multiple entries cover the same URL, the more specific entry (the entry with the longer string length) will be used.
310310

311311
Currently Source Link only works for source files that can be accessed without authentication. So, for example, the debugger can download source files from open source projects on GitHub, but it cannot download from private GitHub repos, or from Visual Studio Team Services.
312+
313+
## Target Architecture options (macOS M1)
314+
315+
.NET on Apple M1 supports both x86_64 and ARM64. When debugging, the architecture of the process the debugger is attaching to and the debugger must match. If they do not match, it may result in `Unknown Error: 0x80131c3c`.
316+
317+
The extension will try to resolve `targetArchitecture` based on the output of `dotnet --info` in the PATH, else it will try to use the same architecture as VS Code.
318+
319+
You can override this behavior by setting `targetArchitecture` in your `launch.json`.
320+
321+
Example:
322+
323+
```json
324+
"targetArchitecture": "arm64"
325+
```

package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,10 @@
659659
"description": "When true (the default state), the debugger will attempt faster evaluation by simulating execution of simple properties and methods.",
660660
"default": true
661661
},
662+
"targetArchitecture": {
663+
"type": "string",
664+
"description": "[Only supported in local macOS debugging] The architecture of the debuggee. This will automatically be detected unless this parameter is set. Allowed values are x86_64 or arm64."
665+
},
662666
"type": {
663667
"type": "string",
664668
"enum": [
@@ -2113,6 +2117,10 @@
21132117
"type": "boolean",
21142118
"description": "When true (the default state), the debugger will attempt faster evaluation by simulating execution of simple properties and methods.",
21152119
"default": true
2120+
},
2121+
"targetArchitecture": {
2122+
"type": "string",
2123+
"description": "[Only supported in local macOS debugging] The architecture of the debuggee. This will automatically be detected unless this parameter is set. Allowed values are x86_64 or arm64."
21162124
}
21172125
}
21182126
}
@@ -3236,6 +3244,10 @@
32363244
"type": "boolean",
32373245
"description": "When true (the default state), the debugger will attempt faster evaluation by simulating execution of simple properties and methods.",
32383246
"default": true
3247+
},
3248+
"targetArchitecture": {
3249+
"type": "string",
3250+
"description": "[Only supported in local macOS debugging] The architecture of the debuggee. This will automatically be detected unless this parameter is set. Allowed values are x86_64 or arm64."
32393251
}
32403252
}
32413253
}
@@ -3815,7 +3827,10 @@
38153827
"mimetypes": [
38163828
"text/x-cshtml"
38173829
],
3818-
"configuration": "./src/razor/language-configuration.json"
3830+
"configuration": "./src/razor/language-configuration.json",
3831+
"aliases": [
3832+
"ASP.NET Razor"
3833+
]
38193834
}
38203835
],
38213836
"grammars": [
@@ -3871,4 +3886,4 @@
38713886
}
38723887
]
38733888
}
3874-
}
3889+
}

src/omnisharp/launcher.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ export interface LaunchTarget {
3030
description: string;
3131
directory: string;
3232
target: string;
33-
kind: LaunchTargetKind;
33+
workspaceKind: LaunchTargetKind;
3434
}
3535

3636
export const vslsTarget: LaunchTarget = {
3737
label: "VSLS",
3838
description: "Visual Studio Live Share",
3939
directory: "",
4040
target: "",
41-
kind: LaunchTargetKind.LiveShare
41+
workspaceKind: LaunchTargetKind.LiveShare
4242
};
4343

4444
/** Live share scheme */
@@ -144,7 +144,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
144144
description: vscode.workspace.asRelativePath(dirname),
145145
target: resource.fsPath,
146146
directory: path.dirname(resource.fsPath),
147-
kind: LaunchTargetKind.Solution
147+
workspaceKind: LaunchTargetKind.Solution
148148
});
149149
}
150150
// Add project.json files
@@ -156,7 +156,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
156156
description: vscode.workspace.asRelativePath(dirname),
157157
target: dirname,
158158
directory: dirname,
159-
kind: LaunchTargetKind.ProjectJson
159+
workspaceKind: LaunchTargetKind.ProjectJson
160160
});
161161
}
162162
// Add .csproj files
@@ -170,7 +170,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
170170
description: vscode.workspace.asRelativePath(dirname),
171171
target: dirname,
172172
directory: dirname,
173-
kind: LaunchTargetKind.Project
173+
workspaceKind: LaunchTargetKind.Project
174174
});
175175
}
176176
else {
@@ -198,7 +198,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
198198
description: 'All contained projects',
199199
target: folderPath,
200200
directory: folderPath,
201-
kind: LaunchTargetKind.Folder
201+
workspaceKind: LaunchTargetKind.Folder
202202
});
203203
}
204204

@@ -209,7 +209,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
209209
description: path.basename(folderPath),
210210
target: folderPath,
211211
directory: folderPath,
212-
kind: LaunchTargetKind.Csx
212+
workspaceKind: LaunchTargetKind.Csx
213213
});
214214
}
215215

@@ -220,7 +220,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
220220
description: path.basename(folderPath),
221221
target: folderPath,
222222
directory: folderPath,
223-
kind: LaunchTargetKind.Cake
223+
workspaceKind: LaunchTargetKind.Cake
224224
});
225225
}
226226

@@ -230,7 +230,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
230230
description: '',
231231
target: folderPath,
232232
directory: folderPath,
233-
kind: LaunchTargetKind.Folder
233+
workspaceKind: LaunchTargetKind.Folder
234234
});
235235
}
236236
});

src/omnisharp/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export class OmniSharpServer {
256256
return;
257257
}
258258

259-
if (launchTarget.kind === LaunchTargetKind.LiveShare) {
259+
if (launchTarget.workspaceKind === LaunchTargetKind.LiveShare) {
260260
this.eventStream.post(new ObservableEvents.OmnisharpServerMessage("During Live Share sessions language services are provided by the Live Share server."));
261261
return;
262262
}
@@ -562,7 +562,7 @@ export class OmniSharpServer {
562562
// To maintain previous behavior when there are mulitple targets available,
563563
// launch with first Solution or Folder target.
564564
const firstFolderOrSolutionTarget = launchTargets
565-
.find(target => target.kind == LaunchTargetKind.Folder || target.kind == LaunchTargetKind.Solution);
565+
.find(target => target.workspaceKind == LaunchTargetKind.Folder || target.workspaceKind == LaunchTargetKind.Solution);
566566
if (firstFolderOrSolutionTarget) {
567567
return this.restart(firstFolderOrSolutionTarget);
568568
}

src/tools/OptionsSchema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,10 @@
491491
"type": "boolean",
492492
"description": "When true (the default state), the debugger will attempt faster evaluation by simulating execution of simple properties and methods.",
493493
"default": true
494+
},
495+
"targetArchitecture": {
496+
"type": "string",
497+
"description": "[Only supported in local macOS debugging] The architecture of the debuggee. This will automatically be detected unless this parameter is set. Allowed values are x86_64 or arm64."
494498
}
495499
}
496500
},

test/integrationTests/launcher.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ suite(`launcher:`, () => {
4747

4848
const launchTargets = resourcesAndFolderMapToLaunchTargets(testResources, workspaceFolders, folderMap);
4949

50-
const solutionTarget = launchTargets.find(target => target.kind === LaunchTargetKind.Solution && target.label === "test.sln");
50+
const solutionTarget = launchTargets.find(target => target.workspaceKind === LaunchTargetKind.Solution && target.label === "test.sln");
5151
assert.exists(solutionTarget, "Launch targets did not include `/test.sln`");
5252

53-
const projectTarget = launchTargets.find(target => target.kind === LaunchTargetKind.Project && target.label === "test.csproj");
53+
const projectTarget = launchTargets.find(target => target.workspaceKind === LaunchTargetKind.Project && target.label === "test.csproj");
5454
assert.exists(projectTarget, "Launch targets did not include `/test/test.csproj`");
5555
});
5656
});

webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ const config = {
1818
},
1919
devtool: 'source-map',
2020
externals: {
21-
vscode: "commonjs vscode" // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
21+
vscode: "commonjs vscode", // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
22+
'applicationinsights-native-metrics': 'commonjs applicationinsights-native-metrics', // we're not native
23+
'@opentelemetry/tracing': 'commonjs @opentelemetry/tracing', // optional
2224
},
2325
resolve: { // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
2426
extensions: ['.ts', '.js']

0 commit comments

Comments
 (0)