File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/svelte-vscode/src Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ export function activate(context: ExtensionContext) {
123
123
} ) ;
124
124
125
125
workspace . onDidSaveTextDocument ( async ( doc ) => {
126
- const parts = doc . uri . toString ( ) . split ( / \/ | \\ / ) ;
126
+ const parts = doc . uri . toString ( true ) . split ( / \/ | \\ / ) ;
127
127
if ( [ 'tsconfig.json' , 'jsconfig.json' ] . includes ( parts [ parts . length - 1 ] ) ) {
128
128
await restartLS ( false ) ;
129
129
}
@@ -225,6 +225,11 @@ export function activate(context: ExtensionContext) {
225
225
226
226
function addRenameFileListener ( getLS : ( ) => LanguageClient ) {
227
227
workspace . onDidRenameFiles ( async ( evt ) => {
228
+ const oldUri = evt . files [ 0 ] . oldUri . toString ( true ) ;
229
+ if ( ! [ '.ts' , '.js' , '.json' , '.svelte' ] . some ( ( ending ) => oldUri . endsWith ( ending ) ) ) {
230
+ return ;
231
+ }
232
+
228
233
window . withProgress (
229
234
{ location : ProgressLocation . Window , title : 'Updating Imports..' } ,
230
235
async ( ) => {
@@ -236,7 +241,7 @@ function addRenameFileListener(getLS: () => LanguageClient) {
236
241
// In the meantime, just assume it's a single entry and simplify the
237
242
// rest of the logic that way.
238
243
{
239
- oldUri : evt . files [ 0 ] . oldUri . toString ( true ) ,
244
+ oldUri : oldUri ,
240
245
newUri : evt . files [ 0 ] . newUri . toString ( true )
241
246
}
242
247
) ;
You can’t perform that action at this time.
0 commit comments