-
Notifications
You must be signed in to change notification settings - Fork 470
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
Dart support for vscode-apollo and language-server #1385
Dart support for vscode-apollo and language-server #1385
Conversation
@venkatd: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
9d6c545
to
47d3628
Compare
packages/vscode-apollo/package.json
Outdated
"injectTo": [ | ||
"source.dart" | ||
], | ||
"scopeName": "inline.dart.python", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is wrong. You'd need it to be inline.graphql.dart
. That fixed the highlighting issue for me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️thanks for finding that! I ran the extension in debug mode with this change and everything worked.
@JakeDawkins looks like it all works when running in debug mode now :). When I build the
Could it be a conflict with running |
@venkatd I ran the same thing and it worked for me! You may need to uninstall any existing version of the extension and delete the extension cache for the install to work properly. At least if the VSIX file that's being generated is the same as a version you've previously installed.
|
@JakeDawkins thanks, I got it working! Cleared my cache, re-cloned the repo, and basically wiped the slate clean. I see now there are some merge conflicts. What's the preferred way to address them? Should I merge master into my branch or rebase? |
@venkatd If you could rebase this, that'd be great! |
6f5ce92
to
732c679
Compare
732c679
to
1b54e5d
Compare
@JakeDawkins just rebased and tested it out with a built .vsix extension again. Let me know if there's anything else needed before merge! |
Thanks so much for the work (and the patience) @venkatd! Just released with v1.9.0 of the extension! |
@JakeDawkins thanks for the guidance along the way and glad it's in the new release! Just tried the official upgrade all looks to be working. |
Tell me how to set it up? |
@AlexKenbo the dart-specific setup just requires you to define a function like this: String gql(String query) => query; Because it will interpret anything like so as GraphQL: gql("""
query getData {
...
}
""") |
This resolves #1365.
Similar to how python handles this, adding support for graphql syntax highlighting and code completion using a basic function.
Screenshot of it in action:
I need a bit of guidance on building and testing the extension locally (including the language server). What's the process developers are typically using on
vscode-apollo
?In order to test the functionality out, I patched the extension and language server directly in
/Users/venkat/.vscode/extensions/apollographql.vscode-apollo-1.7.4
. Then I applied those same changes to this repo. However I'd like to double check it all works.