Skip to content

Commit 58c234d

Browse files
Merge pull request #1598 from OmniSharp/master
Merge master into release
2 parents 67d2bc1 + e1be046 commit 58c234d

File tree

7 files changed

+62
-24
lines changed

7 files changed

+62
-24
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
* There currently is no completion support for package references in csproj files. ([#1156](https://github.com/OmniSharp/omnisharp-vscode/issues/1156))
55
* .NET Core SDK 2.0-preview2 is not yet supported. ([#1495](https://github.com/OmniSharp/omnisharp-vscode/issues/1495))
66

7+
## 1.11.0 _(Not Yet Released)_
8+
9+
#### Completion List
10+
11+
* No longer trigger completion when a '<' character is typed. ([#1521](https://github.com/OmniSharp/omnisharp-vscode/issues/1521), PR: [#1530](https://github.com/OmniSharp/omnisharp-vscode/pull/1530))
12+
* Completion list no longer triggers on space in contexts where a lambda expression could be typed. ([#1524](https://github.com/OmniSharp/omnisharp-vscode/issues/1524), PR: [#1548](https://github.com/OmniSharp/omnisharp-vscode/pull/1548))
13+
14+
#### Other Updates and Fixes
15+
16+
* Allow the ".NET: Restore Packages" command to run on projects targeting full framework. ([#1507](https://github.com/OmniSharp/omnisharp-vscode/pull/1507), PR: [#1545](https://github.com/OmniSharp/omnisharp-vscode/pull/1545)) _(contributed by [@adamhartford](https://github.com/adamhartford))_
17+
718
## 1.10.0 (May 25, 2017)
819

920
#### Completion List
@@ -40,6 +51,7 @@
4051
* Added `csharp.unitTestDebugingOptions` setting to pass launch.json-style debug options (example: `justMyCode`) when unit test debugging.
4152

4253
#### Debugger
54+
4355
* Resolves crash on OSX when the target process loads an embedded PDB ([#1456](https://github.com/OmniSharp/omnisharp-vscode/issues/1456)). This commonly affects users trying to debug XUnit tests.
4456
* Enhanced exception peek display to provide additional exception properties.
4557

package.json

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "csharp",
33
"publisher": "ms-vscode",
4-
"version": "1.10.0",
4+
"version": "1.11.0-beta4",
55
"description": "C# for Visual Studio Code (powered by OmniSharp).",
66
"displayName": "C#",
77
"author": "Microsoft Corporation",
@@ -68,7 +68,8 @@
6868
"runtimeDependencies": [
6969
{
7070
"description": "Mono Runtime (Linux / x86)",
71-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86-4.8.0.478.zip",
71+
"url": "https://omnisharpdownload.azureedge.net/ext/mono.linux-x86-5.2.0-omnisharp1.zip",
72+
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86-5.2.0-omnisharp1.zip",
7273
"installPath": "./bin",
7374
"platforms": [
7475
"linux"
@@ -84,7 +85,8 @@
8485
},
8586
{
8687
"description": "Mono Runtime (Linux / x64)",
87-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86_64-4.8.0.478.zip",
88+
"url": "https://omnisharpdownload.azureedge.net/ext/mono.linux-x86_64-5.2.0-omnisharp1.zip",
89+
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86_64-5.2.0-omnisharp1.zip",
8890
"installPath": "./bin",
8991
"platforms": [
9092
"linux"
@@ -100,7 +102,8 @@
100102
},
101103
{
102104
"description": "Mono Runtime (macOS)",
103-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.osx-4.8.0.478.zip",
105+
"url": "https://omnisharpdownload.azureedge.net/ext/mono.osx-5.2.0-omnisharp1.zip",
106+
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/mono.osx-5.2.0-omnisharp1.zip",
104107
"installPath": "./bin",
105108
"platforms": [
106109
"darwin"
@@ -113,7 +116,8 @@
113116
},
114117
{
115118
"description": "Mono Framework Assemblies",
116-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/framework-4.8.0.478.zip",
119+
"url": "https://omnisharpdownload.azureedge.net/ext/framework-5.2.0-omnisharp1.zip",
120+
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/framework-5.2.0-omnisharp1.zip",
117121
"installPath": "./bin/framework",
118122
"platforms": [
119123
"darwin",
@@ -123,7 +127,8 @@
123127
},
124128
{
125129
"description": "OmniSharp (.NET 4.6 / x86)",
126-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.19.1.zip",
130+
"url": "https://omnisharpdownload.azureedge.net/ext/omnisharp-win-x86-1.21.0.zip",
131+
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.21.0.zip",
127132
"installPath": "./bin/omnisharp",
128133
"platforms": [
129134
"win32"
@@ -135,7 +140,8 @@
135140
},
136141
{
137142
"description": "OmniSharp (.NET 4.6 / x64)",
138-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.19.1.zip",
143+
"url": "https://omnisharpdownload.azureedge.net/ext/omnisharp-win-x64-1.21.0.zip",
144+
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.21.0.zip",
139145
"installPath": "./bin/omnisharp",
140146
"platforms": [
141147
"win32"
@@ -147,7 +153,8 @@
147153
},
148154
{
149155
"description": "OmniSharp (Mono 4.6)",
150-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-mono-1.19.1.zip",
156+
"url": "https://omnisharpdownload.azureedge.net/ext/omnisharp-mono-1.21.0.zip",
157+
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-mono-1.21.0.zip",
151158
"installPath": "./bin/omnisharp",
152159
"platforms": [
153160
"darwin",
@@ -360,7 +367,7 @@
360367
],
361368
"description": "If the current Linux distribution is not recognized, this option can be used to tell the debugger what version can be used. After changing this option, close VS Code, remove the debugger folder (~/.vscode/extensions/ms-vscode.csharp-<ver>/.debugger) if it has already downloaded, and restart VS Code."
362369
},
363-
"csharp.unitTestDebugingOptions": {
370+
"csharp.unitTestDebuggingOptions": {
364371
"type": "object",
365372
"description": "Options to use with the debugger when launching for unit test debugging. Any launch.json option is valid here.",
366373
"default": {},
@@ -401,7 +408,7 @@
401408
"debugServer": {
402409
"type": "number",
403410
"description": "For debug extension development only: if a port is specified VS Code tries to connect to a debug adapter running in server mode",
404-
"default": 4711
411+
"default": 4711
405412
},
406413
"logging": {
407414
"description": "Optional flags to determine what types of messages should be logged to the output window.",
@@ -444,9 +451,9 @@
444451
"description": "Suppress the notification window to perform a 'dotnet restore' when dependencies can't be resolved."
445452
},
446453
"csharp.suppressHiddenDiagnostics": {
447-
"type": "boolean",
448-
"default": true,
449-
"description": "Suppress 'hidden' diagnostics (such as 'unnecessary using directives') from appearing in the editor or the Problems pane."
454+
"type": "boolean",
455+
"default": true,
456+
"description": "Suppress 'hidden' diagnostics (such as 'unnecessary using directives') from appearing in the editor or the Problems pane."
450457
},
451458
"omnisharp.path": {
452459
"type": [
@@ -2271,4 +2278,4 @@
22712278
}
22722279
]
22732280
}
2274-
}
2281+
}

src/features/completionItemProvider.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ import {CompletionItemProvider, CompletionItem, CompletionItemKind, Cancellation
1515
export default class OmniSharpCompletionItemProvider extends AbstractSupport implements CompletionItemProvider {
1616

1717
// copied from Roslyn here: https://github.com/dotnet/roslyn/blob/6e8f6d600b6c4bc0b92bc3d782a9e0b07e1c9f8e/src/Features/Core/Portable/Completion/CompletionRules.cs#L166-L169
18-
private static DefaultCommitCharacters = [
18+
private static AllCommitCharacters = [
1919
' ', '{', '}', '[', ']', '(', ')', '.', ',', ':',
2020
';', '+', '-', '*', '/', '%', '&', '|', '^', '!',
2121
'~', '=', '<', '>', '?', '@', '#', '\'', '\"', '\\'];
22+
23+
private static CommitCharactersWithoutSpace = [
24+
'{', '}', '[', ']', '(', ')', '.', ',', ':',
25+
';', '+', '-', '*', '/', '%', '&', '|', '^', '!',
26+
'~', '=', '<', '>', '?', '@', '#', '\'', '\"', '\\'];
2227

2328
public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Promise<CompletionItem[]> {
2429

@@ -55,7 +60,10 @@ export default class OmniSharpCompletionItemProvider extends AbstractSupport imp
5560
completion.documentation = extractSummaryText(response.Description);
5661
completion.kind = _kinds[response.Kind] || CompletionItemKind.Property;
5762
completion.insertText = response.CompletionText.replace(/<>/g, '');
58-
completion.commitCharacters = OmniSharpCompletionItemProvider.DefaultCommitCharacters;
63+
64+
completion.commitCharacters = response.IsSuggestionMode
65+
? OmniSharpCompletionItemProvider.CommitCharactersWithoutSpace
66+
: OmniSharpCompletionItemProvider.AllCommitCharacters;
5967

6068
let array = completions[completion.label];
6169
if (!array) {

src/features/dotnetTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function runDotnetTest(testMethod: string, fileName: string, testFramewor
100100
}
101101

102102
function createLaunchConfiguration(program: string, args: string, cwd: string, debuggerEventsPipeName: string) {
103-
let debugOptions = vscode.workspace.getConfiguration('csharp').get('unitTestDebugingOptions');
103+
let debugOptions = vscode.workspace.getConfiguration('csharp').get('unitTestDebuggingOptions');
104104

105105
// Get the initial set of options from the workspace setting
106106
let result: any;

src/omnisharp/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function activate(context: vscode.ExtensionContext, reporter: TelemetryRe
5757
localDisposables.push(vscode.languages.registerRenameProvider(documentSelector, new RenameProvider(server)));
5858
localDisposables.push(vscode.languages.registerDocumentRangeFormattingEditProvider(documentSelector, new FormatProvider(server)));
5959
localDisposables.push(vscode.languages.registerOnTypeFormattingEditProvider(documentSelector, new FormatProvider(server), '}', ';'));
60-
localDisposables.push(vscode.languages.registerCompletionItemProvider(documentSelector, new CompletionItemProvider(server), '.', '<'));
60+
localDisposables.push(vscode.languages.registerCompletionItemProvider(documentSelector, new CompletionItemProvider(server), '.'));
6161
localDisposables.push(vscode.languages.registerWorkspaceSymbolProvider(new WorkspaceSymbolProvider(server)));
6262
localDisposables.push(vscode.languages.registerSignatureHelpProvider(documentSelector, new SignatureHelpProvider(server), '(', ','));
6363
const codeActionProvider = new CodeActionProvider(server);

src/omnisharp/protocol.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export interface AutoCompleteResponse {
267267
ReturnType: string;
268268
Snippet: string;
269269
Kind: string;
270+
IsSuggestionMode: boolean;
270271
}
271272

272273
export interface ProjectInformationResponse {
@@ -565,6 +566,11 @@ export namespace V2 {
565566
}
566567
}
567568

569+
export function findNetFrameworkTargetFramework(project: MSBuildProject): TargetFramework {
570+
let regexp = new RegExp('^net[1-4]');
571+
return project.TargetFrameworks.find(tf => regexp.test(tf.ShortName));
572+
}
573+
568574
export function findNetCoreAppTargetFramework(project: MSBuildProject): TargetFramework {
569575
return project.TargetFrameworks.find(tf => tf.ShortName.startsWith('netcoreapp'));
570576
}
@@ -573,6 +579,12 @@ export function findNetStandardTargetFramework(project: MSBuildProject): TargetF
573579
return project.TargetFrameworks.find(tf => tf.ShortName.startsWith('netstandard'));
574580
}
575581

582+
export function isDotNetCoreProject(project: MSBuildProject): Boolean {
583+
return findNetCoreAppTargetFramework(project) !== undefined ||
584+
findNetStandardTargetFramework(project) !== undefined ||
585+
findNetFrameworkTargetFramework(project) !== undefined;
586+
}
587+
576588
export interface ProjectDescriptor {
577589
Name: string;
578590
Directory: string;
@@ -594,8 +606,7 @@ export function getDotNetCoreProjectDescriptors(info: WorkspaceInformationRespon
594606

595607
if (info.MsBuild && info.MsBuild.Projects.length > 0) {
596608
for (let project of info.MsBuild.Projects) {
597-
if (findNetCoreAppTargetFramework(project) !== undefined ||
598-
findNetStandardTargetFramework(project) !== undefined) {
609+
if (isDotNetCoreProject(project)) {
599610
result.push({
600611
Name: path.basename(project.Path),
601612
Directory: path.dirname(project.Path),

src/tools/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ OptionsSchema.json defines the type for Launch/Attach options.
33

44
# GenerateOptionsSchema
55
If there are any modifications to the OptionsSchema.json file. Please run `gulp generateOptionsSchema` at the repo root.
6-
This will call GenerateOptionsSchema and update the package.json file.
6+
This will call GenerateOptionsSchema and update the package.json file.
77

88
### Important notes:
99

10-
1. Any manual changes to package.json's object.contributes.debuggers[0].configurationAttributes will be
10+
1. Any manual changes to package.json's object.contributes.debuggers[0].configurationAttributes will be
1111
replaced by this generator.
12-
2. This does **NOT** update the schema for csharp.unitTestDebugingOptions. So if the schema change is something valuable in unit test debugging, consider updating that section of package.json (look for `"csharp.unitTestDebugingOptions"`). The schema will work even if this step is omitted, but users will not get IntelliSense help when editing the new option if this step is skipped.
12+
2. This does **NOT** update the schema for csharp.unitTestDebuggingOptions. So if the schema change is something valuable in unit test debugging, consider updating that section of package.json (look for `"csharp.unitTestDebuggingOptions"`). The schema will work even if this step is omitted, but users will not get IntelliSense help when editing the new option if this step is skipped.
1313

1414

15-
If there is any other type of options added in the future, you will need to modify the GenerateOptionsSchema function
15+
If there is any other type of options added in the future, you will need to modify the GenerateOptionsSchema function
1616
to have it appear in package.json. It only adds launch and attach.

0 commit comments

Comments
 (0)