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

🐛 .net: handle all progress messages we might see #669

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external-providers/dotnet-external-provider/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ USER root
RUN microdnf -y install dotnet-sdk-7.0 go-toolset \
&& microdnf clean all \
&& rm -rf /var/cache/yum
RUN dotnet tool install --global csharp-ls
RUN dotnet tool install --global csharp-ls --version 0.11.0
ENV PATH="$PATH:/opt/app-root/.dotnet/tools:/home/go/bin"
USER default
EXPOSE 3456
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN go build -o bin/dotnet-external-provider.exe main.go

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8

RUN dotnet tool install --global csharp-ls --version 0.13.0
RUN dotnet tool install --global csharp-ls --version 0.11.0

# Set the working directory inside the container
WORKDIR C:/app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,24 +257,23 @@ type handler struct {
func (h *handler) replyHandler(ctx context.Context, reply jsonrpc2.Replier, req jsonrpc2.Request) error {
method := req.Method()
h.log.Info("Got request for " + method)
// params, _ := req.Params().MarshalJSON()
switch method {
case protocol.MethodClientRegisterCapability:
err := reply(ctx, nil, nil)
// h.ch <- 1
return err
case protocol.MethodWorkspaceConfiguration:
err := reply(ctx, nil, nil)
// h.ch <- 2
return err
case protocol.MethodWindowShowMessage:
var showMessageParams protocol.ShowMessageParams
if err := json.Unmarshal(req.Params(), &showMessageParams); err != nil {
return reply(ctx, nil, err)
}
err := reply(ctx, nil, nil)
if strings.HasSuffix(showMessageParams.Message, "project files loaded") || strings.Contains(showMessageParams.Message, "finished loading solution") {
h.ch <- 3
if strings.HasSuffix(showMessageParams.Message, "project files loaded") ||
strings.HasSuffix(showMessageParams.Message, "project file(s) loaded") ||
strings.Contains(showMessageParams.Message, "finished loading solution") {
h.ch <- 1
}
return err
case protocol.MethodProgress:
Expand All @@ -287,7 +286,9 @@ func (h *handler) replyHandler(ctx context.Context, reply jsonrpc2.Replier, req
valueMap, _ := methodProgressParams.Value.(map[string]interface{})
if message, ok := valueMap["message"]; ok {
h.log.Info("Extracted message", "message", message)
if strings.Contains(message.(string), "finished loading solution") {
if strings.HasSuffix(message.(string), "project files loaded") ||
strings.HasSuffix(message.(string), "project file(s) loaded") ||
strings.Contains(message.(string), "finished loading solution") {
h.ch <- 3
}
} else {
Expand Down
Loading