diff --git a/CHANGELOG.md b/CHANGELOG.md index 364dc6ec8..ce7aa0a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ #### Completion List * 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)) +* 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)) #### Other Updates and Fixes diff --git a/package.json b/package.json index cd53130b8..5cbe6a771 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "csharp", "publisher": "ms-vscode", - "version": "1.10.0", + "version": "1.11.0-beta1", "description": "C# for Visual Studio Code (powered by OmniSharp).", "displayName": "C#", "author": "Microsoft Corporation", @@ -123,7 +123,7 @@ }, { "description": "OmniSharp (.NET 4.6 / x86)", - "url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.19.1.zip", + "url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.20.0zip", "installPath": "./bin/omnisharp", "platforms": [ "win32" @@ -135,7 +135,7 @@ }, { "description": "OmniSharp (.NET 4.6 / x64)", - "url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.19.1.zip", + "url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.20.0.zip", "installPath": "./bin/omnisharp", "platforms": [ "win32" @@ -147,7 +147,7 @@ }, { "description": "OmniSharp (Mono 4.6)", - "url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-mono-1.19.1.zip", + "url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-mono-1.20.0.zip", "installPath": "./bin/omnisharp", "platforms": [ "darwin", diff --git a/src/features/completionItemProvider.ts b/src/features/completionItemProvider.ts index f2ce91996..c2187f671 100644 --- a/src/features/completionItemProvider.ts +++ b/src/features/completionItemProvider.ts @@ -15,10 +15,15 @@ import {CompletionItemProvider, CompletionItem, CompletionItemKind, Cancellation export default class OmniSharpCompletionItemProvider extends AbstractSupport implements CompletionItemProvider { // copied from Roslyn here: https://github.com/dotnet/roslyn/blob/6e8f6d600b6c4bc0b92bc3d782a9e0b07e1c9f8e/src/Features/Core/Portable/Completion/CompletionRules.cs#L166-L169 - private static DefaultCommitCharacters = [ + private static AllCommitCharacters = [ ' ', '{', '}', '[', ']', '(', ')', '.', ',', ':', ';', '+', '-', '*', '/', '%', '&', '|', '^', '!', '~', '=', '<', '>', '?', '@', '#', '\'', '\"', '\\']; + + private static CommitCharactersWithoutSpace = [ + '{', '}', '[', ']', '(', ')', '.', ',', ':', + ';', '+', '-', '*', '/', '%', '&', '|', '^', '!', + '~', '=', '<', '>', '?', '@', '#', '\'', '\"', '\\']; public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Promise { @@ -55,7 +60,10 @@ export default class OmniSharpCompletionItemProvider extends AbstractSupport imp completion.documentation = extractSummaryText(response.Description); completion.kind = _kinds[response.Kind] || CompletionItemKind.Property; completion.insertText = response.CompletionText.replace(/<>/g, ''); - completion.commitCharacters = OmniSharpCompletionItemProvider.DefaultCommitCharacters; + + completion.commitCharacters = response.IsSuggestionMode + ? OmniSharpCompletionItemProvider.CommitCharactersWithoutSpace + : OmniSharpCompletionItemProvider.AllCommitCharacters; let array = completions[completion.label]; if (!array) { diff --git a/src/omnisharp/protocol.ts b/src/omnisharp/protocol.ts index bec9ce9f8..38a766f30 100644 --- a/src/omnisharp/protocol.ts +++ b/src/omnisharp/protocol.ts @@ -267,6 +267,7 @@ export interface AutoCompleteResponse { ReturnType: string; Snippet: string; Kind: string; + IsSuggestionMode: boolean; } export interface ProjectInformationResponse {