Skip to content

Commit 5d2400c

Browse files
authored
Merge branch 'master' into highlight-regex
2 parents c60a11f + 7095cda commit 5d2400c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1008
-427
lines changed

debugger-launchjson.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ The `symbolOptions` element allows customization of how the debugger searches fo
259259
"https://my-companies-symbols-server"
260260
],
261261
"searchMicrosoftSymbolServer": true,
262+
"searchNuGetOrgSymbolServer": true,
262263
"cachePath": "/symcache",
263264
"moduleFilter": {
264265
"mode": "loadAllButExcluded",
@@ -273,6 +274,8 @@ The `symbolOptions` element allows customization of how the debugger searches fo
273274

274275
**searchMicrosoftSymbolServer**: If `true` the Microsoft Symbol server (https://msdl.microsoft.com/download/symbols) is added to the symbols search path. If unspecified, this option defaults to `false`.
275276

277+
**searchNuGetOrgSymbolServer**: If `true` the Nuget.org Symbol server (https://symbols.nuget.org/download/symbols) is added to the symbols search path. If unspecified, this option defaults to `false`.
278+
276279
**cachePath**": Directory where symbols downloaded from symbol servers should be cached. If unspecified, on Windows the debugger will default to %TEMP%\\SymbolCache, and on Linux and macOS the debugger will default to ~/.dotnet/symbolcache.
277280

278281
**moduleFilter.mode**: This value is either `"loadAllButExcluded"` or `"loadOnlyIncluded"`. In `"loadAllButExcluded"` mode, the debugger loads symbols for all modules unless the module is in the 'excludedModules' array. In `"loadOnlyIncluded"` mode, the debugger will not attempt to load symbols for ANY module unless it is in the 'includedModules' array, or it is included through the 'includeSymbolsNextToModules' setting.

package.json

Lines changed: 156 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,30 @@
133133
"win32"
134134
],
135135
"architectures": [
136-
"x86",
137-
"arm64"
136+
"x86"
138137
],
139138
"installTestPath": "./.omnisharp/1.37.17/OmniSharp.exe",
140139
"platformId": "win-x86",
140+
"isFramework": true,
141141
"integrity": "95ECBABF821ED45E4E6F3173E2165C5F593FC4611040475DBD6D54C16D78F4F8"
142142
},
143+
{
144+
"id": "OmniSharp",
145+
"description": "OmniSharp for Windows (.NET 6 / x86)",
146+
"url": null,
147+
"fallbackUrl": null,
148+
"installPath": null,
149+
"platforms": [
150+
"win32"
151+
],
152+
"architectures": [
153+
"x86"
154+
],
155+
"installTestPath": null,
156+
"platformId": "win-x86",
157+
"isFramework": false,
158+
"integrity": null
159+
},
143160
{
144161
"id": "OmniSharp",
145162
"description": "OmniSharp for Windows (.NET 4.6 / x64)",
@@ -154,11 +171,63 @@
154171
],
155172
"installTestPath": "./.omnisharp/1.37.17/OmniSharp.exe",
156173
"platformId": "win-x64",
174+
"isFramework": true,
175+
"integrity": "BD81F1284FA4A9E6D63292074D0304B65CD39C24539CB761B54E8727619070DF"
176+
},
177+
{
178+
"id": "OmniSharp",
179+
"description": "OmniSharp for Windows (.NET 6 / x64)",
180+
"url": null,
181+
"fallbackUrl": null,
182+
"installPath": null,
183+
"platforms": [
184+
"win32"
185+
],
186+
"architectures": [
187+
"x86_64"
188+
],
189+
"installTestPath": null,
190+
"platformId": "win-x64",
191+
"isFramework": false,
192+
"integrity": null
193+
},
194+
{
195+
"id": "OmniSharp",
196+
"description": "OmniSharp for Windows (.NET 4.6 / arm64)",
197+
"url": "https://download.visualstudio.microsoft.com/download/pr/47df6cf8-7648-4fff-9e9c-304f0202d31c/c868258dbd98f22b60154552f432edfa/omnisharp-win-x64-1.37.17.zip",
198+
"fallbackUrl": "https://roslynomnisharp.blob.core.windows.net/releases/1.37.17/omnisharp-win-x64-1.37.17.zip",
199+
"installPath": ".omnisharp/1.37.17",
200+
"platforms": [
201+
"win32"
202+
],
203+
"architectures": [
204+
"arm64"
205+
],
206+
"installTestPath": "./.omnisharp/1.37.17/OmniSharp.exe",
207+
"platformId": "win-arm64",
208+
"isFramework": true,
157209
"integrity": "BD81F1284FA4A9E6D63292074D0304B65CD39C24539CB761B54E8727619070DF"
158210
},
159211
{
160212
"id": "OmniSharp",
161-
"description": "OmniSharp for OSX",
213+
"description": "OmniSharp for Windows (.NET 6 / arm64)",
214+
"url": null,
215+
"fallbackUrl": null,
216+
"installPath": null,
217+
"platforms": [
218+
"win32"
219+
],
220+
"architectures": [
221+
"arm64"
222+
],
223+
"installTestPath": null,
224+
"platformId": "win-arm64",
225+
"isFramework": false,
226+
"integrity": null
227+
},
228+
{
229+
"id": "OmniSharp",
230+
"description": "OmniSharp for OSX (Mono / x64)",
162231
"url": "https://download.visualstudio.microsoft.com/download/pr/47df6cf8-7648-4fff-9e9c-304f0202d31c/9f560aead2b823079775c00110972c04/omnisharp-osx-1.37.17.zip",
163232
"fallbackUrl": "https://roslynomnisharp.blob.core.windows.net/releases/1.37.17/omnisharp-osx-1.37.17.zip",
164233
"installPath": ".omnisharp/1.37.17",
@@ -171,11 +240,52 @@
171240
],
172241
"installTestPath": "./.omnisharp/1.37.17/run",
173242
"platformId": "osx",
243+
"isFramework": true,
174244
"integrity": "43D6B18F390B8ED92231044E87413831E565E9AB5938223B19CA97B3628DDDF4"
175245
},
176246
{
177247
"id": "OmniSharp",
178-
"description": "OmniSharp for Linux (x86)",
248+
"description": "OmniSharp for OSX (.NET 6 / x64)",
249+
"url": null,
250+
"fallbackUrl": null,
251+
"installPath": null,
252+
"platforms": [
253+
"darwin"
254+
],
255+
"architectures": [
256+
"x86_64"
257+
],
258+
"binaries": [
259+
"OmniSharp"
260+
],
261+
"installTestPath": null,
262+
"platformId": "osx-x64",
263+
"isFramework": false,
264+
"integrity": null
265+
},
266+
{
267+
"id": "OmniSharp",
268+
"description": "OmniSharp for OSX (.NET 6 / arm64)",
269+
"url": null,
270+
"fallbackUrl": null,
271+
"installPath": null,
272+
"platforms": [
273+
"darwin"
274+
],
275+
"architectures": [
276+
"arm64"
277+
],
278+
"binaries": [
279+
"OmniSharp"
280+
],
281+
"installTestPath": null,
282+
"platformId": "osx-arm64",
283+
"isFramework": false,
284+
"integrity": null
285+
},
286+
{
287+
"id": "OmniSharp",
288+
"description": "OmniSharp for Linux (Mono / x86)",
179289
"url": "https://download.visualstudio.microsoft.com/download/pr/47df6cf8-7648-4fff-9e9c-304f0202d31c/6f3d66d4ffa4fa627225221fb00e106e/omnisharp-linux-x86-1.37.17.zip",
180290
"fallbackUrl": "https://roslynomnisharp.blob.core.windows.net/releases/1.37.17/omnisharp-linux-x86-1.37.17.zip",
181291
"installPath": ".omnisharp/1.37.17",
@@ -192,11 +302,12 @@
192302
],
193303
"installTestPath": "./.omnisharp/1.37.17/run",
194304
"platformId": "linux-x86",
305+
"isFramework": true,
195306
"integrity": "75676E50D9FB62B9DC20A6A10E65420B54EFE2FFAE80AC21F59A4C483A4902BB"
196307
},
197308
{
198309
"id": "OmniSharp",
199-
"description": "OmniSharp for Linux (x64)",
310+
"description": "OmniSharp for Linux (Mono / x64)",
200311
"url": "https://download.visualstudio.microsoft.com/download/pr/47df6cf8-7648-4fff-9e9c-304f0202d31c/6cf1b92d91f942929922013b2139cca9/omnisharp-linux-x64-1.37.17.zip",
201312
"fallbackUrl": "https://roslynomnisharp.blob.core.windows.net/releases/1.37.17/omnisharp-linux-x64-1.37.17.zip",
202313
"installPath": ".omnisharp/1.37.17",
@@ -212,11 +323,32 @@
212323
],
213324
"installTestPath": "./.omnisharp/1.37.17/run",
214325
"platformId": "linux-x64",
326+
"isFramework": true,
215327
"integrity": "34276181B4C1F9968AFA10DEC058F6A2D79DE362FA01B565A04E879CA84A74FE"
216328
},
217329
{
218330
"id": "OmniSharp",
219-
"description": "OmniSharp for Linux (arm64)",
331+
"description": "OmniSharp for Linux (.NET 6 / x64)",
332+
"url": null,
333+
"fallbackUrl": null,
334+
"installPath": null,
335+
"platforms": [
336+
"linux"
337+
],
338+
"architectures": [
339+
"x86_64"
340+
],
341+
"binaries": [
342+
"OmniSharp"
343+
],
344+
"installTestPath": null,
345+
"platformId": "linux-x64",
346+
"isFramework": false,
347+
"integrity": null
348+
},
349+
{
350+
"id": "OmniSharp",
351+
"description": "OmniSharp for Linux (Framework / arm64)",
220352
"url": null,
221353
"fallbackUrl": null,
222354
"installPath": null,
@@ -232,7 +364,8 @@
232364
],
233365
"installTestPath": null,
234366
"platformId": "linux-arm64",
235-
"integrity": null
367+
"integrity": null,
368+
"isFramework": true
236369
},
237370
{
238371
"id": "Debugger",
@@ -742,6 +875,13 @@
742875
"scope": "machine",
743876
"description": "Specifies the path to OmniSharp. When left empty the OmniSharp version pinned to the C# Extension is used. This can be the absolute path to an OmniSharp executable, a specific version number, or \"latest\". If a version number or \"latest\" is specified, the appropriate version of OmniSharp will be downloaded on your behalf. Setting \"latest\" is an opt-in into latest beta releases of OmniSharp."
744877
},
878+
"omnisharp.useModernNet": {
879+
"type": "boolean",
880+
"default": false,
881+
"scope": "window",
882+
"title": "Use .NET 6 build of OmniSharp (experimental)",
883+
"description": "Use OmniSharp build for .NET 6. This version _does not_ support non-SDK-style .NET Framework projects, including Unity. SDK-style Framework, .NET Core, and .NET 5+ projects should see significant performance improvements, but there may still be bugs. Please open issues if you find any bugs."
884+
},
745885
"omnisharp.useGlobalMono": {
746886
"type": "string",
747887
"default": "auto",
@@ -766,6 +906,15 @@
766906
"scope": "machine",
767907
"description": "Specifies the path to a mono installation to use when \"useGlobalMono\" is set to \"always\", instead of the default system one. Example: \"/Library/Frameworks/Mono.framework/Versions/Current\""
768908
},
909+
"omnisharp.dotnetPath": {
910+
"type": [
911+
"string",
912+
"null"
913+
],
914+
"default": null,
915+
"scope": "window",
916+
"description": "Specified the path to a dotnet installation to use when \"useModernNet\" is set to true, instead of the default system one. Example: \"/home/username/mycustomdotnetdirectory\"."
917+
},
769918
"omnisharp.waitForDebugger": {
770919
"type": "boolean",
771920
"default": false,

snippets/csharp.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,13 @@
302302
],
303303
"description": "Namespace"
304304
},
305+
"FileScopedNamespace": {
306+
"prefix": "fsnamespace",
307+
"body": [
308+
"namespace ${1:Name};"
309+
],
310+
"description": "File-scoped namespace"
311+
},
305312
"#if": {
306313
"prefix": "ifd",
307314
"body": [

src/assets.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,14 @@ export class AssetGenerator {
267267
private createWatchTaskDescription(): tasks.TaskDescription {
268268
let commandArgs = ['watch', 'run'];
269269

270-
this.AddAdditionalCommandArgs(commandArgs);
270+
const buildProject = this.getBuildProjectPath();
271+
if (buildProject) {
272+
commandArgs.push('--project');
273+
commandArgs.push(buildProject);
274+
}
275+
276+
// NOTE: Don't add any additional args, or this will disable hot reload. See:
277+
// https://github.com/dotnet/sdk/blob/957ae5ca599fdeaee425d23928d42da711373a5e/src/BuiltInTools/dotnet-watch/Program.cs#L247-L256
271278

272279
return {
273280
label: 'watch',
@@ -279,17 +286,26 @@ export class AssetGenerator {
279286
}
280287

281288
private AddAdditionalCommandArgs(commandArgs: string[]) {
289+
const buildProject = this.getBuildProjectPath();
290+
if (buildProject) {
291+
commandArgs.push(buildProject);
292+
}
293+
294+
commandArgs.push("/property:GenerateFullPaths=true");
295+
commandArgs.push("/consoleloggerparameters:NoSummary");
296+
}
297+
298+
private getBuildProjectPath() : string|null {
282299
let buildProject = this.startupProject;
283300
if (!buildProject) {
284301
buildProject = this.fallbackBuildProject;
285302
}
286303
if (buildProject) {
287304
const buildPath = path.join('${workspaceFolder}', path.relative(this.workspaceFolder.uri.fsPath, buildProject.Path));
288-
commandArgs.push(util.convertNativePathToPosix(buildPath));
305+
return util.convertNativePathToPosix(buildPath);
289306
}
290307

291-
commandArgs.push("/property:GenerateFullPaths=true");
292-
commandArgs.push("/consoleloggerparameters:NoSummary");
308+
return null;
293309
}
294310

295311
public createTasksConfiguration(): tasks.TaskConfiguration {

src/constants/MonoInformation.ts renamed to src/constants/HostExecutableInformation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
export interface MonoInformation {
6+
export interface HostExecutableInformation {
77
version: string;
88
path: string;
99
env: NodeJS.ProcessEnv;

src/constants/IMonoResolver.ts renamed to src/constants/IHostExecutableResolver.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { Options } from "../omnisharp/options";
7-
import { MonoInformation } from "./MonoInformation";
7+
import { HostExecutableInformation } from "./HostExecutableInformation";
88

9-
export interface IMonoResolver {
10-
getGlobalMonoInfo(options: Options): Promise<MonoInformation>;
11-
}
9+
export interface IHostExecutableResolver {
10+
getHostExecutableInfo(options: Options): Promise<HostExecutableInformation>;
11+
}

src/features/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import { PlatformInformation } from '../platform';
1919
import CompositeDisposable from '../CompositeDisposable';
2020
import OptionProvider from '../observers/OptionProvider';
2121
import reportIssue from './reportIssue';
22-
import { IMonoResolver } from '../constants/IMonoResolver';
22+
import { IHostExecutableResolver } from '../constants/IHostExecutableResolver';
2323
import { getDotnetInfo } from '../utils/getDotnetInfo';
2424
import { getDecompilationAuthorization, resetDecompilationAuthorization } from '../omnisharp/decompilationPrompt';
2525

26-
export default function registerCommands(context: vscode.ExtensionContext, server: OmniSharpServer, platformInfo: PlatformInformation, eventStream: EventStream, optionProvider: OptionProvider, monoResolver: IMonoResolver, packageJSON: any, extensionPath: string): CompositeDisposable {
26+
export default function registerCommands(context: vscode.ExtensionContext, server: OmniSharpServer, platformInfo: PlatformInformation, eventStream: EventStream, optionProvider: OptionProvider, monoResolver: IHostExecutableResolver, packageJSON: any, extensionPath: string): CompositeDisposable {
2727
let disposable = new CompositeDisposable();
2828
disposable.add(vscode.commands.registerCommand('o.restart', async () => restartOmniSharp(context, server, optionProvider)));
2929
disposable.add(vscode.commands.registerCommand('o.pickProjectAndStart', async () => pickProjectAndStart(server, optionProvider)));

src/features/reportIssue.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import { CSharpExtensionId } from "../constants/CSharpExtensionId";
99
import { EventStream } from "../EventStream";
1010
import { OpenURL } from "../omnisharp/loggingEvents";
1111
import { Options } from "../omnisharp/options";
12-
import { IMonoResolver } from "../constants/IMonoResolver";
12+
import { IHostExecutableResolver } from "../constants/IHostExecutableResolver";
1313
import { IGetDotnetInfo } from "../constants/IGetDotnetInfo";
1414

1515
const issuesUrl = "https://github.com/OmniSharp/omnisharp-vscode/issues/new";
1616

17-
export default async function reportIssue(vscode: vscode, eventStream: EventStream, getDotnetInfo: IGetDotnetInfo, isValidPlatformForMono: boolean, options: Options, monoResolver: IMonoResolver) {
17+
export default async function reportIssue(vscode: vscode, eventStream: EventStream, getDotnetInfo: IGetDotnetInfo, isValidPlatformForMono: boolean, options: Options, monoResolver: IHostExecutableResolver) {
1818
const dotnetInfo = await getDotnetInfo();
1919
const monoInfo = await getMonoIfPlatformValid(isValidPlatformForMono, options, monoResolver);
2020
let extensions = getInstalledExtensions(vscode);
@@ -81,11 +81,11 @@ ${tableHeader}\n${table};
8181
return extensionTable;
8282
}
8383

84-
async function getMonoIfPlatformValid(isValidPlatformForMono: boolean, options: Options, monoResolver: IMonoResolver): Promise<string> {
84+
async function getMonoIfPlatformValid(isValidPlatformForMono: boolean, options: Options, monoResolver: IHostExecutableResolver): Promise<string> {
8585
if (isValidPlatformForMono) {
8686
let monoVersion: string;
8787
try {
88-
let globalMonoInfo = await monoResolver.getGlobalMonoInfo(options);
88+
let globalMonoInfo = await monoResolver.getHostExecutableInfo(options);
8989
if (globalMonoInfo) {
9090
monoVersion = `OmniSharp using global mono :${globalMonoInfo.version}`;
9191
}
@@ -116,4 +116,4 @@ function getInstalledExtensions(vscode: vscode) {
116116
function getCsharpExtensionVersion(vscode: vscode): string {
117117
const extension = vscode.extensions.getExtension(CSharpExtensionId);
118118
return extension.packageJSON.version;
119-
}
119+
}

0 commit comments

Comments
 (0)