Enable search editor in non-HOME envs
parent
e1b06c9a81
commit
d4ae4a64ec
|
@ -121,9 +121,16 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
|
||||
|
||||
function relativePathToUri(path: string, resultsUri: vscode.Uri): vscode.Uri | undefined {
|
||||
if (pathUtils.isAbsolute(path)) { return vscode.Uri.file(path); }
|
||||
if (pathUtils.isAbsolute(path)) {
|
||||
return vscode.Uri
|
||||
.file(path)
|
||||
.with({ scheme: process.env.HOME ? 'file' : 'vscode-userdata' });
|
||||
}
|
||||
|
||||
if (path.indexOf('~/') === 0) {
|
||||
return vscode.Uri.file(pathUtils.join(process.env.HOME!, path.slice(2)));
|
||||
return vscode.Uri
|
||||
.file(pathUtils.join(process.env.HOME ?? '', path.slice(2)))
|
||||
.with({ scheme: process.env.HOME ? 'file' : 'vscode-userdata' });
|
||||
}
|
||||
|
||||
const uriFromFolderWithPath = (folder: vscode.WorkspaceFolder, path: string): vscode.Uri =>
|
||||
|
|
Loading…
Reference in New Issue