mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fixing exception on unsaved file (#60362)
This commit is contained in:
@@ -156,6 +156,7 @@ import {
|
||||
indent,
|
||||
isConfigFile,
|
||||
isConfiguredProject,
|
||||
isDynamicFileName,
|
||||
isExternalProject,
|
||||
isInferredProject,
|
||||
ITypingsInstaller,
|
||||
@@ -2981,6 +2982,7 @@ export class Session<TMessage = string> implements EventSender {
|
||||
}
|
||||
private getPasteEdits(args: protocol.GetPasteEditsRequestArgs): protocol.PasteEditsAction | undefined {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
if (isDynamicFileName(file)) return undefined;
|
||||
const copiedFrom = args.copiedFrom
|
||||
? { file: args.copiedFrom.file, range: args.copiedFrom.spans.map(copies => this.getRange({ file: args.copiedFrom!.file, startLine: copies.start.line, startOffset: copies.start.offset, endLine: copies.end.line, endOffset: copies.end.offset }, project.getScriptInfoForNormalizedPath(toNormalizedPath(args.copiedFrom!.file))!)) }
|
||||
: undefined;
|
||||
|
||||
Reference in New Issue
Block a user