Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:11
    nschuessler commented #52376
  • 13:10
    nschuessler commented #52376
  • 13:04
    nschuessler commented #52376
  • 12:08
    dotnet-issue-labeler[bot] labeled #52570
  • 12:08
    dotnet-maestro[bot] review_requested #52570
  • 12:08
    dotnet-maestro[bot] opened #52570
  • 12:08

    dotnet-maestro[bot] on darc-main-e832c643-994f-467b-b307-f0c2da88355f

    Update dependencies from https:… (compare)

  • 12:08

    dotnet-maestro[bot] on darc-main-e832c643-994f-467b-b307-f0c2da88355f

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

  • 12:01

    dotnet-bot on release

    (compare)

Yacoub Massad
@yacoubmassad_gitlab
:D why?
CyrusNajmabadi
@CyrusNajmabadi
instead, use the checksum the document returns
because we definitely do not guarantee those VersionStamps will be the same
VerionStamp is a bad name
i'ts more like 'MonotonicallyIncreasingEventOrder'
it helps us linearize a sequence of events to get a consistent ordering of things.
Yacoub Massad
@yacoubmassad_gitlab
When you say "document returns" do you mean like SHA1 hash of document text? or like object.GetHashCode?
CyrusNajmabadi
@CyrusNajmabadi
Document.GetTextAsync()
SourceText.GetChecksum()
Yacoub Massad
@yacoubmassad_gitlab
How unique is that?
CyrusNajmabadi
@CyrusNajmabadi
it's a sha1 hash of the file.
Yacoub Massad
@yacoubmassad_gitlab
Ok. Thanks
CyrusNajmabadi
@CyrusNajmabadi
if you had 100k files, it's something like a 1 in 10^40 chance of collision.
Yacoub Massad
@yacoubmassad_gitlab
That is good enough
Bernd Baumanns
@bernd5
Hey guys
is there a way to display / show generated code produced by source generators in visual studio?
Antony Male
@canton7
Yep -- under references, your source generator, keep clicking the +'s
Bernd Baumanns
@bernd5
that's it 👍
jods
@jods4
Popquizz: Given that x is int?, VS suggests that I change if (!(x is int y)) into if (x is not int y).
Do you see why that's not the same and introduces a bug?
And is there a reason for this C# behavior? I was really surprised.
Bernd Baumanns
@bernd5
what error message do you get?
it should work without the designation "y"
Bernd Baumanns
@bernd5
is it possible to use nuget packages in source generators? At runtime I get "FileNotFoundException" assembly xy not found...
Joe4evr
@Joe4evr
pretty sure any nuget you declare in your generator's package should just get pulled in by a consumer
jods
@jods4
@bernd5 there is no error message but y behaves strangely
jods
@jods4
int? x = 4;
if (!(x is int y)) return;
// y == 4 here
if (x is not int y) return;
// y == 0, uninitialized here
Antony Male
@canton7
They look pretty indentical: SharpLab
Updated for your example: link
Bernd Baumanns
@bernd5
Or here:
nothing strange
jods
@jods4
@canton7 interesting!
Was this a C# bug that was fixed in some release?
Antony Male
@canton7
I vaguely remember there being a bug around 'is not' at some point in the past, but I can't remember what
Nobuyuki Iwanaga
@ufcpp
jods
@jods4
Thanks, that's it.
I tested on my machine in C# interactive 3.9 and they're the same
My colleague has C# interactive 3.8 and he has the bug
Antony Male
@canton7
Thanks @ufcpp! I tried to find it but my searching skills obviously aren't up to scratch
jods
@jods4
The ticket says it's fixed for 16.9 but that's VS release.
Is there an easy way to know if the version on our CI servers is patched?
Antony Male
@canton7
Looking at the merge commit dotnet/roslyn@36496e1, the earliest tag it's in is v3.9.0. I have no idea how to map that to a .NET SDK version number though
Bernd Baumanns
@bernd5
while debugging my source generator project I still get:
System.IO.FileNotFoundException: "Die Datei oder Assembly "Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden."
this is the German version of the error message ...
jods
@jods4
@canton7 Thanks.
Bernd Baumanns
@bernd5
do I have to create a nuget package to use code from 3rd party nuget packages?
Yair Halberstadt
@YairHalberstadt
From 3rd party nuget packages you've got to pack them into the analyzers directory of the nuget package
Bernd Baumanns
@bernd5
is there a full sample?
e.g. with Newtonsoft
with both generator and using project
Yair Halberstadt
@YairHalberstadt
Try adding this to your csproj maybe:
    <ItemGroup>
        <None Include="$(OutputPath)\netstandard2.0\Newtonsoft.Json.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
    </ItemGroup>