Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

Extension not associated with .graphqls files #176

Closed
cailloumajor opened this issue Apr 25, 2020 · 10 comments · Fixed by #211
Closed

Extension not associated with .graphqls files #176

cailloumajor opened this issue Apr 25, 2020 · 10 comments · Fixed by #211
Labels
enhancement New feature or request graphql-language-service issues that can only be solved by updating the graphql language service

Comments

@cailloumajor
Copy link
Contributor

Actual Behavior

While this extension supports .graphqls files, Visual Studio Code is not aware of it.

Expected Behavior

Associate this extension with .graphqls files.

Steps to Reproduce the Problem Or Description

Open a .grapphqls file:

  • without this extension installed, it is not recommended at all by Visual Studio Code
  • with this extension installed, the file is not associated nor handled by the extension

Specifications

  • GraphQL for VSCode Extension Version: 0.2.14
  • VSCode Version: 1.44.2
  • OS Name: Debian GNU/Linux
  • OS Version: bullseye/testing

Logs Of TS Server || GraphQL Language Service

Not relevant

@acao
Copy link
Member

acao commented Aug 23, 2020

this extension loads .graphql files. i have never seen the .graphqls extension before, sorry!

@acao acao closed this as completed Aug 23, 2020
@cailloumajor
Copy link
Contributor Author

@acao:

this extension loads .graphql files

Not only, as I already said, this extension supports, among others, .graphqls file type. Taking a look at grammars/graphql.json, you can find:

https://github.com/prisma-labs/vscode-graphql/blob/4ac143f52f47baa9a9e139865a0ecf930a0f9430/grammars/graphql.json#L4

i have never seen the .graphqls extension before

This doesn't mean there is no need for it:

@acao
Copy link
Member

acao commented Sep 3, 2020

i’m not in disagrement at all! just haven’t noticed it before. i will be sure to add it to the underlying LSP server repo, which is in graphql/graphiql. most of the business logic for this extension lives there

@cailloumajor
Copy link
Contributor Author

i’m not in disagrement at all!

Sorry, I felt you were by closing the issue...

@acao acao reopened this Sep 3, 2020
@acao
Copy link
Member

acao commented Sep 3, 2020

ope i guess i did. will get to all this soon!

@acao
Copy link
Member

acao commented Sep 3, 2020

if you can, re-create this ticket for the language server? and you can add this extension to the list in a PR. they are all defined in one place

@cailloumajor
Copy link
Contributor Author

@acao thank you for re-opening.

I think the problem is simpler than you think: the contents of .graphqls files is standard GraphQL language, the extension is just different to denote the purpose of the file, i.e. schema definition. My request here is just that VSCode handles .graphqls files exactly the same manner as .graphql files. There is no need to add a new language.

My apologies if my request was not clear enough.

I achieved to obtain the needed behavior by adding ".graphqls" to the array below in package.json.
https://github.com/prisma-labs/vscode-graphql/blob/6bdfa89e63f737134b2d9a6a4e8959092b0e2fbf/package.json#L48-L51

If you agree with this change, I would be glad to open a pull request.

@acao
Copy link
Member

acao commented Sep 4, 2020

please open the PR, you don’t need my permission!
you will also need a PR to graphql/graphiql repo, otherwise you’ll only have highlighting support for .graphqls files

@acao
Copy link
Member

acao commented Sep 4, 2020

for reference, this line would be the only other thing you need to change for this to work end to end!

changing the configuration you are pointing to will only add highlighting support. the graphql/graphiql repo is where all the logic for validation, code completion (aka intellisense), and everything else live.

@acao acao added enhancement New feature or request graphql-language-service issues that can only be solved by updating the graphql language service labels Sep 4, 2020
@acao acao closed this as completed in #211 Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request graphql-language-service issues that can only be solved by updating the graphql language service
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants