You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C# extension: v2.10.28, C# Dev Kit extension: v1.1.9
Steps to Reproduce
A minimal repro can be found at the end of this issue.
Create or open any C# project.
Add a package reference to any package which source-generates types.
Attempt to navigate to the definition of any of those types.
Expected Behavior
The navigation to the definition succeeds.
Actual Behavior
The navigation fails with an error message from the C# extension similar to the one below (the URI will of course differ):
[Error - 4:33:49 PM] [LanguageServerHost] System.UriFormatException: Failed create URI from 'PolySharp.SourceGenerators\PolySharp.SourceGenerators.PolyfillsGenerator\System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute.g.cs'; original string: 'PolySharp.SourceGenerators\PolySharp.SourceGenerators.PolyfillsGenerator\System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute.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 System.Uri..ctor(String uriString, UriKind uriKind)
at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 178
--- 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 477
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 442
at Microsoft.CodeAnalysis.LanguageServer.Handler.AbstractGoToDefinitionHandler.GetDefinitionAsync(TextDocumentPositionParams request, Boolean typeOnly, RequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/Definitions/AbstractGoToDefinitionHandler.cs:line 61
at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 124
[Error - 4:33:49 PM] Request textDocument/definition failed.
Message: Failed create URI from 'PolySharp.SourceGenerators\PolySharp.SourceGenerators.PolyfillsGenerator\System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute.g.cs'; original string: 'PolySharp.SourceGenerators\PolySharp.SourceGenerators.PolyfillsGenerator\System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute.g.cs'
Code: -32000
[object Object]
namespaceMyProject{publicclassClass1{// Hovering over this attribute and hitting `Ctrl` shows a Visual Studio Code pop-up saying// 'Request textDocument/definition failed.' and does not allow navigation.[MemberNotNullWhen(true)]publicboolFoo{get;}}}
The text was updated successfully, but these errors were encountered:
Version Used
Steps to Reproduce
A minimal repro can be found at the end of this issue.
Expected Behavior
The navigation to the definition succeeds.
Actual Behavior
The navigation fails with an error message from the C# extension similar to the one below (the URI will of course differ):
Minimal repro
MyProject.csproj
Class1.cs
The text was updated successfully, but these errors were encountered: