Skip to content

Conversation

alfonsogarciacaro
Copy link
Member

Inspired by @Booksbaum great contributions, I gave it a go at fixing #308. However I realized this breaks fragments/react/f2.fs because delegates cannot be inherited, so maybe we cannot use delegates at the end :/

let name = d.name.getText()
let asAlias() =
{
Comments = readCommentsAtLocation checker d.name
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to work, it doesn't get the comment in test/fragments/custom/delegate.d.ts. Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does work in my local copy:

/// This does something
type Delegate1 =
    delegate of arg1: float * ?optArg1: string * ?optArg2: string -> unit

But this uncovered an issue with testing: comments aren't checked to match in both files. Delegate1 in *.expected.fs doesn't contain the comment, while the generated *.fs file does. And yet the test passes.
(which makes sense for the header comment (// ts2fable 0.0.0), but not for xml comments)



When your using the web-app, check if your really using localhost:8080 and NOT https://fable.io/ts2fable/.
I'm definitely not writing this because that just happened to me....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right thanks! Actually I was just looking at the tests and wondered why it wasn't failing without the comment 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants