Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:04
    msftbot[bot] commented #48906
  • 00:04
    dotnet-bot labeled #48906
  • 00:04
    dotnet-bot labeled #48906
  • 00:04
    dotnet-bot labeled #48906
  • 00:04
    dotnet-bot review_requested #48906
  • 00:04
    dotnet-bot review_requested #48906
  • 00:04
    dotnet-bot review_requested #48906
  • 00:04
    dotnet-bot review_requested #48906
  • 00:04
    dotnet-bot review_requested #48906
  • 00:04
    dotnet-bot opened #48906
  • 00:04

    dotnet-bot on master-to-features

    (compare)

  • 00:04
    msftbot[bot] commented #48905
  • 00:04
    dotnet-bot assigned #48905
  • 00:04
    dotnet-bot assigned #48905
  • 00:04
    dotnet-bot labeled #48905
  • 00:04
    dotnet-bot labeled #48905
  • 00:04
    dotnet-bot review_requested #48905
  • 00:04
    dotnet-bot review_requested #48905
  • 00:04
    dotnet-bot review_requested #48905
  • 00:04
    dotnet-bot review_requested #48905
Yair Halberstadt
@YairHalberstadt
Put them in a library and reference a library
There's a seperate compilation for each project
So seperate SourceGenerator runs
stefanloerwald
@stefanloerwald
So you would separate that into two packages?
Yair Halberstadt
@YairHalberstadt
Or one
You can package a library and an analyzer into one package
Bit painful, but once you've worked it out it works well.
This is the magic bit:
    <ItemGroup>
        <None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="tools" />
        <None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
    </ItemGroup>
stefanloerwald
@stefanloerwald
If I understand that right, it then has the assembly both as library and analyzer in the same package?
Yair Halberstadt
@YairHalberstadt
Correct
stefanloerwald
@stefanloerwald
Cool, then I should be able to simply move the attributes out of generated code.
Since you're around at the moment: I've based my unit tests on your StrongInject project. Is that unit test code easy to adapt to analyzer unit tests? Could you perhaps give me a pointer?
Antony Male
@canton7
@YairHalberstadt Yeah, that's the question. I'm unclear on when diagnostics from SGs will be raised at the moment -- if I can get them while typing with an analyzer, that might be a better experience. Also potentially code fixes.
@YairHalberstadt Is there any point in tools\*.ps1 for SGs? I was wondering whether that was just for legacy editors, which were unlikely to support SGs anyway...
Joseph Musser
@jnm2
tools\*.ps1 is specifically for analyzers to support VS2015 IIRC
I think I read that in docs but I'm not sure where
Since VS2015 doesn't support source generators I would guess there is no benefit
Yair Halberstadt
@YairHalberstadt
I'll delete it and see what happens
@stefanloerwald I don't know, as I've never written an analyzer :-)
Echo-8-ERA
@Echo-8-ERA
Is there any documentation for the syntax of *.il files?
Joseph Musser
@jnm2
Specifically start at "II.5 General syntax" on PDF page 135
The printed page numbers are off by 26, ignore them
Martin Vseticka
@MartyIX
dotnet/roslyn#48686 - Is this a part of some larger attempt to remove xunit from Roslyn or only housekeeping stuff? I'm asking because there does not seem to be too much development in https://github.com/xunit/xunit repo.
Yair Halberstadt
@YairHalberstadt
@MartyIX I think that's specific to the console.
Xunit is a mature unit testing framework. I wouldn't expect there to be a huge amount of development. Once it works, it works.
Joe4evr
@Joe4evr
ah, I was like " :eyes: that sounds weird, because when I do dotnet test it runs xUnit just fine"
stefanloerwald
@stefanloerwald
Is it possible to include third-party-packages in SGs? I want to do something similar to the CSV example, but with XSLX. I get FileNotFoundException on the dlls though...
Yair Halberstadt
@YairHalberstadt
@stefanloerwald not easily. I think it is possible, but ask @jmarolf
stefanloerwald
@stefanloerwald
Nevermind, I worked it out. There was some more csproj magic to insert..
Martin Vseticka
@MartyIX

@MartyIX I think that's specific to the console.

I wasn't sure. Thanks for clarifying

Echo-8-ERA
@Echo-8-ERA
Huo Yaoyuan
@huoyaoyuan
Is there any handful tool to visualize bound tree? I'm debugging and learning lowering.
CyrusNajmabadi
@CyrusNajmabadi
not that i know of
look for a Dump method
like:
        internal virtual string Dump()
        {
            return MyTreeDumper.DumpCompact(BoundTreeDumperNodeProducer.MakeTree(this));
        }
Huo Yaoyuan
@huoyaoyuan
image.png
wow, i've made simple emit test passing
Joe4evr
@Joe4evr
:tada:
CyrusNajmabadi
@CyrusNajmabadi
nice!
that's awesome!
Huo Yaoyuan
@huoyaoyuan
facing an implementation question here
i'm using ConditionalOperator to represent lowered await?, but it doesn't work for void-returning
?. uses a construction directly supported by emitter
if is a statement, not expression
Huo Yaoyuan
@huoyaoyuan
well, it's ok to special-casing await in RewriteStatementExpression, but i'm not sure if it's architecturally correct
Huo Yaoyuan
@huoyaoyuan
well, it seems that ConditionalOperator does support void
Huo Yaoyuan
@huoyaoyuan
i think i've make it work and generates runnable result. now i need help for nullable walker. it should borrow things from conditional access, but NullableWalker.VisitConditionalAccess looks very complex(saving state for current conditional access id).