Giter VIP home page Giter VIP logo

Comments (7)

ovatsus avatar ovatsus commented on July 20, 2024

What about this: if the base type is also in the project, but it has the omit flag, include its members

from fsharp.formatting.

ovatsus avatar ovatsus commented on July 20, 2024

@tpetricek I was trying to implement this, how can I get a FSharpEntity from a Type? FSharp.Entity exposes BaseType but not BaseEntity

from fsharp.formatting.

tpetricek avatar tpetricek commented on July 20, 2024

Not sure - perhaps @dsyme or other compiler service experts like @7sharp9 would know?

from fsharp.formatting.

7sharp9 avatar 7sharp9 commented on July 20, 2024

You can use the new API to get an F# representation of the assembly and then iterate through the members maybe?

from fsharp.formatting.

ovatsus avatar ovatsus commented on July 20, 2024

I'm new to both FCS and FSharp.Formatting, can you please explain a little bit better what you mean?

from fsharp.formatting.

 avatar commented on July 20, 2024

Use the NamedEntity property on FSharpType (the type may have GenericArguments).

In that API, NamedEntity could be better renamed to TypeDefinition. It is valid whether the type is a generic instantiation or not.

from fsharp.formatting.

ovatsus avatar ovatsus commented on July 20, 2024

Thanks, that works. But there's a problem, when there is no base type, .BaseType blows up (https://github.com/fsharp/FSharp.Compiler.Service/blob/5886727331041f4e00faf049b7cf52f6952ca55e/src/fsharp/vs/Typed.fs#L226), and there's no way to check beforehand (at least that I can find)

from fsharp.formatting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.