meziantou, to dotnet
@meziantou@hachyderm.io avatar
bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Anybody know when we get the #Roslyn 4.10 NuGet packages (like Microsoft.CodeAnalysis)?

I'm assuming they're going to follow the "even" pattern and declare 17.10 as LTSC, which means I will want to officially support Roslyn 4.10. Both of these pages are currently out of date:

https://learn.microsoft.com/en-us/visualstudio/productinfo/vs-servicing

https://learn.microsoft.com/en-us/visualstudio/extensibility/roslyn-version-support?view=vs-2022

#dotnet

bradwilson, to random
@bradwilson@mastodon.social avatar

Oh no, it seems like the #Roslyn analyzer support in Visual Studio 2022 17.10 is broken.

Previously when you changed the target selector in the drop-down (see the screenshot), the analyzers would only show issues related to that target. Now it's showing all analyzer issues related to all targets, all the time.

This makes it almost impossible for me to interactively test how my analyzers work for a given target.

Hope there's a way for me to undo this somehow.

bradwilson, (edited ) to dotnet
@bradwilson@mastodon.social avatar

If I'm writing an analyzer to say "stop doing X in xUnit.net v2 because it's been removed in v3", should that be INFO or WARNING by default?

#dotnet #csharp #roslyn #RoslynAnalyzers

xunit, to dotnet
@xunit@dotnet.social avatar

We just shipped v2 Core Framework 2.7.1, Analyzers 1.12.0, and Visual Studio adapter 2.5.8. This includes a few new assertion overloads, four new #Roslyn analyzers (and two new suppressors), and a handful of bug fixes.

Enjoy!

Release notes:

https://xunit.net/releases/v2/2.7.1
https://xunit.net/releases/analyzers/1.12.0
https://xunit.net/releases/visualstudio/2.5.8

#dotnet #csharp #fsharp #unittest #tdd

bradwilson, to CSharp
@bradwilson@mastodon.social avatar

I want to see if it's possible to replace runtime reflection in @xunit v3 with #Roslyn source generators (for better performance and to support NativeAOT), but I think I've already hit the first blocking point: no support for #FSharp? Only #CSharp and #VB? #dotnet

robrich, to dotnet
@robrich@hachyderm.io avatar

https://github.com/KirillOsenkov/RoslynQuoter - given some code, get the code to generate it. This is brilliant @KirillOsenkov.

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

I have taken to doing something I normally don't like. The analyzer tests for @xunit are out-of-our-control slow because of the time spent to invoke #Roslyn and get the results from the analyzer.

So I've been combining tests that might've been separate, with "this line is bad, these lines are fine" by way of putting them all in one test, but only expecting a subset to trigger the diagnostic. 😣

Example: https://github.com/xunit/xunit.analyzers/blob/01f4b5f74e81efb5b3e2141ded37a6fef6ae59eb/src/xunit.analyzers.tests/Analyzers/X1000/DoNotUseBlockingTaskOperationsTests.cs#L27-L45

#dotnet #csharp #analyzers

bradwilson, to random
@bradwilson@mastodon.social avatar

CI build time climb when introducing multiple #Roslyn version support for @xunit #analyzers. ⏱️

bradwilson, to random
@bradwilson@mastodon.social avatar

The hardest part about writing #Roslyn analyzers is that you only think you know where all the edge cases are, but they let people type literally anything into an IDE these days. 😭😂

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

There is an unfortunate side-effect of writing #Roslyn #Analyzers with respect to compatibility.

The @xunit analyzers target Microsoft.CodeAnalysis 4.2.0 because that's what in VS 2022 17.2, which is currently still in LTS support.

CodeAnalysis 4.2.0 doesn't support C# 12. There are analyzers that are broken because of this, when used with C# 12 language features, and we can't fix them unless we're willing to throw away compatibility with everything before VS 2022 17.8.

#dotnet #csharp

xunit, to dotnet
@xunit@dotnet.social avatar

The next release of xunit.analyzers will move the minimum version of VS 2022 to 17.2. We currently have VS 2022 RTM as the minimum, but Microsoft stopped supporting RTM in July of this year. https://learn.microsoft.com/en-us/visualstudio/productinfo/vs-servicing#long-term-servicing-channel-ltsc-support

