typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

[lsp][bug] fails to find all references within a single project

Open mjames-c opened this issue 6 months ago • 3 comments

We have a project with 98k+ files in it here at Canva. When I attempt to run find-all refs for a Button symbol used 16k+ times within the project it returns no results. Unfortunately the LSP server doesn't print any logs, however the LSP client logs this:

[Trace - 9:15:16 AM] Sending request 'textDocument/references - (12)'.
Params: {
    "textDocument": {
        "uri": "file:////<omitted>/button.ts"
    },
    "position": {
        "line": 11,
        "character": 12
    },
    "context": {
        "includeDeclaration": true
    }
}

[Trace - 9:15:16 AM] Received response 'textDocument/references - (12)' in 24ms.
No result returned.
$ npx tsgo -p web/tsconfig.json --showConfig
{
  "composite": false,
  "declaration": true,
  "declarationMap": true,
  "esModuleInterop": true,
  "experimentalDecorators": false,
  "isolatedModules": true,
  "importHelpers": true,
  "inlineSources": true,
  "jsx": 4,
  "lib": [
    "lib.dom.d.ts",
    "lib.dom.iterable.d.ts",
    "lib.es2018.d.ts",
    "lib.es2019.array.d.ts",
    "lib.es2019.object.d.ts",
    "lib.es2019.string.d.ts",
    "lib.es2020.promise.d.ts",
    "lib.es2020.string.d.ts",
    "lib.es2020.intl.d.ts",
    "lib.es2021.promise.d.ts",
    "lib.es2022.string.d.ts",
    "lib.es2022.array.d.ts",
    "lib.es2022.error.d.ts",
    "lib.es2024.promise.d.ts"
  ],
  "module": 99,
  "moduleResolution": 100,
  "noImplicitOverride": true,
  "outDir": "<omitted>/web/target",
  "paths": {
    // ...
  },
  "project": "<omitted>/web/tsconfig.json",
  "rootDir": "<omitted>",
  "skipLibCheck": true,
  "strict": true,
  "sourceMap": true,
  "target": 6,
  "configFilePath": "<omitted>/web/tsconfig.json",
  "pathsBasePath": "<omitted>/web",
  "showConfig": true
}

mjames-c avatar Jun 17 '25 23:06 mjames-c

Me too, it doesn't show the references anymore

flazouh avatar Jul 19 '25 22:07 flazouh

Posting a quick update. Find refs will now return a partial set of results based on which files the user has opened in their editor so, for example, it returned 6 references for the aforementioned button component in my test this morning.

Identifier typescriptteam.native-preview
Version 0.20251013.2

mjames-c avatar Oct 16 '25 01:10 mjames-c

It would be worth it to try again tomorrow in the next nightly; #1991 just fixed a bunch of stuff.

jakebailey avatar Nov 21 '25 22:11 jakebailey

Is there an easy way to compare "Find all references" results in VS Code using both TS versions? Turing tsgo on/off constantly is painful for this task

IllusionMH avatar Dec 03 '25 22:12 IllusionMH

No, only one is registered at a time. If you are finding differences and can repro, an issue with that would be very appreciated, because we do not have any repros for these.

jakebailey avatar Dec 03 '25 22:12 jakebailey

This seems to be more or less fixed. Closing it out in favour of: https://github.com/microsoft/typescript-go/issues/2204

mjames-c avatar Dec 03 '25 22:12 mjames-c