@@ -226,11 +226,45 @@ suite("ProjectStorage", () => {
226226 const uri = Uri . parse ( remoteRoot ) ;
227227 const found = storage . existsRemoteWithRootPath ( uri ) ;
228228
229- // Implementation matches by path, not full URI
230229 assert . ok ( found ) ;
231230 assert . strictEqual ( found ! . name , "RemoteProject" ) ;
232231 } ) ;
233232
233+ test ( "existsRemoteWithRootPath uses the remote URI authority when matching" , ( ) => {
234+ const filename = createTempFilename ( ) ;
235+ const storage = new ProjectStorage ( filename ) ;
236+
237+ storage . push ( "RemoteA" , "vscode-remote://ssh-remote+server-A/home/user/project" ) ;
238+ storage . push ( "RemoteB" , "vscode-remote://ssh-remote+server-B/home/user/project" ) ;
239+
240+ const found = storage . existsRemoteWithRootPath ( Uri . parse ( "vscode-remote://ssh-remote+server-B/home/user/project" ) ) ;
241+
242+ assert . ok ( found ) ;
243+ assert . strictEqual ( found ! . name , "RemoteB" ) ;
244+ } ) ;
245+
246+ test ( "existsRemoteWithRootPath ignores same path on a different remote authority" , ( ) => {
247+ const filename = createTempFilename ( ) ;
248+ const storage = new ProjectStorage ( filename ) ;
249+
250+ storage . push ( "RemoteA" , "vscode-remote://ssh-remote+server-A/home/user/project" ) ;
251+
252+ const found = storage . existsRemoteWithRootPath ( Uri . parse ( "vscode-remote://ssh-remote+server-B/home/user/project" ) ) ;
253+
254+ assert . strictEqual ( found , undefined ) ;
255+ } ) ;
256+
257+ test ( "existsRemoteWithRootPath ignores same authority and path on a different URI scheme" , ( ) => {
258+ const filename = createTempFilename ( ) ;
259+ const storage = new ProjectStorage ( filename ) ;
260+
261+ storage . push ( "RemoteProject" , "vscode-remote://ssh-remote+server/home/user/project" ) ;
262+
263+ const found = storage . existsRemoteWithRootPath ( Uri . parse ( "vscode-vfs://ssh-remote+server/home/user/project" ) ) ;
264+
265+ assert . strictEqual ( found , undefined ) ;
266+ } ) ;
267+
234268 test ( "existsWithRootPath returns expandedHomePath when asked" , ( ) => {
235269 const filename = createTempFilename ( ) ;
236270 const storage = new ProjectStorage ( filename ) ;
0 commit comments