File tree Expand file tree Collapse file tree
extensions/search-result/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,9 +121,16 @@ export function activate(context: vscode.ExtensionContext) {
121121
122122
123123function relativePathToUri ( path : string , resultsUri : vscode . Uri ) : vscode . Uri | undefined {
124- if ( pathUtils . isAbsolute ( path ) ) { return vscode . Uri . file ( path ) ; }
124+ if ( pathUtils . isAbsolute ( path ) ) {
125+ return vscode . Uri
126+ . file ( path )
127+ . with ( { scheme : process . env . HOME ? 'file' : 'vscode-userdata' } ) ;
128+ }
129+
125130 if ( path . indexOf ( '~/' ) === 0 ) {
126- return vscode . Uri . file ( pathUtils . join ( process . env . HOME ! , path . slice ( 2 ) ) ) ;
131+ return vscode . Uri
132+ . file ( pathUtils . join ( process . env . HOME ?? '' , path . slice ( 2 ) ) )
133+ . with ( { scheme : process . env . HOME ? 'file' : 'vscode-userdata' } ) ;
127134 }
128135
129136 const uriFromFolderWithPath = ( folder : vscode . WorkspaceFolder , path : string ) : vscode . Uri =>
You can’t perform that action at this time.
0 commit comments