csharp-language-server
csharp-language-server copied to clipboard
"Generate overrides..." code action always fails
As reported here:
- https://github.com/emacs-lsp/lsp-mode/issues/3558
FYI @pro-anon
My project is just a standard ASP.NET Core with Identity btw. I was trying to override the OnModelCreating method
I think this action needs parameters to be passed to it and we don't provide any as LSP protocol does not AFAIK support this flow; lets see if we can provide some default values/parameters to the action so that something is generated by the code action sufficiently usefuly
at the moment GenerateOverridesCodeRefactoringProvider requires IPickMemberService (which is internal) to be injected but to mock it we need to do some run-time type building, probably using Castle.Proxy or something like that as the type is internal.. postponing this until IPickMembersService becomes public or this issue gets more attention.
I believe things should work as of https://github.com/razzmatazz/csharp-language-server/commit/bbe04d15c18f41f3c9a56da42fbc5a33209bf0dd (new version has not been released yet)
I have added some castle.core proxy overrides for internal roslyn types so those code actions should work with default selections (i.e. it will generate overrides for all virtual object members as there is no way to provide UI in LSP AFAIK)
I have released 0.5.6 on nuget which should fix the issue:
- https://www.nuget.org/packages/csharp-ls/0.5.6