JetBrains/resharper-fsharp

Repro of DEXP-576424

NinoFloris opened this issue · 12 comments

Notice specifically Sdk="Microsoft.NET.Sdk.Web" which enables the mvc analyzer.

The analyzer seems to unconditionally run for every referenced method once any project in the project graph enables this analyzer. In our large solution we only have one Sdk.Web project which is not depended on, instead it only depends on projects (one of these projects contains the full version of the following repro).

Once the mvc analyzer is loaded opening any file that transitively depends on the file that contains this code pattern will trigger the exception through the mvc analyzer, every time such a file is opened.

Quite surprising to see it runs over all of that code.

Repro:

Project file:

<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Library.fs"/>
  </ItemGroup>

</Project>

Then a very F# specific code pattern triggers the error, two extension methods where one method refers to a static extension method.

Library.fs:

namespace ClassLibrary1

type M() = class end

// both need to be extension methods, and the called method must be static 
module Ext =
    type M with
        // must take an argument
        static member First(x: obj) = ()
        // must call First
        member _.Second() = M.First null

@NinoFloris Thanks for the detailed repro, I've already fixed the exception itself. I'm going to look what could be done about the analyzer too.

The analyzer seems to unconditionally run for every referenced method once any project in the project graph enables this analyzer. In our large solution we only have one Sdk.Web project which is not depended on, instead it only depends on projects (one of these projects contains the full version of the following repro).

So, if project B is an Sdk.Web project and references project A, it'll also throw when opening files from A?

Correct, probably because you could move your mvc models to a shared core lib and still want those to be recognized. However for F# projects I can't remember ever seeing this analyzer showing me additional info/actions. (Yet apparently it runs anyway)

Did 5931ed5 make it into EAP 8? I expect not as I still see the error pop up quite often. @auduchinok do you know when it will drop?

Oh, that's another one. Thanks @NinoFloris!

@auduchinok it's still there in EAP 10, I guess the issue will make it into the release build?

I think https://youtrack.jetbrains.com/issue/RIDER-60765 and https://youtrack.jetbrains.com/issue/DEXP-577741 (which I just reported) are both related, not sure if you got to either by any chance.

Another one, this plugin is driving me crazy.
https://youtrack.jetbrains.com/issue/DEXP-561480

@auduchinok any way of disabling it?

I think https://youtrack.jetbrains.com/issue/RIDER-60765 and https://youtrack.jetbrains.com/issue/DEXP-577741 (which I just reported) are both related, not sure if you got to either by any chance.

@NinoFloris I've these two exceptions yesterday, looking at the others now.

@auduchinok any way of disabling it?

Sorry, nothing I could suggest. Hopefully it'll be fixed soon, and I'll be able to issue a plugin update.

I've just fixed the rest of the exceptions. We've also chatted with R# team about this analyzer, and it'll be turned off until we properly implement some missing pieces for F#.

Thanks again for reporting it!

Thanks a lot @auduchinok :) looking forward to the next eap