Skip to content

Inlay hints for Typescript errors do not update after issue is fixed #21943

@AustinCase

Description

@AustinCase

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

This happens in many scenarios but there has not been a pattern that sticks out. It can be inconsistent and hard to reproduce.

The scenario that is reproducible is slightly difficult but does reproduce:
You'll need a backend graphql API with introspection available in order to set this up properly.

  1. Setup a simple react/ts project
  2. Setup graphQL Apollo client
  3. Setup graphQL codegen
  4. Write an INVALID query
  5. Create a query using apollo's useQuery hook that queries your invalid query
  6. Notice the inlay hint errors
  7. Correct the invalid query
  8. Notice that the inlay error still exists but the types are all generated and valid

Fundamental code example:

import { useQuery } from '@apollo/client';
import { graphql } from '@/graphql';

export const App = () => {
  const { data, loading, errors } = useQuery(GENERIC_QUERY);

  return <div>{data.querySomething.id}</div>
}

const GENERIC_QUERY = graphql(`
  query GenericQuery {
     querySomething {
       id
     }
  }
`);

Environment

Zed: v0.165.4 (Zed)
OS: macOS 14.5.0
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Notice the error of destructuring any value, but clearly it knows the type in the other overlay.

image

If applicable, attach your Zed.log file to this issue.

Zed.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:diagnosticsFeedback for diagnostics, error messages, logs, etcarea:language serverAn umbrella label for all language serversarea:languagesAn umbrella label for all programming languages syntax behaviorsarea:languages/typescriptTypeScript programming language supportbugDEPRECATED label: use issue type 'Bug' insteadstaleLabel used by `stale` action

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions