-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move csharp decompiler service down to features so it is available in vscode #69501
Move csharp decompiler service down to features so it is available in vscode #69501
Conversation
We should make sure that ILSpy is listed in thirdpartynotices.txt to give them appropriate credit. |
@@ -72,6 +72,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" /> | |||
<PackageReference Include="ICSharpCode.Decompiler" Version="$(ICSharpCodeDecompilerVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @jaredpar to advise if this will be a problem for source build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guessing this will be a problem but checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe this would be a problem. Features need to be source-buildable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add the reference to LanguageServer and MEF export the service there, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmat Can't add an editor features reference to the language server project.
I was thinking of moving it to the Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj, but it requires dependencies on C# types. While we do technically depend on csharp there, it really isn't supposed to have language specific dependencies. Same issue occurs if I wanted to link it to the Microsoft.CodeAnalysis.LanguageServer project. I can technically do it, but violates language agnostic terms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two options:
- Make this service language agnostic
- Add Microsoft.CodeAnalysis.LanguageServer.CSharp
I'd try [1] first. CSharpDecompiledSourceFormattingRule
can be moved to Features.CSharp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "this service" I mean the actual decompilation. Could be a new service.
The glue around it, which might be C# specific could be moved to Features.CSharp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated - moved the CSharp bits to CSharp.Features and added an abstraction over the decompilation, moved the actual decompilation implementation to LanguageServer.Protocol
7fef92a
to
66fc32b
Compare
namespace Microsoft.CodeAnalysis.CSharp.DecompiledSource | ||
{ | ||
[ExportLanguageService(typeof(IDecompilationService), LanguageNames.CSharp), Shared] | ||
internal class CSharpCodeDecompilerDecompilationService : IDecompilationService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Resolves dotnet/vscode-csharp#5969