AvaloniaLanguageServer passing string
to GetForTargetAssembly
where IAssemblyProvider
is expected
#109
Labels
bug
Something isn't working
Describe the bug
I'm in the middle of writing a patch for this.
By the way, only repo admins can assign issues to users.
AvaloniaLanguageServer does not compile.
It's passing a string to a method that expects an IAssemblyProvider. It used to have mostly-correct behavior.
return _metadataReader.GetForTargetAssembly(new AvaloniaCompilationAssemblyProvider(intermediateOutputPath));
But it was missing something. It was passing the raw
intermediateOutputPath
.AvaloniaDesigner.xaml.cs contains a private function showing how the path is supposed to be transformed:
https://github.com/AvaloniaUI/AvaloniaVS/blob/9568ba154fd6a808d78548fef8f0bbb9e4238f5a/AvaloniaVS.Shared/Views/AvaloniaDesigner.xaml.cs#L522-L540
This is one of the many pitfalls of Avalonia.Ide.CompletionEngine's poorly documented API. Here are some others:
Where the constructor of
AvaloniaCompilationAssemblyProvider
takes astring
parameter namedpath
, it's actually expecting the path to a text file containing a newline-separate array of directory paths.https://github.com/AvaloniaUI/AvaloniaVS/blob/9568ba154fd6a808d78548fef8f0bbb9e4238f5a/CompletionEngine/Avalonia.Ide.CompletionEngine/AssemblyMetadata/AvaloniaCompilationAssemblyProvider.cs#L22
https://github.com/AvaloniaUI/AvaloniaVS/blob/9568ba154fd6a808d78548fef8f0bbb9e4238f5a/CompletionEngine/Avalonia.Ide.CompletionEngine.DnlibMetadataProvider/DnlibMetadataProvider.cs#L13-L25
To Reproduce
dotnet build ./src/AvaloniaLSP/AvaloniaLanguageServer/AvaloniaLanguageServer.csproj
Avalonia for VS Code
since 0f777aa
Avalonia version
No response
VS Code version
No response
Relevant log output
Additional context
No response
The text was updated successfully, but these errors were encountered: