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

feat: typescript, tsx, jsx support for LSP server using babel #1427

Merged
merged 4 commits into from
Mar 20, 2020

Conversation

acao
Copy link
Member

@acao acao commented Mar 14, 2020

  • introduces typescript, tsx and jsx support via babel parser plugins
  • feat: add support for more languages, starting with ReasonML #1263 by @zth is an alternative to solving this problem which also supports reasonml, and potentially other a non-ast branch by @zth using regular expressions should be reconsidered.
    -tests for typecript and tsx added
  • getQueryAndRange changed to parseDocument, and made override-able as parse by startServer.

@acao acao force-pushed the feat/jsx-ts-tsx-support branch 5 times, most recently from 691b8e3 to a00a6fe Compare March 15, 2020 00:28
@divyenduz
Copy link
Contributor

Does this do the same job as https://github.com/Quramy/ts-graphql-plugin?
If yes, are there any usage docs that I can refer to? 🤔

@acao
Copy link
Member Author

acao commented Mar 16, 2020

yes! the only difference now is that it will handle ts/tsx files when you open them. still need to get vscode workspaces configured correctly to read all the embedded graphql up front

@acao
Copy link
Member Author

acao commented Mar 17, 2020

to add, the typescript language plugin is still valuable for a lot of cases. this just replaces the need for it in the server

@acao acao changed the title feat: introduce typescript, tsx, jsx support to LSP server feat: introduce typescript, tsx, jsx support to LSP server using babel parser Mar 18, 2020
@acao acao changed the title feat: introduce typescript, tsx, jsx support to LSP server using babel parser feat: introduce typescript, tsx, jsx support to LSP server using babel parser, with tests Mar 18, 2020
@acao acao changed the title feat: introduce typescript, tsx, jsx support to LSP server using babel parser, with tests introduce typescript, tsx, jsx support to LSP server using babel parser, with tests Mar 18, 2020
@zth
Copy link
Contributor

zth commented Mar 18, 2020

This looks good to me! This will allow people who want to support other languages than the mainstream ones (like ReasonML for me) to do that through replacing parseDocuments. 👍

@acao
Copy link
Member Author

acao commented Mar 20, 2020

@zth last commit here fixes that bug i saw in discord, otherwise looks like everything is working fine! I've had some issues with setting up our example extension, but i think i understand what I'm missing after working with yours and @divyenduz 's more carefully.

note: I was not able to configure your graphql + reasonml extension to work with .ts or .tsx files to test this capability end to end, despite changing the clientOptions.documentSelector to follow the direction of others like vscode-graphql, but I can confirm this branch works great with both extensions.

@acao acao changed the title introduce typescript, tsx, jsx support to LSP server using babel parser, with tests feat: typescript, tsx, jsx support for LSP server using babel Mar 20, 2020
@acao acao merged commit ee06123 into master Mar 20, 2020
@acao acao deleted the feat/jsx-ts-tsx-support branch March 20, 2020 19:29
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.

None yet

3 participants