fsprojects-archive / zzarchive-VisualFSharpPowerTools

[ARCHIVED] Power commands for F# in Visual Studio
http://fsprojects.github.io/VisualFSharpPowerTools/
Apache License 2.0
310 stars 77 forks source link

Namespace for function attribute is grayed out if attribute does not have the "Attribute" suffix #1470

Closed jimfoye closed 5 years ago

jimfoye commented 7 years ago

This is on 2.5.0. I searched prior issues but may have missed it.

See screenshots, the code is the Remoting.fs module from the Websharper (4.0 beta) Client Server template, very slightly modified.

The only symbol belonging to the WebSharper namespace is the Remote attribute on the DoSomething function. If the attribute lacks the "Attribute" suffix, then of course it's perfectly OK for the compiler, but now the namespace is grayed out. I would think that the expected behavior is that it's not.

withsuffix

withoutsuffix

vasily-kirichenko commented 7 years ago

I cannot reproduce it:

open System

module M =
    type MyAttribute() =
        inherit Attribute() 

open M

[<My>]
type Foo() = class end

M in open M is not grayed out.

I suspect RemoteAttribute is defined in a auto open module, not directly in WebSharper?

jimfoye commented 7 years ago

No, it's just a type in the namespace WebSharper. Source is here:

https://github.com/intellifactory/websharper/blob/f55d3abd2da64fe4b643417961b0033d4373023a/src/compiler/WebSharper.Core/Attributes.fs

If I try your code it also works fine for me.

A quick way to reproduce this is to just create a new sitelet app (I did it with the Websharper 4.0 beta VS extension, AKA "Zafir"), then open the generated "Remoting.fs" file. I'm attaching a screenshot - I have not edited this code, as did for my original post.

_capture

vasily-kirichenko commented 7 years ago

ok, I'll look at it (and play with WS 4 as well :) )