Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update haxe.display #8610

Merged
merged 7 commits into from
Aug 6, 2019
Merged

Update haxe.display #8610

merged 7 commits into from
Aug 6, 2019

Conversation

Simn
Copy link
Member

@Simn Simn commented Aug 6, 2019

Have to sync this with vshaxe. This PR doesn't include the json-rpc protocol definitions because those depend on jsonrpc.Types. I suppose they can remain in vshaxe for now and maybe be externalized later.

PR also includes some adjustments to the server tests to demonstrate a use-case for these type structures.

@Simn Simn requested a review from Gama11 August 6, 2019 14:10
@Simn Simn self-assigned this Aug 6, 2019
var TypeParameter = "TTypeParameter";
}

enum abstract Platform(String) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be Target? Also related to other "platform" symbols here

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually we should sync the entire metadata section with the new src-json/meta.json content.

Copy link
Member

Choose a reason for hiding this comment

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

The problem is that metadata already has a target, but with a different meaning.

Copy link
Member

Choose a reason for hiding this comment

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

We can rename that one to appliesTo maybe?

Copy link
Member

Choose a reason for hiding this comment

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

compilationTarget, metaTarget

@Gama11
Copy link
Member

Gama11 commented Aug 6, 2019

This PR doesn't include the json-rpc protocol definitions because those depend on jsonrpc.Types.

Not sure it's a good idea to split them up, they kind of belong together. I think it would just come down to making HaxeRequestMethod HaxeNotificationMethod abstracts themselves, instead of typedefs to their jsonrpc counterparts?

@Simn
Copy link
Member Author

Simn commented Aug 6, 2019

I'm not sure. The type definitions can exist without the json-rpc methods, which are built on top of them. In that sense it's fair that the type definitions are in std, while the json-rpc parts are not.

Not sure what you mean regarding abstracts.

@Gama11
Copy link
Member

Gama11 commented Aug 6, 2019

Well, RequestMethod / NotificationMethod are the only things needed from the jsonrpc lib, and there's really not a lot to them: https://github.com/vshaxe/vscode-json-rpc/blob/master/src/jsonrpc/Types.hx#L101-L109

So the Haxe types could be turned into abstracts themselves instead of being typedefs to those.

@Simn
Copy link
Member Author

Simn commented Aug 6, 2019

Right, but they still belong to jsonrpc more than they belong to haxe.display. But maybe I'm overthinking this.

@Gama11
Copy link
Member

Gama11 commented Aug 6, 2019

It's really just a trick to attach some type parameters to a String. And that String definitely belongs to haxe.display, because you need to know what the identifier of the method you want to call is.

What you're doing instead right now is hardcoding that string in the test ("display/completion").

@Simn
Copy link
Member Author

Simn commented Aug 6, 2019

Ok I misunderstood what you meant. We can turn HaxeRequestMethod into an abstract and then it fits nicely indeed.

@Simn
Copy link
Member Author

Simn commented Aug 6, 2019

done

@Simn Simn merged commit 8a603ba into development Aug 6, 2019
@Simn Simn deleted the update-haxe.display branch August 6, 2019 16:09
Gama11 added a commit that referenced this pull request Aug 12, 2019
#8610 must have been based on a slightly outdated version of Display.hx
Gama11 added a commit to vshaxe/haxe-language-server that referenced this pull request Aug 12, 2019
Gama11 added a commit to vshaxe/vshaxe that referenced this pull request Aug 12, 2019
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.

4 participants