Omnisharp-vscode: Snippet completions appear inside comments.

Created on 26 Dec 2018  Â·  18Comments  Â·  Source: OmniSharp/omnisharp-vscode

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.101
 Commit:    236713b0b7

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.2.101/

Host (useful for support):
  Version: 2.2.0
  Commit:  1249f08fed

.NET Core SDKs installed:
  2.2.101 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

VS Code version: 1.30.1
C# Extension version: 1.17.1

Steps to reproduce

Inside comments i get snippet completions, I have no C# related extensions installed other than omnisharp.

Expected behavior

In comments there shouldn't be any completions at all or at least upon manually invoking them.

Actual behavior

Snippet completions appear inside comments.

All 18 comments

Deeply irks me. Periods in comments always end up .abstract

@akshita31 Can you figure out if we're providing these or if VS Code is?

Not only comments. stings also affected:
image

And my favorite - just reaction on space
image
Space works everywhere - just press space and you got same result as on screenshot

@rchande Seems this is extension: if i disable it this behavior disappears.
upd
Tried ms-vscode.cpptools which contains snippets too - works normal(no snippets auto-complete on space)
Consistently downgraded from 17.1 to 16.0 - problem persists. . Stopped at 15.2 - failed to start omnisharp server.

.NET Command Line Tools (2.1.200)

Product Information:
 Version:            2.1.200
 Commit SHA-1 hash:  2edba8d7f1

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  18.04
 OS Platform: Linux
 RID:         ubuntu.18.04-x64
 Base Path:   /usr/share/dotnet/sdk/2.1.200/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.7
  Build    : 2d61d0b043915bc948ebf98836fefe9ba942be11

image

Found quick solution until this issue will fixed:
Set in settings "editor.snippetSuggestions": "none"
this will remove snippets from autocomplete list, but fix this issue: no snippets on spacebar.

@ru-ace I can live without snippets for the time being, because having auto complete popping up on every space bar is so annoying 😂.

I really hope someone updates us on the status of this though.

I had inadvertently filed this against VSCode and they insist it's the extension. (See also for a screen capture of the issue in action: https://github.com/Microsoft/vscode/issues/67271)

It's really frustrating.

It is 100% this extension. It is sending out snippets and not respecting
VSC's "snippets should not block autocomplete" setting

On Wed, Jan 30, 2019 at 2:34 PM Owen Pellegrin notifications@github.com
wrote:

I had inadvertently filed this against VSCode and they insist it's the
extension. (See also for a screen capture of the issue in action:
Microsoft/vscode#67271 https://github.com/Microsoft/vscode/issues/67271)

It's really frustrating.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/OmniSharp/omnisharp-vscode/issues/2765#issuecomment-459078706,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AefhgQAH3TJHA9FV4byLj16ySd96EIIyks5vIfPQgaJpZM4ZiENG
.

@jrieken We provide snippets in the form of json files/snippets entry in our package.json (https://github.com/OmniSharp/omnisharp-vscode/blob/master/snippets/csharp.json) and (https://github.com/OmniSharp/omnisharp-vscode/blob/master/package.json#L830). They seem to show up in comments even though we don't provide any other C# intellisense in comments. I think this is happening because

  • C# intellisense isn't provided in comments, so VS Code provides token-based intellisense (see screenshot)
  • The snippet completion provider detects a non-empty list and provides snippets

image

What can we do to make this not happen? This basically seems like a limitation in the VS Code platform to me--I don't see anything in the docs that allows us to control where a snippet is shown.

@jrieken Note that I've also seen instances of the above but with no tokens in the list, only snippets from csharp.json.

For those following along in this thread, I recommend disabling snippets with the option "editor.snippetSuggestions": "none" while we work with the VS Code team to find a resolution.

Thank you for the work on this!

On Wed, Jan 30, 2019 at 3:28 PM Ravi Chande notifications@github.com
wrote:

For those following along in this thread, I recommend disabling snippets
with the option "editor.snippetSuggestions": "none" while we work with
the VS Code team to find a resolution.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/OmniSharp/omnisharp-vscode/issues/2765#issuecomment-459096461,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AefhgS_zRABhNuCeQTSgTZf5umgVLbA4ks5vIgBRgaJpZM4ZiENG
.

@rchande Disabling snippets globally does affect lots of other languages, it becomes so frustrating if you do anything besides C# in vscode. I hope it gets fixed 😅. Perhaps mark it as a bug as it's already reproduced and affects nearly all users?

I'm not sure if this is conneced to this issue, but I sometimes get similar behaviour with dots, which gets a bit frustrating when working with C# 8 Ranges.

For example, typing 0..^2 might become 0.Equals.^2.

@JulianGmp yeah they closed the issue while it's not solved, i get the same behavior, other language servers don't seem to exhibit this behavior

@pushqrdx this issue isn't closed though? Or do you mean a different one?

@JulianGmp you know what, i totally flopped, i literally thought my issue was close sorry for that

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  Â·  3Comments

tstivers1990 picture tstivers1990  Â·  3Comments

yufeih picture yufeih  Â·  3Comments

ZeldaZocker picture ZeldaZocker  Â·  3Comments

hamhub7 picture hamhub7  Â·  3Comments