@@ -181,18 +181,29 @@ export async function onSuccessfulConnection(mcUri: vscode.Uri, host: string, mc
181181
182182 const rawVersion : string = mcEnvData . microclimate_version ;
183183 const rawWorkspace : string = mcEnvData . workspace_location ;
184+ const rawPlatform : string = mcEnvData . os_platform ;
184185
185186 Log . d ( "rawVersion from Microclimate is" , rawVersion ) ;
186187 Log . d ( "rawWorkspace from Microclimate is" , rawWorkspace ) ;
188+ Log . d ( "rawPlatform from Microclimate is" , rawPlatform ) ;
187189 if ( rawVersion == null || rawWorkspace == null ) {
188190 Log . e ( "Microclimate environment did not provide either version or workspace. Data provided is:" , mcEnvData ) ;
189191 throw new Error ( Translator . t ( STRING_NS , "versionNotProvided" , { requiredVersion : MCEnvironment . REQUIRED_VERSION_STR } ) ) ;
190192 }
191193
194+ let workspace = rawWorkspace ;
195+ // on windows, we have to replace the unix-like workspace path with a windows one. /C/Users/... -> C:/Users/ ...
196+ // logic copied from Eclipse plugin
197+ // MicroclimateConnection.java#L244
198+ if ( rawPlatform . toLowerCase ( ) === "windows" && workspace . startsWith ( "/" ) ) {
199+ const deviceLetter = workspace . substring ( 1 , 2 ) ;
200+ workspace = deviceLetter + ":" + workspace . substring ( 2 ) ;
201+ }
202+
192203 const versionNum = MCEnvironment . getVersionNumber ( mcEnvData ) ;
193204
194205 try {
195- return await ConnectionManager . instance . addConnection ( mcUri , host , versionNum , rawWorkspace ) ;
206+ return await ConnectionManager . instance . addConnection ( mcUri , host , versionNum , workspace ) ;
196207 }
197208 catch ( err ) {
198209 Log . i ( "New connection rejected by ConnectionManager " , err . message || err ) ;
0 commit comments