Closed rjgotten closed 1 month ago
I am seeing similar behavior:
[fail]: OmniSharp.Stdio.Host
************ Response ************
{
"Request_seq": 38891,
"Command": "/quickinfo",
"Running": true,
"Success": false,
"Message": "\"System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\\nParameter name: index\\n at Microsoft.CodeAnalysis.Text.SourceText+LineInfo.get_Item (System.Int32 index) [0x0000f] in <74e762f007514b0991a005183ec8dcb2>:0 \\n at Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition (Microsoft.CodeAnalysis.Text.LinePosition position) [0x00008] in <74e762f007514b0991a005183ec8dcb2>:0 \\n at OmniSharp.Extensions.SourceTextExtensions.GetTextPosition (Microsoft.CodeAnalysis.Text.SourceText sourceText, OmniSharp.Models.Request request) [0x00017] in <be259f9fdaf7461fb1b75b43208e4134>:0 \\n at OmniSharp.Roslyn.CSharp.Services.QuickInfoProvider.Handle (OmniSharp.Models.QuickInfoRequest request) [0x00124] in <845c3087cc7d4530b36a8584d73f1c1d>:0 \\n at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler`2[TRequest,TResponse][] handlers, TRequest request) [0x00099] in <0b3dc7d6f0c8428682a86ac3f9663775>:0 \\n at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in <0b3dc7d6f0c8428682a86ac3f9663775>:0 \\n at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in <0b3dc7d6f0c8428682a86ac3f9663775>:0 \\n at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000e7] in <0ff274924a1842faabf855aebc686508>:0 \"",
"Body": null,
"Seq": 230741,
"Type": "response"
}
Here is the exception call stack in a more readable format:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at Microsoft.CodeAnalysis.Text.SourceText+LineInfo.get_Item (System.Int32 index) [0x0000f] in <74e762f007514b0991a005183ec8dcb2>:0
at Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition (Microsoft.CodeAnalysis.Text.LinePosition position) [0x00008] in <74e762f007514b0991a005183ec8dcb2>:0
at OmniSharp.Extensions.SourceTextExtensions.GetTextPosition (Microsoft.CodeAnalysis.Text.SourceText sourceText, OmniSharp.Models.Request request) [0x00017] in <be259f9fdaf7461fb1b75b43208e4134>:0
at OmniSharp.Roslyn.CSharp.Services.QuickInfoProvider.Handle (OmniSharp.Models.QuickInfoRequest request) [0x00124] in <845c3087cc7d4530b36a8584d73f1c1d>:0
at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler`2[TRequest,TResponse][] handlers, TRequest request) [0x00099] in <0b3dc7d6f0c8428682a86ac3f9663775>:0
at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in <0b3dc7d6f0c8428682a86ac3f9663775>:0
at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in <0b3dc7d6f0c8428682a86ac3f9663775>:0
at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000e7] in <0ff274924a1842faabf855aebc686508>:0
Over the past few weeks, I've increasingly observed Omnisharp hanging and lagging. Code completion, go-to-definition, quick info, etc. have all been impacted.
@JoeRobich I believe these errors were always there, however after I bumped all service exceptions to report at error not debug level, they became visible to users by default 😄
I got the errors recently, on macos, at multiple structured projects. At first omnisharp starts normally when I open a .cs file it crashes with following outputs;
`info: OmniSharp.MSBuild.ProjectManager Loading project: /Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Dms/Dms.Domain/Dms.Domain.csproj
Successfully loaded project file '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Dms/Dms.Domain/Dms.Domain.csproj'.
Adding project '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Dms/Dms.Domain/Dms.Domain.csproj'
Loading project: /Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Finance/Finance.App/Finance.App.csproj
Successfully loaded project file '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Finance/Finance.App/Finance.App.csproj'.
Adding project '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Finance/Finance.App/Finance.App.csproj'
Loading project: /Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Finance/Finance.Domain/Finance.Domain.csproj
Successfully loaded project file '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Finance/Finance.Domain/Finance.Domain.csproj'.
Adding project '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Finance/Finance.Domain/Finance.Domain.csproj'
Loading project: /Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Bpm/Bpm.App/Bpm.App.csproj
Successfully loaded project file '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Bpm/Bpm.App/Bpm.App.csproj'.
Adding project '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Bpm/Bpm.App/Bpm.App.csproj'
Loading project: /Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Bpm/Bpm.Domain/Bpm.Domain.csproj
Successfully loaded project file '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Bpm/Bpm.Domain/Bpm.Domain.csproj'.
Adding project '/Users/omerciftci/Projects/BAHAMA/Bahama/Bahama/src/Bpm/Bpm.Domain/Bpm.Domain.csproj'
Update project: WebUI
Update project: Domain
Update project: Application
Update project: Infrastructure
Update project: Application.UnitTests
Update project: Domain.UnitTests
Update project: Application.IntegrationTests
Update project: Common.App
Update project: Common.Domain
Update project: Crm.App
Update project: Crm.Domain
Update project: Hr.Domain
Update project: Hr.App
Update project: Sample.App
Update project: Sample.Domain
Update project: Infrastructure.DataMigration
Update project: Audit.App
Update project: Audit.Domain
Update project: Dms.App
Update project: Dms.Domain
Update project: Finance.App
Update project: Finance.Domain
Update project: Bpm.App
Update project: Bpm.Domain
************ Response ************
{
"Request_seq": 790,
"Command": "/v2/highlight",
"Running": true,
"Success": false,
"Message": "\"System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\nParameter name: line\n at Microsoft.CodeAnalysis.Text.LinePosition..ctor (System.Int32 line, System.Int32 character) [0x00004] in <02f1a35137194cc3b7bab26f0cb540aa>:0 \n at OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.Handle (OmniSharp.Models.SemanticHighlight.SemanticHighlightRequest request) [0x00146] in <47d11c951b2c467ba3d5b0bfebca06c3>:0 \n at OmniSharp.Endpoint.EndpointHandler2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler
2[TRequest,TResponse][] handlers, TRequest request) [0x00099] in <15a25893e84240228920acfa2b3190eb>:0 \n at OmniSharp.Endpoint.EndpointHandler2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in <15a25893e84240228920acfa2b3190eb>:0 \\n at OmniSharp.Endpoint.EndpointHandler
2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in <15a25893e84240228920acfa2b3190eb>:0 \n at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000e7] in <871e49cde2fe4baf972bea6b4d99c013>:0 \"",
"Body": null,
"Seq": 260,
"Type": "response"
}
************ Response ************
{
"Request_seq": 794,
"Command": "/v2/highlight",
"Running": true,
"Success": false,
"Message": "\"System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\nParameter name: line\n at Microsoft.CodeAnalysis.Text.LinePosition..ctor (System.Int32 line, System.Int32 character) [0x00004] in <02f1a35137194cc3b7bab26f0cb540aa>:0 \n at OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.Handle (OmniSharp.Models.SemanticHighlight.SemanticHighlightRequest request) [0x00146] in <47d11c951b2c467ba3d5b0bfebca06c3>:0 \n at OmniSharp.Endpoint.EndpointHandler2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler
2[TRequest,TResponse][] handlers, TRequest request) [0x00099] in <15a25893e84240228920acfa2b3190eb>:0 \n at OmniSharp.Endpoint.EndpointHandler2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in <15a25893e84240228920acfa2b3190eb>:0 \\n at OmniSharp.Endpoint.EndpointHandler
2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in <15a25893e84240228920acfa2b3190eb>:0 \n at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000e7] in <871e49cde2fe4baf972bea6b4d99c013>:0 \"",
"Body": null,
"Seq": 267,
"Type": "response"
}
************ Response ************
{
"Request_seq": 795,
"Command": "/v2/highlight",
"Running": true,
"Success": false,
"Message": "\"System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\nParameter name: line\n at Microsoft.CodeAnalysis.Text.LinePosition..ctor (System.Int32 line, System.Int32 character) [0x00004] in <02f1a35137194cc3b7bab26f0cb540aa>:0 \n at OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.Handle (OmniSharp.Models.SemanticHighlight.SemanticHighlightRequest request) [0x00146] in <47d11c951b2c467ba3d5b0bfebca06c3>:0 \n at OmniSharp.Endpoint.EndpointHandler2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler
2[TRequest,TResponse][] handlers, TRequest request) [0x00099] in <15a25893e84240228920acfa2b3190eb>:0 \n at OmniSharp.Endpoint.EndpointHandler2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in <15a25893e84240228920acfa2b3190eb>:0 \\n at OmniSharp.Endpoint.EndpointHandler
2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in <15a25893e84240228920acfa2b3190eb>:0 \n at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000e7] in <871e49cde2fe4baf972bea6b4d99c013>:0 \"",
"Body": null,
"Seq": 269,
"Type": "response"
}`
There have been lots of improvements since this issue was opened. Please open a new issue with logs if you are still running into this.
Issue Description
After loading up a C# solution (company code; can't share) and letting Omnisharp load up the project for initial analysis, the "Omnisharp log" category in the output panel is flooded with ArgumentOutOfRangeException from OmniSharp.Stdio.Host, related to a semantic highlighting service
Steps to Reproduce
Expected Behavior
No exceptions.
Actual Behavior
Exceptions flood the log.
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.50.1 C# Extension: 1.23.5
Dotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.403 Commit: 9e895200cd Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.403\ Host (useful for support): Version: 3.1.9 Commit: 774fc3d6a9 .NET Core SDKs installed: 2.1.505 [C:\Program Files\dotnet\sdk] 2.1.507 [C:\Program Files\dotnet\sdk] 2.1.508 [C:\Program Files\dotnet\sdk] 2.1.509 [C:\Program Files\dotnet\sdk] 2.2.107 [C:\Program Files\dotnet\sdk] 3.0.100 [C:\Program Files\dotnet\sdk] 3.1.403 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |alignment|annsk|0.3.0| |csharp|ms-dotnettools|1.23.5| |DocFX|ms-docfx|0.1.3| |material-icon-theme|PKief|4.4.0| |vetur|octref|0.29.0| |vscode-eslint|dbaeumer|2.1.13|;