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) {
123123 } ) ;
124124
125125 workspace . onDidSaveTextDocument ( async ( doc ) => {
126- const parts = doc . uri . toString ( ) . split ( / \/ | \\ / ) ;
126+ const parts = doc . uri . toString ( true ) . split ( / \/ | \\ / ) ;
127127 if ( [ 'tsconfig.json' , 'jsconfig.json' ] . includes ( parts [ parts . length - 1 ] ) ) {
128128 await restartLS ( false ) ;
129129 }
@@ -225,6 +225,11 @@ export function activate(context: ExtensionContext) {
225225
226226function addRenameFileListener ( getLS : ( ) => LanguageClient ) {
227227 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+
228233 window . withProgress (
229234 { location : ProgressLocation . Window , title : 'Updating Imports..' } ,
230235 async ( ) => {
@@ -236,7 +241,7 @@ function addRenameFileListener(getLS: () => LanguageClient) {
236241 // In the meantime, just assume it's a single entry and simplify the
237242 // rest of the logic that way.
238243 {
239- oldUri : evt . files [ 0 ] . oldUri . toString ( true ) ,
244+ oldUri : oldUri ,
240245 newUri : evt . files [ 0 ] . newUri . toString ( true )
241246 }
242247 ) ;
You can’t perform that action at this time.
0 commit comments