typescript-plugin-css-modules icon indicating copy to clipboard operation
typescript-plugin-css-modules copied to clipboard

Move to file in VSCode does not work with plugin installed

Open islami00 opened this issue 2 years ago • 0 comments

Describe the bug I am unable to use the new "Move to File" refactoring in vscode with typescript-plugin-css-modules installed. This was introduced in https://github.com/microsoft/TypeScript/pull/53542.

To Reproduce Steps to reproduce the behavior:

  1. Open new-file.tsx in the reproduction
  2. Right-click on any symbol
  3. Click on 'move to file'
  4. See error

Expected behavior A dropdown should be shown with file suggestions

Desktop (please complete the following information):

  • OS: [MacOS]
  • Browser [n/a]
  • Version [5.0.2]
  • TS Version [5.2.2]
  • VSCode Version [1.83.1]

Additional context

  • Reproduction: https://github.com/islami00/typescript-plugin-css-modules-move-to-file-repro
  • Error Log:
Err 50    [09:14:17.029] Exception on executing command {
  "seq": 16,
  "type": "request",
  "command": "getMoveToRefactoringFileSuggestions",
  "arguments": {
    "file": "{project_dir}/path/to/File.tsx",
    "startLine": 87,
    "startOffset": 1,
    "endLine": 87,
    "endOffset": 13,
    "startPosition": 3274,
    "endPosition": 3286
  }
}:

    Debug Failure. File {project_dir}/some/other/path/to/SCSSFile.module.scss has unknown extension.

    Error: Debug Failure. File {project_dir}/some/other/path/to/SCSSFile.module.scss has unknown extension.
        at extensionFromPath ({project_dir}/node_modules/typescript/lib/tsserver.js:21064:39)
        at {project_dir}/node_modules/typescript/lib/tsserver.js:144823:441
        at mapDefined ({project_dir}/node_modules/typescript/lib/tsserver.js:2671:22)
        at Proxy.getMoveToRefactoringFileSuggestions ({project_dir}/node_modules/typescript/lib/tsserver.js:144823:19)
        at IpcIOSession.getMoveToRefactoringFileSuggestions ({project_dir}/node_modules/typescript/lib/tsserver.js:184487:41)
        at getMoveToRefactoringFileSuggestions ({project_dir}/node_modules/typescript/lib/tsserver.js:182696:43)
        at {project_dir}/node_modules/typescript/lib/tsserver.js:184838:69
        at IpcIOSession.executeWithRequestId ({project_dir}/node_modules/typescript/lib/tsserver.js:184830:14)
        at IpcIOSession.executeCommand ({project_dir}/node_modules/typescript/lib/tsserver.js:184838:29)
        at IpcIOSession.onMessage ({project_dir}/node_modules/typescript/lib/tsserver.js:184880:51)
        at process.<anonymous> ({project_dir}/node_modules/typescript/lib/tsserver.js:186461:14)
        at process.emit (node:events:513:28)
        at emit (node:internal/child_process:937:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

PS: Reported here as I'm not sure if this falls into the Typescript scope or of this module

islami00 avatar Oct 17 '23 08:10 islami00