Skip to content

Changes in generated Proto types are not detected until nvim is restarted #263

@markvincze

Description

@markvincze

If I create a .NET project which has a <Protobuf> file reference, for example by scaffolding a gRPC service like this:

dotnet new grpc

Then open the solution folder with nvim, go to the greet.proto file, and do a change, for example rename the service Greeter to Greeter2. Then in a separate terminal I build the solution with dotnet build (which prints a build error as expected, because the type name in GreeterService.cs does not match the changed service name in the proto contracts.
But if I go back to nvim, and open GreeterService.cs, it does not yet show the build error. And the autocomplete is also still showing the old Greeter name.
If I restart nvim, then I get the build error being shown correctly, and the autocomplete shows the new type name.
(The change also gets detected if I don't restart nvim, but do :Roslyn restart.)

Has anyone encountered this issue before or knows how it could be fixed? In VsCode the same situation is handled correctly, the changes show up in the editor right away without needing to restart it.

(I believe that the types generated for the proto contracts are located in the obj folder of the project, in files with paths like obj/Debug/net9.0/Protos/GreetGrpc.cs.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions