Skip to content
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

Missing Cake Response handlers in V1.37.1 #1939

Closed
THeivers opened this issue Sep 13, 2020 · 4 comments · Fixed by #1944
Closed

Missing Cake Response handlers in V1.37.1 #1939

THeivers opened this issue Sep 13, 2020 · 4 comments · Fixed by #1944
Assignees

Comments

@THeivers
Copy link

THeivers commented Sep 13, 2020

Seems version 1.37.1 broke some actions in Cake scripts, such as "/completion". Trying a completion action returns this in debug:
[dbug]: OmniSharp.Stdio.Host ************ Response ************ { "Request_seq": 19, "Command": "/completion", "Running": true, "Success": false, "Message": "\"System.NotSupportedException: Cake does not support /completion\\r\\n at OmniSharp.Endpoint.EndpointHandler2.d__20.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 233\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Endpoint.EndpointHandler2.<Process>d__16.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 131\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Stdio.Host.<HandleRequest>d__13.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Stdio\\\\Host.cs:line 215\"", "Body": null, "Seq": 704, "Type": "response" }

Seems like versions below 1.37.1 seem to be unaffected.

After some local debugging, it seems like all it needs is two more CakeRequestHandlers that deal with the specific requests, and reroute them to the C# handlers like so:

[OmniSharpHandler(OmniSharpEndpoints.Completion, Constants.LanguageNames.Cake), Shared]
    public class CompletionHandler : CakeRequestHandler<CompletionRequest, CompletionResponse>
    {
        [ImportingConstructor]
        public CompletionHandler(OmniSharpWorkspace workspace)
            : base(workspace)
        {
        }
    }

    [OmniSharpHandler(OmniSharpEndpoints.CompletionResolve, Constants.LanguageNames.Cake), Shared]
    public class CompletionResolveHandler : CakeRequestHandler<CompletionResolveRequest, CompletionResolveResponse>
    {
        [ImportingConstructor]
        public CompletionResolveHandler(OmniSharpWorkspace workspace)
            : base(workspace)
        {
        }
    }

But I'm not that familiar with the code base, it's likely some other commands were broken too.

@THeivers THeivers changed the title Missing Cake Response handlers in V1.23.2 Missing Cake Response handlers in V1.37.1 Sep 13, 2020
@bjorkstromm bjorkstromm self-assigned this Sep 14, 2020
@bjorkstromm
Copy link
Member

Thanks! I'll fix this asap. Seems like I forgot to take the new Completion Service into use in Cake also. This is now the default in VSCode, making Completion not working for Cake files.

@filipw
Copy link
Member

filipw commented Sep 14, 2020

there are new endpoints /completion and /completion/resolve that replaced the old /autocomplete
Additionally, there is a new endpoint /quickinfo which is also in use in VS Code already for tool tips https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Abstractions/OmniSharpEndpoints.cs#L48

@bjorkstromm
Copy link
Member

@filipw thanks! I'll add overloads for Cake for all of those then.

@bjorkstromm
Copy link
Member

Adds Completion in #1944
Adds QuickInfo in #1945

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants