graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

fix(graphql-language-service): fix off by one on hover

Open bensengupta opened this issue 11 months ago • 4 comments

Hey, thanks for making this! This PR fixes a small off-by-one issue when hovering.

Details I am using graphql-language-service-cli in Neovim. The issue is illustrated below:

Hover, no information (incorrect, should show info) Screenshot 2025-03-16 at 6 37 17 PM Hover, shows information (correct) Screenshot 2025-03-16 at 6 37 22 PM Hover, shows information (incorrect, should not show info) Screenshot 2025-03-16 at 6 37 27 PM Hover, no information (correct) Screenshot 2025-03-16 at 6 37 31 PM

bensengupta avatar Mar 16 '25 20:03 bensengupta

🦋 Changeset detected

Latest commit: 14cca833562855e86ce99d4a962a8260704eae9f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
graphql-language-service Patch
codemirror-graphql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Mar 16 '25 20:03 changeset-bot[bot]

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: bensengupta / name: Benjamin Sengupta (f396fa946f071ace7f3233f4623994ca22daec4b, b7e0a66af7ddc2cac30c943e55963a3e9745f376, e55cfeaf01051b3fa91701f55c0d8b111cbdba87, 14cca833562855e86ce99d4a962a8260704eae9f, fbb4e5e0fb7e1639dfca0b50dcab68f92886cea5)

Seems like there is a race condition in the tests. Am unable to reproduce test failure locally.

Maybe replace this https://github.com/graphql/graphiql/blob/b495159382465a2cab6d8592b8bce66fece066fe/packages/graphql-language-service-server/src/MessageProcessor.ts#L142-L144

with this?

    try {
      void mkdirSync(this._tmpDirBase);
    } catch (err) {
      if (err instanceof Error && 'code' in err && err.code === 'EEXIST') {
        return;
      }
      throw err;
    }

bensengupta avatar Mar 17 '25 11:03 bensengupta

Hey @acao @dimaMachina, any chance one of you could have a look?

bensengupta avatar Mar 20 '25 12:03 bensengupta