-
Notifications
You must be signed in to change notification settings - Fork 676
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
Incorrect syntax, errors, references, etc. #5216
Comments
I suspect this is related to the "fileChanged" behavior that was introduced in #5088 |
I'm seeing this all the time as well, in multiple projects. Seems to be coupled with this exception in the OmniSharp Log:
Hopefully this helps a bit. |
Getting a lot of these in the logs too:
It's actually almost unusable when refactoring. Don't suppose there might be a workaround while we wait for a fix? |
Updated the extension to the preview version, but having the following omnisharp error:
Not sure if it is connected to this issue, but I get the log of Omnisharp flooded by this message after every typed letter. |
Issue Description
Omnisharp regularly crashes. This results in references displaying in incorrect positions, hides errors and shows errors where there are none, incorrect syntax, etc. See below:
Steps to Reproduce
Inconsistent. Will sometimes occur on save. Sometimes when moving between tabs of an unsaved file. Making a change to the document corrects the display. Noticed this behavior about a month ago.
Expected Behavior
N/A
Actual Behavior
See description.
Logs
OmniSharp log
OmniSharp server started.
Path: c:\Users\Dael.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64.omnisharp\1.38.2\OmniSharp.exe
PID: 23300
Starting OmniSharp on Windows 6.2.9200.0 (x64)
info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
DotNetPath set to C:\Program Files\dotnet\dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Visual Studio Community 2022 17.2.32505.173 17.2.1 - "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin"
2: StandAlone 17.1.1 - "c:\Users\Dael.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64.omnisharp\1.38.2.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Community 2022 17.2.32505.173 17.2.1 - "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin"
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'd:\Coding\godot\Arenbee'.
info: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'd:\Coding\godot\Arenbee\Arenbee.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Coding\godot\Arenbee\Arenbee.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'd:\Coding\godot\Arenbee'.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'd:\Coding\godot\Arenbee' on host 24556.
info: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Coding\godot\Arenbee\Arenbee.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'd:\Coding\godot\Arenbee\Arenbee.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'd:\Coding\godot\Arenbee\Arenbee.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: Arenbee
info: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
Solution initialized -> queue all documents for code analysis. Initial document count: 206.
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 7,
"Command": "/inlayHint",
"Arguments": {
"Location": {
"FileName": "d:\Coding\godot\Arenbee\Framework\Actors\State\StateController.cs",
"Range": {
"Start": {
"Line": 32,
"Column": 0
},
"End": {
"Line": 168,
"Column": 1
}
}
}
}
}
[fail]: OmniSharp.Stdio.Host
************ Response (21.5511ms) ************
{
"Request_seq": 7,
"Command": "/inlayHint",
"Running": true,
"Success": false,
"Message": ""System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\r\nParameter name: index\r\n at Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)\r\n at OmniSharp.Extensions.TextExtensions.GetPositionFromLineAndOffset(SourceText text, Int32 lineNumber, Int32 offset) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn\\Extensions\\TextExtensions.cs:line 28\r\n at OmniSharp.Extensions.TextExtensions.GetSpanFromRange(SourceText text, Range range) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn\\Extensions\\TextExtensions.cs:line 55\r\n at OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService.d__6.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\InlayHints\\InlayHintService.cs:line 56\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Endpoint.EndpointHandler
2.<GetFirstNotEmptyResponseFromHandlers>d__19.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.d__20.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 230\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Endpoint.EndpointHandler2.<Process>d__16.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 138\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Stdio.Host.<HandleRequest>d__14.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Stdio\\\\Host.cs:line 218\"", "Body": null, "Seq": 129, "Type": "response" } [warn]: OmniSharp.Stdio.Host ************ Request ************ { "Type": "request", "Seq": 17, "Command": "/inlayHint", "Arguments": { "Location": { "FileName": "d:\\Coding\\godot\\Arenbee\\Framework\\Actors\\State\\StateController.cs", "Range": { "Start": { "Line": 32, "Column": 0 }, "End": { "Line": 168, "Column": 1 } } } } } [fail]: OmniSharp.Stdio.Host ************ Response (0.5629ms) ************ { "Request_seq": 17, "Command": "/inlayHint", "Running": true, "Success": false, "Message": "\"System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\\r\\nParameter name: index\\r\\n at Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)\\r\\n at OmniSharp.Extensions.TextExtensions.GetPositionFromLineAndOffset(SourceText text, Int32 lineNumber, Int32 offset) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn\\\\Extensions\\\\TextExtensions.cs:line 28\\r\\n at OmniSharp.Extensions.TextExtensions.GetSpanFromRange(SourceText text, Range range) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn\\\\Extensions\\\\TextExtensions.cs:line 55\\r\\n at OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService.<Handle>d__6.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\InlayHints\\\\InlayHintService.cs:line 56\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.d__19.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Endpoint.EndpointHandler2.<HandleRequestForLanguage>d__20.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 230\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.d__16.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 138\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Stdio.Host.d__14.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 218"","Body": null,
"Seq": 141,
"Type": "response"
}
C# log
Environment information
VSCode version: 1.67.1
C# Extension: 1.24.4
Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.300 Commit: 8473146e7dRuntime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.300\
Host (useful for support):
Version: 6.0.5
Commit: 70ae3df4a6
.NET SDKs installed:
6.0.300 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: