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

[vscode-graphql] go to definition jumps to wrong line on certain condition #3546

Open
1 task done
panda0603 opened this issue Mar 4, 2024 · 1 comment
Open
1 task done

Comments

@panda0603
Copy link

panda0603 commented Mar 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hello,

there seems to be existing issues with wrong line jumps, but I'm not sure if this is the same condition so I am posting another issue.

When using inline string fragments in .ts files like below,

jump to definition(cmd+click) on RelatedLinks type jumps to wrong line(usually at the end of the file) at the correct file(where the type RealtedLinks is defined). The point here is that this happens only when the fragment name exactly matches the type name(both are RelatedLinks). If the names are different, go to definition works well, jumping to the correct line.

export const LINKS = `#graphql
  fragment RelatedLinks on RelatedLinks {
     ...
  }
`

I tried moving the fragment to a .gql file, and here even with the same names, it jumps well to the correct line. I am not sure why this is different behavior to .ts file.

may this be a bug or am I setting something wrong?

EDIT:
found another bug.

Go to definition doesn't work well when clicking the fragment(CommonItemsFragment) which is defined in .ts file.

items {
   ...CommonItemsFragment
}

I have many fragments(embedded string fragment) defined in one .ts file. Upon clicking the fragment, go to definiton leads to the correct file, but just to the start of the file and not where the string fragment is defined.

thanks

Expected Behavior

jump to correct line, where the type is defined.

Steps To Reproduce

No response

Environment

  • GraphiQL Version: latest. I have tried the v0.10.0, with the vsix file.
  • OS: Sonoma 14.0
  • Browser: chrome
  • Bundler: webpack
  • react Version: 17
  • graphql Version:

Anything else?

No response

@acao
Copy link
Member

acao commented Mar 4, 2024

can you tell me if this release works for you?
#3521 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@acao @panda0603 and others