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

fix: adjust documentation display #126

Merged
merged 2 commits into from
Dec 21, 2023
Merged

fix: adjust documentation display #126

merged 2 commits into from
Dec 21, 2023

Conversation

JoviDeCroock
Copy link
Member

Resolve #124

There are probably more possible improvements, looking at what it produces from an urql TSDoc...

  "body": {
    "kind": "alias",
    "kindModifiers": "declare",
    "start": {
      "line": 39,
      "offset": 1
    },
    "end": {
      "line": 39,
      "offset": 13
    },
    "displayString": "(alias) createClient(opts: ClientOptions): Client\nimport createClient",
    "documentation": [
      {
        "text": "Accepts `ClientOptions` and creates a `Client`.",
        "kind": "text"
      }
    ],
    "tags": [
      {
        "name": "param",
        "text": [
          {
            "text": "opts",
            "kind": "parameterName"
          },
          {
            "text": " ",
            "kind": "space"
          },
          {
            "text": "- A ",
            "kind": "text"
          },
          {
            "text": "{@link ",
            "kind": "link"
          },
          {
            "text": "ClientOptions",
            "kind": "linkName",
            "target": {
              "file": "/Users/jovi/Documents/SideProjects/GraphQLSP/node_modules/.pnpm/@[email protected][email protected]/node_modules/@urql/core/dist/urql-core-chunk.d.ts",
              "start": {
                "line": 12,
                "offset": 1
              },
              "end": {
                "line": 133,
                "offset": 2
              }
            }
          },
          {
            "text": "}",
            "kind": "link"
          },
          {
            "text": " objects with options for the `Client`.",
            "kind": "text"
          }
        ]
      },
      {
        "name": "returns",
        "text": [
          {
            "text": "A ",
            "kind": "text"
          },
          {
            "text": "{@link ",
            "kind": "link"
          },
          {
            "text": "Client",
            "kind": "linkName",
            "target": {
              "file": "/Users/jovi/Documents/SideProjects/GraphQLSP/node_modules/.pnpm/@[email protected][email protected]/node_modules/@urql/core/dist/urql-core-chunk.d.ts",
              "start": {
                "line": 440,
                "offset": 15
              },
              "end": {
                "line": 440,
                "offset": 58
              }
            }
          },
          {
            "text": "}",
            "kind": "link"
          },
          {
            "text": " instantiated with `opts`.",
            "kind": "text"
          }
        ]
      }
    ]
  }

Copy link

changeset-bot bot commented Dec 5, 2023

🦋 Changeset detected

Latest commit: 4f3f32f

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

This PR includes changesets to release 1 package
Name Type
@0no-co/graphqlsp 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

: [{ kind: '', text: hoverInfo as string }],
};
kindModifiers: 'text',
documentation: Array.isArray(hoverInfo)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm admittedly a bit confused about this. It looks like displayString may be reserved for code-like references, while documentation is only for "meta" information?

This could correspond to the hover string, where displayString might be displayed in monospace, while documentation is the smaller sans-serif text below it, if I'm not mistaken

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's a tad smaller... Not sure how to combine displayString though as that expects code it looks like

@JoviDeCroock JoviDeCroock marked this pull request as ready for review December 9, 2023 07:27
@JoviDeCroock JoviDeCroock changed the title adjust documentation display fix: adjust documentation display Dec 9, 2023
@JoviDeCroock JoviDeCroock merged commit 01ade44 into main Dec 21, 2023
1 check passed
@JoviDeCroock JoviDeCroock deleted the adjust-display branch December 21, 2023 16:32
@github-actions github-actions bot mentioned this pull request Dec 21, 2023
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.

GraphQL field descriptions in IntelliSense have broken syntax highlighting
2 participants