File tree 1 file changed +7
-0
lines changed
packages/language-server/src/plugins/typescript/features
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ export class RenameProviderImpl implements RenameProvider {
110
110
fullDisplayName : string ;
111
111
triggerSpan : { start : number ; length : number } ;
112
112
} | 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
+ }
113
118
const renameInfo : any = lang . getRenameInfo ( tsDoc . filePath , offset , {
114
119
allowRenameOfImportPath : false ,
115
120
} ) ;
@@ -215,6 +220,7 @@ export class RenameProviderImpl implements RenameProvider {
215
220
return await this . mapRenameLocationsToParent ( replacementsForProp , fragments ) ;
216
221
}
217
222
223
+ // --------> svelte2tsx?
218
224
private matchGeneratedExportLet (
219
225
fragment : SvelteSnapshotFragment ,
220
226
updatePropLocation : ts . RenameLocation ,
@@ -250,6 +256,7 @@ export class RenameProviderImpl implements RenameProvider {
250
256
} ) ;
251
257
}
252
258
259
+ // --------> svelte2tsx?
253
260
private isInSvelte2TsxPropLine ( fragment : SvelteSnapshotFragment , loc : ts . RenameLocation ) {
254
261
const pos = positionAt ( loc . textSpan . start , fragment . text ) ;
255
262
const textInLine = fragment . text . substring (
You can’t perform that action at this time.
0 commit comments