Closed timheuer closed 1 year ago
This randomly occurs for me in cshtml files when the markup is malformed. In my case, its because I'm porting Vue to Razor and there is a lot of markup that isn't valid.
Logs...
Using dotnet configured on PATH
Dotnet path: C:\Program Files\dotnet\dotnet.exe
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stdout] {"pipeName":"\\\\.\\pipe\\f40df8f0-c626-416b-9ca6-080369259b43"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info - 12:12:32 PM] [Program] Language server initialized
[Warn - 12:43:19 PM] [LanguageServerHost] Ignoring diagnostics request for untracked document: file:///C:/Users/burke/Dev/BlazorSWA/Client/StateContainer.cs
[Error - 12:50:03 PM] [LanguageServerHost] System.UriFormatException: Failed create URI from 'Microsoft.Azure.Functions.Worker.Sdk.Generators\Microsoft.Azure.Functions.Worker.Sdk.Generators.ExtensionStartupRunnerGenerator\WorkerExtensionStartupCodeExecutor.g.cs'; original string: 'Microsoft.Azure.Functions.Worker.Sdk.Generators\Microsoft.Azure.Functions.Worker.Sdk.Generators.ExtensionStartupRunnerGenerator\WorkerExtensionStartupCodeExecutor.g.cs'
---> System.UriFormatException: Invalid URI: The format of the URI could not be determined.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 186
--- End of inner exception stack trace ---
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 186
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.<TextSpanToLocationAsync>g__ConvertTextSpanToLocation|30_0(Document document, TextSpan span, Boolean isStale, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 491
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.TextSpanToLocationAsync(Document document, TextSpan textSpan, Boolean isStale, Nullable`1 context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 503
at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.ComputeLocationAsync(Nullable`1 documentSpan, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 246
at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.GenerateVSReferenceItemAsync(Int32 definitionId, Int32 id, Nullable`1 documentSpan, ImmutableDictionary`2 properties, ClassifiedTextElement definitionText, Glyph definitionGlyph, Nullable`1 symbolUsageInfo, Boolean isWrittenTo, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 201
at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.OnReferenceFoundAsync(SourceReferenceItem reference, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 175
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesProgressAdapter.OnReferenceFoundAsync(SymbolGroup group, ISymbol definition, ReferenceLocation location, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.ProgressAdapter.cs:line 124
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<>c__DisplayClass20_0.<<ProcessDocumentAsync>g__ProcessDocumentAsync|0>d.MoveNext() in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 301
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ProcessDocumentAsync(Document document, MetadataUnifyingSymbolHashSet symbols, Dictionary`2 symbolToGlobalAliases, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 302
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ProcessDocumentAsync(Document document, MetadataUnifyingSymbolHashSet symbols, Dictionary`2 symbolToGlobalAliases, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 302
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ProcessProjectAsync(Project project, ImmutableArray`1 allSymbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 244
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ProcessProjectAsync(Project project, ImmutableArray`1 allSymbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 244
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
at Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.FindReferencesAsync(ISymbol symbol, Solution solution, IStreamingFindReferencesProgress progress, IImmutableSet`1 documents, FindReferencesSearchOptions options, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_FindReferences_Current.cs:line 68
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, FindReferencesSearchOptions options, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 157
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 126
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 105
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindLiteralOrSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 67
at Microsoft.CodeAnalysis.LanguageServer.Handler.FindAllReferencesHandler.HandleRequestAsync(ReferenceParams referenceParams, RequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindAllReferencesHandler.cs:line 72
at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 176
[Error - 12:50:03 PM] [LanguageServerHost] System.UriFormatException: Failed create URI from 'Microsoft.Azure.Functions.Worker.Sdk.Generators\Microsoft.Azure.Functions.Worker.Sdk.Generators.ExtensionStartupRunnerGenerator\WorkerExtensionStartupCodeExecutor.g.cs'; original string: 'Microsoft.Azure.Functions.Worker.Sdk.Generators\Microsoft.Azure.Functions.Worker.Sdk.Generators.ExtensionStartupRunnerGenerator\WorkerExtensionStartupCodeExecutor.g.cs'
---> System.UriFormatException: Invalid URI: The format of the URI could not be determined.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 186
--- End of inner exception stack trace ---
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 186
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.<TextSpanToLocationAsync>g__ConvertTextSpanToLocation|30_0(Document document, TextSpan span, Boolean isStale, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 491
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.TextSpanToLocationAsync(Document document, TextSpan textSpan, Boolean isStale, Nullable`1 context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 503
at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.ComputeLocationAsync(Nullable`1 documentSpan, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 246
at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.GenerateVSReferenceItemAsync(Int32 definitionId, Int32 id, Nullable`1 documentSpan, ImmutableDictionary`2 properties, ClassifiedTextElement definitionText, Glyph definitionGlyph, Nullable`1 symbolUsageInfo, Boolean isWrittenTo, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 201
at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.OnReferenceFoundAsync(SourceReferenceItem reference, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 175
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesProgressAdapter.OnReferenceFoundAsync(SymbolGroup group, ISymbol definition, ReferenceLocation location, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.ProgressAdapter.cs:line 124
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<>c__DisplayClass20_0.<<ProcessDocumentAsync>g__ProcessDocumentAsync|0>d.MoveNext() in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 301
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ProcessDocumentAsync(Document document, MetadataUnifyingSymbolHashSet symbols, Dictionary`2 symbolToGlobalAliases, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 302
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ProcessDocumentAsync(Document document, MetadataUnifyingSymbolHashSet symbols, Dictionary`2 symbolToGlobalAliases, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 302
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ProcessProjectAsync(Project project, ImmutableArray`1 allSymbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 244
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ProcessProjectAsync(Project project, ImmutableArray`1 allSymbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 244
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
at Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.FindReferencesAsync(ISymbol symbol, Solution solution, IStreamingFindReferencesProgress progress, IImmutableSet`1 documents, FindReferencesSearchOptions options, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_FindReferences_Current.cs:line 68
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, FindReferencesSearchOptions options, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 157
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 126
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 105
at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindLiteralOrSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 67
at Microsoft.CodeAnalysis.LanguageServer.Handler.FindAllReferencesHandler.HandleRequestAsync(ReferenceParams referenceParams, RequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindAllReferencesHandler.cs:line 72
at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 176
[Error - 12:50:03 PM] Request textDocument/references failed.
Message: Failed create URI from 'Microsoft.Azure.Functions.Worker.Sdk.Generators\Microsoft.Azure.Functions.Worker.Sdk.Generators.ExtensionStartupRunnerGenerator\WorkerExtensionStartupCodeExecutor.g.cs'; original string: 'Microsoft.Azure.Functions.Worker.Sdk.Generators\Microsoft.Azure.Functions.Worker.Sdk.Generators.ExtensionStartupRunnerGenerator\WorkerExtensionStartupCodeExecutor.g.cs'
Code: -32000
[object Object]
[Error - 12:50:03 PM] Request textDocument/references failed.
Message: Failed create URI from 'Microsoft.Azure.Functions.Worker.Sdk.Generators\Microsoft.Azure.Functions.Worker.Sdk.Generators.ExtensionStartupRunnerGenerator\WorkerExtensionStartupCodeExecutor.g.cs'; original string: 'Microsoft.Azure.Functions.Worker.Sdk.Generators\Microsoft.Azure.Functions.Worker.Sdk.Generators.ExtensionStartupRunnerGenerator\WorkerExtensionStartupCodeExecutor.g.cs'
Code: -32000
[object Object]
@burkeholland That log appears to be from the C# server, and is related to source generated files I think. Was there a Razor log you meant to include instead?
@jasonmalinowski @tmat Is the Uri issue above known?
@davidwengier Yes, that's a duplicate of https://github.com/dotnet/vscode-csharp/issues/6426. Unless you've got something else in this bug to look at as well, we can close it.
Thanks @jasonmalinowski. The original issue here (crashing on git diff in Razor files) is still a bug, so will leave it open, but good to know @burkeholland's issue is known.
Thanks @jasonmalinowski. The original issue here (crashing on git diff in Razor files) is still a bug, so will leave it open, but good to know @burkeholland's issue is known.
@davidwengier I'm looking at the current bug. So far, I confirmed:
Trying to create DocumentContext for textDocument/semanticTokens/range for git:/c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml?{"path"%3A"c%3A%5C%5CCodeHub%5C%5Crepro-9365%5C%5Cmymvcapp%5C%5CViews%5C%5CHome%5C%5CIndex.cshtml"%2C"ref"%3A"~"}
Trying to create DocumentContext for textDocument/semanticTokens/range for file:///c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml
[Info - 3:26:37 PM] Returned 24 semantic tokens for range (0,0)-(8,0) in git:/c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml?{"path"%3A"c%3A%5C%5CCodeHub%5C%5Crepro-9365%5C%5Cmymvcapp%5C%5CViews%5C%5CHome%5C%5CIndex.cshtml"%2C"ref"%3A"~"}.
[Info - 3:26:37 PM] Returned 47 semantic tokens for range (0,0)-(9,6) in file:///c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml.
When just opening document:
Trying to create DocumentContext for textDocument/semanticTokens/range for (no project context) for file:///c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml
[Info - 3:36:15 PM] Returned 47 semantic tokens for range (0,0)-(9,6) in file:///c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml.
Open diff file:
Trying to create DocumentContext for textDocument/semanticTokens/range for (no project context) for git:/c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml?{"path"%3A"c%3A%5C%5CCodeHub%5C%5Crepro-9365%5C%5Cmymvcapp%5C%5CViews%5C%5CHome%5C%5CIndex.cshtml"%2C"ref"%3A"~"}
Trying to create DocumentContext for textDocument/semanticTokens/range for (no project context) for file:///c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml
[Error - 3:36:55 PM] System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'range.End (9,6) matches or exceeds SourceText boundary 9.')
at Microsoft.AspNetCore.Razor.LanguageServer.Extensions.RangeExtensions.<AsTextSpan>g__GetAbsolutePosition|8_0(Position position, SourceText sourceText, String argName) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/RangeExtensions.cs:line 151
at Microsoft.AspNetCore.Razor.LanguageServer.Extensions.RangeExtensions.AsTextSpan(Range range, SourceText sourceText) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/RangeExtensions.cs:line 138
at Microsoft.AspNetCore.Razor.LanguageServer.Extensions.RangeExtensions.AsRazorTextSpan(Range range, SourceText sourceText) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/RangeExtensions.cs:line 166
at Microsoft.AspNetCore.Razor.LanguageServer.Semantic.TagHelperSemanticRangeVisitor.VisitAllNodes(RazorCodeDocument razorCodeDocument, Range range, RazorSemanticTokensLegend razorSemanticTokensLegend, Boolean colorCodeBackground) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/TagHelperSemanticRangeVisitor.cs:line 40
at Microsoft.AspNetCore.Razor.LanguageServer.Semantic.RazorSemanticTokensInfoService.GetSemanticTokensAsync(TextDocumentIdentifier textDocumentIdentifier, Range range, VersionedDocumentContext documentContext, RazorSemanticTokensLegend razorSemanticTokensLegend, Guid correlationId, CancellationToken cancellationToken) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs:line 66
at Microsoft.AspNetCore.Razor.LanguageServer.Semantic.SemanticTokensRangeEndpoint.HandleRequestAsync(SemanticTokensRangeParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/SemanticTokensRangeEndpoint.cs:line 59
at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken)
[Error - 3:36:55 PM] Request textDocument/semanticTokens/range failed.
Message: Specified argument was out of the range of valid values. (Parameter 'range.End (9,6) matches or exceeds SourceText boundary 9.')
Code: -32000
[object Object]
[Info - 3:36:55 PM] Returned 46 semantic tokens for range (0,0)-(8,0) in git:/c%3A/CodeHub/repro-9365/mymvcapp/Views/Home/Index.cshtml?{"path"%3A"c%3A%5C%5CCodeHub%5C%5Crepro-9365%5C%5Cmymvcapp%5C%5CViews%5C%5CHome%5C%5CIndex.cshtml"%2C"ref"%3A"~"}.
This narrows down the bug to one of the changes listed in here https://github.com/dotnet/vscode-csharp/compare/v2.1.2...v2.2.10
We are getting ArgumentOutOfRangeException
because the SourceText being used inside GetAbsolutePosition
is an outdated one (e.g. taken from the left side in the screenshot below)
e.g.
In this would fail with message: (the requested ranges has 11 lines, but the document it sees has 8 lines)
Specified argument was out of the range of valid values. (Parameter 'range.End (11,0) matches or exceeds SourceText boundary 8.')
This issue is most likely nothing to do with semantic tokens, and all to do with our Uri handling. The two requests should resolve to two different documents, but are probably being considered the same file by us. The short term fix would be to hard-code knowledge of git://
uris and make sure they point to documents in the miscellaneous files project. The longer term fix is to fix our uri handling in some way, but it will take some investigation to work out what that way is.
Describe the Issue
It appears when viewing a cshtml diff in VS code the Razor language service now starts to crash with:
Steps To Reproduce
git
toolsdotnet new mvc -n mymvcapp
git init
dotnet new gitignore
git commit -a -m 'initial commit'
mymvcapp
Open a
.cshtml
page and make an edit on home/index.cshtml@WelcomeMessage
Learn about building Web apps with ASP.NET Core.