mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Address feedback
This commit is contained in:
@@ -64,12 +64,17 @@ export function providePathSuggestions(value: string, activeDocFsPath: string, r
|
||||
return [];
|
||||
}
|
||||
|
||||
const valueAfterLastSlash = value.slice(value.lastIndexOf('/') + 1);
|
||||
const valueBeforeLastSlash = value.slice(0, value.lastIndexOf('/') + 1);
|
||||
const lastIndexOfSlash = value.lastIndexOf('/');
|
||||
const valueAfterLastSlash = value.slice(lastIndexOfSlash + 1);
|
||||
const valueBeforeLastSlash = value.slice(0, lastIndexOfSlash + 1);
|
||||
const parentDir = startsWith(value, '/')
|
||||
? path.resolve(root, '.' + valueBeforeLastSlash)
|
||||
: path.resolve(activeDocFsPath, '..', valueBeforeLastSlash);
|
||||
|
||||
if (!fs.existsSync(parentDir)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return fs.readdirSync(parentDir).map(f => {
|
||||
return {
|
||||
label: f,
|
||||
|
||||
Reference in New Issue
Block a user