Skip to content

Debug failure on paste with importsΒ #58740

Closed
@mjbvz

Description

@mjbvz

πŸ”Ž Search Terms

  • paste with imports

πŸ•— Version & Regression Information

5.5.0-dev.20240602

⏯ Playground Link

No response

πŸ’» Code

Don't have a minimal repo yet but hitting this pretty consistently:

  1. In https://github.com/microsoft/vscode-markdown-languageservice with VS Code
  2. "typescript.experimental.updateImportsOnPaste": true with latest nightly TS
  3. Copy the constructor here https://github.com/microsoft/vscode-markdown-languageservice/blob/7156aba6bdffef89b9210def0e0dda785569d1ab/src/languageFeatures/folding.ts#L26C1-L34C3
  4. Paste it into a new file

πŸ™ Actual behavior

copyPasteController.ts:510 Error: <semantic> TypeScript Server Error (5.5.0-dev.20240602)
Debug Failure.
Error: Debug Failure.
    at Object.addImportFromExportedSymbol (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:154212:32)
    at /Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:144257:19
    at Map.forEach (<anonymous>)
    at addTargetFileImports (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:144251:17)
    at /Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:178190:7
    at ConfiguredProject2.runWithTemporaryFileUpdate (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:183844:5)
    at pasteEdits (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:178172:55)
    at /Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:178158:118
    at _ChangeTracker.with (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:174292:5)
    at Object.pasteEditsProvider (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:178158:60)
    at Object.getPasteEdits (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:149221:34)
    at IpcIOSession.getPasteEdits (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:191112:49)
    at getPasteEdits (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:189302:43)
    at /Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:191478:69
    at IpcIOSession.executeWithRequestId (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:191470:14)
    at IpcIOSession.executeCommand (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:191478:29)
    at IpcIOSession.onMessage (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/typescript.js:191520:51)
    at process.<anonymous> (/Users/matb/projects/vscode-markdown-languageservice/node_modules/typescript/lib/tsserver.js:523:14)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:951:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
    at Function.create (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:473136)
    at v.dispatchResponse (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:467106)
    at v.dispatchMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:465950)
    at ChildProcess.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:465443)
    at ChildProcess.emit (node:events:514:28)
    at emit (node:internal/child_process:951:14)

tsserver.log

πŸ™‚ Expected behavior

No crash

Additional information about the issue

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions