BitFields icon indicating copy to clipboard operation
BitFields copied to clipboard

No "generate bitfield" in light bulb

Open fanoI opened this issue 8 years ago • 7 comments

Using the "usual" sample code:

    struct DoubleView
    {
        enum BitFields
        {
            Fraction = 11,
            Exponent = 52,
            Sign = 1,
        }
    }

In the light bulb is only suggested to move the type in a new file nothing else!

fanoI avatar Apr 27 '17 18:04 fanoI

Does the analyzer work? Do you get error on Bit1 x = 2? I supports only nuget 3 or higher, which means packages.conf isn't supported. Try using PackageReference in VS 2017 or project.json in VS 2015.

ufcpp avatar Apr 27 '17 23:04 ufcpp

Yes Bit as variable works it is the analyzer that does nothing! I'm using VS2017 so I imagine to have the last version of nuget...

fanoI avatar Apr 28 '17 06:04 fanoI

image

If you use packages.config as default package management format, change it to PackageReference. Even if you use the latest NuGet.exe, NuGet stays old behavior with csproj containing packages.config.

ufcpp avatar Apr 28 '17 08:04 ufcpp

Nothing to it does not work for me! Tried with a Net Framework and a Net Core Console application...

You StructRecord generator worked and it was similar so what is happening?

fanoI avatar Apr 28 '17 18:04 fanoI

umm...

It works in my environment: https://github.com/ufcpp/BitFields/tree/master/tests/TargetFrameworks (However, the BitFields suppots only netstandard1.0, net45, netcore1.0 or higher.)

It might be due to Visual Studio caches. Could you try removing .vs folder and restart Visual Studio?

ufcpp avatar Apr 29 '17 00:04 ufcpp

But the nuget package should not install an Analyzer too? I got on Bitfields a nothing else is this normal?

I had tried to compile it before you had done the NuGet package using the installer that where there... I've installed the .vsix plugin without obtaining nothing but maybe they have broken something?

fanoI avatar Apr 30 '17 13:04 fanoI

Today at least I can see the "generate bitfield" in the light bulb but a file with only "// B/5, G/5, R/5" is generated!

All seems correct to me:

nugetconfig

this is the project configuration:

projectconfig

any ideas?

Thank you!

fanoI avatar May 20 '17 15:05 fanoI