Skip to content

Commit 7d16574

Browse files
author
Simon Holthausen
committed
(fix) prevent renames in error state
1 parent d201546 commit 7d16574

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/language-server/src/plugins/typescript/features/RenameProvider.ts

+5
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ export class RenameProviderImpl implements RenameProvider {
110110
fullDisplayName: string;
111111
triggerSpan: { start: number; length: number };
112112
} | null {
113+
// Don't allow renames in error-state, because then there is no generated svelte2tsx-code
114+
// and rename cannot work
115+
if (!!tsDoc.parserError) {
116+
return null;
117+
}
113118
const renameInfo: any = lang.getRenameInfo(tsDoc.filePath, offset, {
114119
allowRenameOfImportPath: false,
115120
});

0 commit comments

Comments
 (0)