Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete outputs error to the OmniSharp log #980

Closed
anfomin opened this issue Nov 22, 2016 · 6 comments
Closed

Autocomplete outputs error to the OmniSharp log #980

anfomin opened this issue Nov 22, 2016 · 6 comments
Assignees
Milestone

Comments

@anfomin
Copy link

anfomin commented Nov 22, 2016

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-1-003177)

Product Information:
 Version:            1.0.0-preview2-1-003177
 Commit SHA-1 hash:  a2df9c2576

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.11-x64

VS Code version: 1.7.1
C# Extension version: 1.5.3

Steps to reproduce

  1. Create empty C# project running .NET Standard 1.6.
  2. Create C# class.
  3. Show autocomplete.

Expected behavior

There should be no errors in output.

Actual behavior

Omnisharp log shows error for each autocomplete:

[ERROR:Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware] An unhandled exception has occurred: Object reference not set to an instance of an object
[INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /autocomplete: 500 36ms
@DustinCampbell
Copy link
Member

Hi! Could you clarify the repro steps a bit? How did you create the empty C# project? Did you use dotnet new?

@anfomin
Copy link
Author

anfomin commented Nov 22, 2016

@DustinCampbell I've created project via custom project.json and dotnet restore after:

{
	"version": "1.0.0-*",

	"dependencies": {
		"Microsoft.AspNetCore.Mvc.Core": "1.1.0"
	},

	"frameworks": {
		"net46": { },
		"netstandard1.6": { }
	}
}

I've investigated. This exception occurs when autocompletion tries to find completion for variable name. For example, I'm entering: Exception e. When I enter e then exception is logged:

2016-11-22 23 09 41

@DustinCampbell
Copy link
Member

Thanks for the detailed repro. I'll take a look.

@DustinCampbell
Copy link
Member

OK. I have a PR out to omnisharp-roslyn to fix this issue. FWIW, the behavior should be mostly benign. The completion is the same whether the exception is thrown or not.

@anfomin
Copy link
Author

anfomin commented Nov 22, 2016

I see that completion works but any exception in the log warns. Thanks.

@DustinCampbell
Copy link
Member

I've created a v1.6-beta2 release of the C# extension that contains this fix, among others. See this page for information on installing beta releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants