Closed CollinAlpert closed 2 years ago
Since SourceGenerators are fairly new, maybe a feature request or bug report to VS 2022 and Rider is in order?
Yes, I'm currently working on a minimal repro.
Actually I can't reproduce this issue in Rider anymore. Must be specific to VS 2022 and I am kind of hoping that it will fix itself. I will still keep an eye on this, though.
I am actually experiencing the same issue with latest rider [JetBrains Rider 2021.3.2]
Interesting. The past few days it has been on and off for me as well. I will write up a bug ticket for ReSharper this week.
I think I am getting closer to diagnosing this issue. My current implementation of the Source Generators throws an exception when code cannot be generated (e.g. when a partial
modifier is missing). This seems to cause issues in the IDE (see https://youtrack.jetbrains.com/issue/RIDER-74077). I will remove the thrown exceptions and replace them with Roslyn Analyzers. Hopefully this will solve the problem.
I think I am getting closer to diagnosing this issue. My current implementation of the Source Generators throws an exception when code cannot be generated (e.g. when a
partial
modifier is missing). This seems to cause issues in the IDE (see https://youtrack.jetbrains.com/issue/RIDER-74077). I will remove the thrown exceptions and replace them with Roslyn Analyzers. Hopefully this will solve the problem.
in this https://github.com/CollinAlpert/Lombok.NET/issues/3#issuecomment-1021021082
the class is already partial
. are you sure it is related to this ?
The problem is not being the class being partial or not, but the generator throwing an exception (e.g. when the partial modifier is removed for a short period of time) and then Rider/ReSharper never recovering from that.
I can reproduce this. Create a new project, everything works fine until your remove and add the partial modifier. Then it stops working.
So it seems my recent changes haven't much effect either. I finally managed to create an issue for Rider: https://youtrack.jetbrains.com/issue/RIDER-74469
Fixed in ee788bb01a6e62eaa1bf5923853479b0b57a6241.
Lombok 1.2.2 version. vs2022 17.35 version build is sucessful and exe can run。but show some error。 IntelliSense does not recognize?
@tianmafly There are some IntelliSense issues around Source Generators in Visual Studio and Rider. Can you try closing and reopening the solution? Does the error persist after that?
@CollinAlpert Close and reopen the solution, the error persist.
Can you send me a reproduction?
I new create a simple solution,it is ok. The solution I am using is complex, maybe some nuget package conflict?
@tianmafly Is your solution on GitHub so that I could take a look?
sorry, it is not in GitHub. It is private project of company.
No worries. I am, however, going to need some form of reproduction to be able to diagnose an issue. I use this library in many larger projects and have not seen any major issues with IntelliSense so far.
Generated code with the
NoArgsConstructor
,AllArgsConstructor
andRequiredArgsConstructor
attributes does not get picked up by IntelliSense. The constructors can be used and the build passes without issues, however it would be nice if IntelliSense also recognized a presence of the generated constructors. This issue is observed in Visual Studio 2022 as well as Rider 2021.3.2.