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

Small bug when autocompleting variables #2068

Closed
Tracked by #2062
bartenra opened this issue May 20, 2021 · 5 comments · Fixed by #2070
Closed
Tracked by #2062

Small bug when autocompleting variables #2068

bartenra opened this issue May 20, 2021 · 5 comments · Fixed by #2070
Labels
bug lsp-server graphql-language-service-server

Comments

@bartenra
Copy link

Steps to Reproduce the Problem Or Description

Type

query ($test: String!) {
  hello (test: $[CURSOR HERE])
}

Press tab to autocomplete, select $test.

Expected Behavior

query ($test: String!) {
  hello (test: $test)
}

Actual Behavior

query ($test: String!) {
  hello (test: $$test)
}

Specifications

  • GraphQL for VSCode Extension Version: v0.3.16
  • VSCode Version: 1.56.2
  • OS Name: Arch Linux
  • OS Version: 2021.05.01
@acao
Copy link
Member

acao commented Nov 28, 2021

Oof! I can fix this.

@acao
Copy link
Member

acao commented Nov 28, 2021

thank you for this bug report!

I added support for variables completion last year, and thats where to fix some issues we had, i appended the $ character manually to the completion insertText for variable names. Oops! Will fix this!

@acao acao transferred this issue from graphql/vscode-graphql Nov 28, 2021
@bartenra
Copy link
Author

Awesome! 🎉

@acao acao added bug known bugs lsp-server graphql-language-service-server labels Nov 29, 2021
@acao
Copy link
Member

acao commented Nov 29, 2021

and
definitions[variableName].insertText = `$${variableName}`;
are the offending lines

as a note for a PR, the insertText does not need to be passed at all if no transformation happens, just label is sufficient

@acao
Copy link
Member

acao commented Nov 30, 2021

does this seem to fix the issue in this monaco example? from #2070
https://61a621696bff9e00a952ce2b--monaco-graphql.netlify.app/

quick way to demonstrate the universal LS features until we have a code-server deploy preview!

@acao acao closed this as completed in #2070 Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug lsp-server graphql-language-service-server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants