@@ -2984,6 +2984,47 @@ namespace ts.projectSystem {
2984
2984
checkProjectActualFiles ( configuredProject , [ file . path , filesFile1 . path , libFile . path , config . path ] ) ;
2985
2985
}
2986
2986
} ) ;
2987
+
2988
+ it ( "requests are done on file on pendingReload but has svc for previous version" , ( ) => {
2989
+ const projectLocation = "/user/username/projects/project" ;
2990
+ const file1 : FileOrFolder = {
2991
+ path : `${ projectLocation } /src/file1.ts` ,
2992
+ content : `import { y } from "./file1"; let x = 10;`
2993
+ } ;
2994
+ const file2 : FileOrFolder = {
2995
+ path : `${ projectLocation } /src/file2.ts` ,
2996
+ content : "export let y = 10;"
2997
+ } ;
2998
+ const config : FileOrFolder = {
2999
+ path : `${ projectLocation } /tsconfig.json` ,
3000
+ content : "{}"
3001
+ } ;
3002
+ const files = [ file1 , file2 , libFile , config ] ;
3003
+ const host = createServerHost ( files ) ;
3004
+ const session = createSession ( host ) ;
3005
+ session . executeCommandSeq < protocol . OpenRequest > ( {
3006
+ command : protocol . CommandTypes . Open ,
3007
+ arguments : { file : file2 . path , fileContent : file2 . content }
3008
+ } ) ;
3009
+ session . executeCommandSeq < protocol . OpenRequest > ( {
3010
+ command : protocol . CommandTypes . Open ,
3011
+ arguments : { file : file1 . path }
3012
+ } ) ;
3013
+ session . executeCommandSeq < protocol . CloseRequest > ( {
3014
+ command : protocol . CommandTypes . Close ,
3015
+ arguments : { file : file2 . path }
3016
+ } ) ;
3017
+
3018
+ file2 . content += "export let z = 10;" ;
3019
+ host . reloadFS ( files ) ;
3020
+ // Do not let the timeout runs, before executing command
3021
+ const startOffset = file2 . content . indexOf ( "y" ) + 1 ;
3022
+ session . executeCommandSeq < protocol . GetApplicableRefactorsRequest > ( {
3023
+ command : protocol . CommandTypes . GetApplicableRefactors ,
3024
+ arguments : { file : file2 . path , startLine : 1 , startOffset, endLine : 1 , endOffset : startOffset + 1 }
3025
+ } ) ;
3026
+
3027
+ } ) ;
2987
3028
} ) ;
2988
3029
2989
3030
describe ( "tsserverProjectSystem Proper errors" , ( ) => {
0 commit comments