Open dungpa opened 10 years ago
I cannot build vs-tests branch:
L:\github\FSharpVSPowerTools\tests\TestUtilities\AzureUtility.cs(76,28,76,37): error CS1061: 'System.Management.Automation.PowerShell' does not contain a definition for 'HadErrors' and no extension method 'HadErrors' accepting a first argument of type 'System.Management.Automation.PowerShell' could be found (are you missing a using directive or an assembly reference?)
2>L:\github\FSharpVSPowerTools\tests\TestUtilities\AzureUtility.cs(95,28,95,37): error CS1061: 'System.Management.Automation.PowerShell' does not contain a definition for 'HadErrors' and no extension method 'HadErrors' accepting a first argument of type 'System.Management.Automation.PowerShell' could be found (are you missing a using directive or an assembly reference?)
1>C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets(155,9): error : Build was canceled.
OMG
This is definitely a VFPT/FCS bug. What will we do with it?
Same thing with the second sample
Trying to go to definition
Maybe something went really wrong with assembly references?
IGeneralOptionsPage
is defined in a C# project, Go To Definition will not work obviously.
FCS doesn't have correct information on tooltips in this case. We can't do anything to improve that.
Do you think FCS never gives a proper tooltip for C# namespaces? I suspect this is a special case.
I checked on my solution at work, tooltips for C# namespaces are shown correctly.
I consider this as a bug in FCS and we should not make a work around for it.
Shouldn't work around this. It would be good if we could create a standalone repro and report upstream.
I 've seen the same with Provided types:
//File1.fs
module MyModule
type MyProvidedType = XmlProvider<"...">
//File2.fs
module Usage
open MyModule // it is grayed... should not !
let (t: MyProvidedType.SomeGeneratedType) = ...
How about that one? (SchemaProvider)
EDIT: this comment contains deprecated information.
Please open a separate issue. We might have skipped symbols from provided types.
Actually this is the behavior of an old version of FS Power tools... Sorry for the noise guys, it was in my bug backlog for a long time!
@OkayX6 Well, it would be better to file the bug when it first appears. It's going to save us maintenance efforts in the long run :-).
Every F# file that I open thinks that ALL open statements are unused.
Hey question: is there a way we could avoid false positives, at the price of not graying some open statements?
@jtmueller this is how it's supposed to work.
@jtmueller I really appreciate if you could provide a minimal repro. If the internal state is corrupted, it will mark all open statements as unused. We should definitely fix that.
@dungpa I'll try to put together a minimal repro. So far I've just noticed that since the update every F# file in any project of a rather large solution greys-out all open statements and lights up the scrollbar. I haven't seen it work right anywhere, but I haven't taken the time to explore outside of my main solution. If it works in a trivial case, I'm going to have a hell of a time figuring out what's unique about my particular solution.
@jtmueller Try to delete all binaries and build the solution again. It should help.
Thanks Vasily, that did help - after I closed and restarted Visual Studio.
@vasily-kirichenko i got the same problem building another project.
the Powershell.HadErrors
property was added in powershell v3 (system.manangement.automation).
I installed powershell 3 and after that the project works, now visual studio resolve the reference using the 3.0.0.0 assembly instead of v 1.0.0.0.
Maybe is better to write it as 3.0.0.0 in the csproj, at least i can see i dont have the correct assembly referenced:
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
@dungpa you want a pr about that?
@enricosada Sure. Please do so.
1st repro:
2nd repro:
Link:
https://github.com/dungpa/PowerTools/blob/3ea3e5dea66231ef315ac50e6fbf2aafd933c3a4/tests/FSharpVSPowerTools.Tests/MockGeneralOptionsPage.fs
https://github.com/dungpa/PowerTools/blob/3ea3e5dea66231ef315ac50e6fbf2aafd933c3a4/tests/FSharpVSPowerTools.Tests/Mocks.fs
It might be the case that the AST walker doesn't go inside interface declarations.