icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
107 stars 13 forks source link

C# dev kit and source generator #3695

Closed bernardnormier closed 11 months ago

bernardnormier commented 1 year ago

In VS code, when I click on IDispatcher.DispatchAsync to see the 99+ references, I get this error (+ small dialog):

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\\cb48ebc1-9ada-42de-95c2-4b20ab363057"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 12:31:36 PM] [Program] Language server initialized
[Error - 12:32:18 PM] [LanguageServerHost] System.UriFormatException: Failed create URI from 'IceRpc.Slice.Generators\IceRpc.Slice.Generators.ServiceGenerator\Service.g.cs'; original string: 'IceRpc.Slice.Generators\IceRpc.Slice.Generators.ServiceGenerator\Service.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 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.FindUsagesLSPContext.ComputeLocationAsync(Nullable`1 documentSpan, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 209
   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 194
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.OnDefinitionFoundAsync(DefinitionItem definition, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 118
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesProgressAdapter.OnDefinitionFoundAsync(SymbolGroup group, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.ProgressAdapter.cs:line 110
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ReportGroupAsync(ISymbol symbol, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 175
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ReportGroupsAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 146
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 120
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 126
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 130
   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 64
   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 154
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 125
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 103
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindLiteralOrSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 65
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindAllReferencesHandler.HandleRequestAsync(ReferenceParams referenceParams, RequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindAllReferencesHandler.cs:line 68
   at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 176
[Error - 12:32:18 PM] Request textDocument/references failed.
  Message: Failed create URI from 'IceRpc.Slice.Generators\IceRpc.Slice.Generators.ServiceGenerator\Service.g.cs'; original string: 'IceRpc.Slice.Generators\IceRpc.Slice.Generators.ServiceGenerator\Service.g.cs'
  Code: -32000 
[object Object]
bernardnormier commented 1 year ago

image

pepone commented 1 year ago

I think it is caused by this VSCode issue https://github.com/dotnet/vscode-csharp/issues/6426

pepone commented 11 months ago

@bernardnormier can we close this? There is nothing for us to do here, is just a VSCode bug.