#dotnet #roslyn #analyzer

bradwilson, to random
@bradwilson@mastodon.social avatar

#Roslyn gripe:

Why doesn't editor.ReplaceNode() take a collection of nodes to use as a replacement? Instead I have to write:

editor.InsertAfter(oldNode, newNodes);
editor.RemoveNode(oldNode);

And then as a bonus, it destroys some of the trivia along the way (like deleting a blank line that it shouldn't delete). (That part may be my fault, I haven't figured out whether I've actually fixed my other bug yet.)

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

I think I'd expect the call to ReplaceNode to have failed if it wasn't able to replace the node, but Roslyn isn't always helpful in that regard. Normally I'd dig into this in the debugger via the unit test, but the unit test passes. So I'm a bit stumped about what to do next. I'm not sure how to debug this indirectly (i.e., let it fail "for real" inside Visual Studio and debug it there), since it doesn't actually throw in a catchable way.

Any Roslyn experts here?

3/3 #dotnet #roslyn #analyzer

cincura_net, to CSharp
@cincura_net@mas.to avatar

Blogged: WUG: Na co mám/můžu použít Roslyn (Olomouc)

https://www.tabsoverspaces.com/id/233926

khalidabuhakmeh, to CSharp
@khalidabuhakmeh@mastodon.social avatar

TIL that #csharp source generators can generate design time AND compile time artifacts independently. 🤯 #roslyn #dotnet

khalidabuhakmeh, to CSharp
@khalidabuhakmeh@mastodon.social avatar

When creating a #csharp #roslyn analyzer, On the DiagnosticDescriptor, you can set a helpLinkUri property that will help folks understand the reasoning behind the analyzer.

Tools like #JetBrainsRider will surface the link in the UI. #dotnet

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

Just so many little improvements in the latest #JetBrainsRider bring me so much joy. The way #Roslyn source generators and analyzers look in the solution view is one of them. #dotnet

maartenballiauw, to dotnet
@maartenballiauw@mastodon.online avatar

How do you debug #dotnet source generators? 🤔🪲

In this post by @khalidabuhakmeh, learn how to debug generated sources, as well as the source generator itself – with the debugger, and with snapshot testing.

https://jb.gg/8zeywx

#csharp #roslyn #sourcegenerators #debugger #JetBrainsRider

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Having one of those "what the heck is wrong?!" moments.

I wrote a Roslyn analyzer. Tests work great.

I wrote the fixer for that diagnostic reported above. Test fails. Set breakpoints, and RegisterCodeFixesAsync never gets called, despite being set for the same descriptor. Same pattern I use with every other fixer, but this one is just silently... not doing anything.

Very confused and frustrated right now. Might have to ship this analyzer without a fix. #dotnet #csharp #Roslyn #CodeAnalysis

image/png
image/png
image/png

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

So far, the big-ticket items for #dotnet 8 seem to be:

  • C# 12 language enhancements
  • Authentication changes
  • Blaaaaaaaaaaaaaaaaaaaaaazor updates, #blazor
  • Ahead of Time compilation (AOT) and trimming
  • Roslyn, Roslyn, #Roslyn (analyzers)

Smaller items:

  • Rate limiting fixes/improvements
  • Linux package acquisition
  • More OTel
  • Host Improvements (Host)
  • Low-level intrinsic enhancements
  • NuGet improvements
FlashOWare, to programming

We're continuing our journey of building a #Roslyn-based #dotnet tool that globalizes #CSharp using directives.

Tune in on Wednesday, 07 June at 17:00 UTC on either our Twitch or YouTube channel.

#2codeOrNot2code

https://www.youtube.com/watch?v=dUbnuY6Pp4s

FlashOWare, to programming

Episode 08 of #2codeOrNot2code is coming up!

We complete the #CSharp local using directive counter of our #dotnet tool and start to globalize top-level usings with #Roslyn.

https://www.youtube.com/watch?v=vJHDnuefqk0

JGraber, to random
  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines