When I am using something that hasn't been imported, Omnisharp correctly suggests things to import, but some things are not in the list. It seems it cuts off the amount of suggestions at around 3 suggestions.
Can someone verify this? And is this something that can be changed?
there is no 3 import limit. The completion engine is now the same as in Visual Studio and based on name matching it should return everything.
See the screengrab below. Notice that the only imported namespace is System, and the completion items come from all kinds of unimported namespaces because the types matching Web are found there

Then there's a bug. It also only seems to happen with a class that I have which is called Transaction. It seems to suggest 3 other classes than the one I want, until I manually import.
if there is a completion quality issue, please open an issue with repro steps in https://github.com/dotnet/roslyn
OmniSharp uses completion providers that are part of the C# compiler
Could it be that omnisharp hasn't finished analyzing my projects? Could that be why?
yes, possibly. There is an internal cache that gets built up for unimported types. In such cases the resulting list is flagged as incomplete. It would be great if you could provide repro steps though - thanks.
I can't provide a repro. I am under NDA.
I see. I will close this issue then - once you can reproduce this in a shareable code, please open an issue in:
Thanks!
No investigation or anything into what may potentially be the cause?
No repro doesn't mean an issue should be dismissed IMO.
@ffMathy Sorry complete unimported type is giving you some trouble. I created a new console project (dotnet new console) and added a Transaction.cs file which contained a Transaction class in 6 different namespaces. When I try to complete the Transaction type from the Program.cs, I see all of those as suggestions in the completion list.

Since it seems that perhaps you have a very large solution and all projects/dependencies haven't been analyzed, what happens if you give more time for analysis? Are there any errors in your OmniSharp log that may indicate analysis failed?
@JoeRobich I do get the following error in the logs, but it doesn't seem it's related.
{
"Request_seq": 35,
"Command": "/v2/highlight",
"Running": true,
"Success": false,
"Message": "\"System.ArgumentOutOfRangeException: Det angivne argument l氓 uden for det gyldige v忙rdiomr氓de.\\r\\nParameternavn: line\\r\\n ved Microsoft.CodeAnalysis.Text.LinePosition..ctor(Int32 line, Int32 character)\\r\\n ved OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.<Handle>d__1.MoveNext() i D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\SemanticHighlight\\\\SemanticHighlightService.cs:linje 36\\r\\n--- Afslutningen p氓 staksporingen fra den tidligere placering, hvor undtagelsen blev udl酶st ---\\r\\n ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n ved OmniSharp.Endpoint.EndpointHandler`2.<GetFirstNotEmptyResponseFromHandlers>d__19.MoveNext()\\r\\n--- Afslutningen p氓 staksporingen fra den tidligere placering, hvor undtagelsen blev udl酶st ---\\r\\n ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n ved OmniSharp.Endpoint.EndpointHandler`2.<HandleRequestForLanguage>d__20.MoveNext() i D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:linje 230\\r\\n--- Afslutningen p氓 staksporingen fra den tidligere placering, hvor undtagelsen blev udl酶st ---\\r\\n ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n ved OmniSharp.Endpoint.EndpointHandler`2.<Process>d__16.MoveNext() i D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:linje 131\\r\\n--- Afslutningen p氓 staksporingen fra den tidligere placering, hvor undtagelsen blev udl酶st ---\\r\\n ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n ved OmniSharp.Stdio.Host.<HandleRequest>d__13.MoveNext() i D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Stdio\\\\Host.cs:linje 215\"",
"Body": null,
"Seq": 133,
"Type": "response"
}
I'll wait until the analyze finishes. It typically takes 10 - 20 minutes, but I'll get back with more data.
@filipw can we re-open this? There's clearly more to investigate here.
Okay, it's still not done. It has gotten worse.
I filed #4254 to make the performance better.
But here's a screenshot proving it:

In this case, I have a class called User in my system. Last time, it happened for Transaction. It only seems to happen for classes that are also present in other namespaces.
I have never seen it for a regular class that only has one suggestion.
To be fair though, it does seem that the existing suggestions it makes are from NuGet packages, and not my own project.
Also, the total list is quite long. Is there a limit there?

@ffMathy sorry I thought your issue is related to imports in autocomplete (hence my GIF and what Joey also referred to) rather than the code action to import missing namespaces! That changes things indeed.
The limit of three imports is actually hardcoded into Roslyn (here). Because of that, the same issue is exhibited by Visual Studio too. There is a tracking issue for that https://github.com/dotnet/roslyn/issues/31002, I would suggest that you upvote that one to attract more attention to it. Regardless - this is not an OmniSharp problem so there is nothing actionable for us unfortunately, once it's resolved in Roslyn we can have it OmniSharp and Visual Studio will also get it.
For the future please do not delete the issue template when opening the issue but rather fill it in and include as much as you can in the issue report to avoid confusion (in this case the screenshot helped a lot) and waste of time - thanks again! 馃槃
Thank you @filipw. That makes a lot of sense.
I'll upvote the issue there.
And sorry for not filling details out. I'm not spending my spare time writing these issues, which is why I don't want to use too much time on them. I decided that sharing the issue without the template would be better than not sharing an issue at all?
I would say that quality over quantity is preferred 馃榾
though in hindsight, this one here was a great issue - no one has ever noticed this limit!
Fair enough! 馃憤
By the way, I opened a PR to "workaround" this, although I realize it might be rejected - it's a bit hacky: https://github.com/dotnet/roslyn/pull/49687
Most helpful comment
I would say that quality over quantity is preferred 馃榾
though in hindsight, this one here was a great issue - no one has ever noticed this limit!