mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Address feedback
This commit is contained in:
parent
16af175b3a
commit
6936409a1f
|
@ -64,12 +64,17 @@ export function providePathSuggestions(value: string, activeDocFsPath: string, r
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const valueAfterLastSlash = value.slice(value.lastIndexOf('/') + 1);
|
const lastIndexOfSlash = value.lastIndexOf('/');
|
||||||
const valueBeforeLastSlash = value.slice(0, value.lastIndexOf('/') + 1);
|
const valueAfterLastSlash = value.slice(lastIndexOfSlash + 1);
|
||||||
|
const valueBeforeLastSlash = value.slice(0, lastIndexOfSlash + 1);
|
||||||
const parentDir = startsWith(value, '/')
|
const parentDir = startsWith(value, '/')
|
||||||
? path.resolve(root, '.' + valueBeforeLastSlash)
|
? path.resolve(root, '.' + valueBeforeLastSlash)
|
||||||
: path.resolve(activeDocFsPath, '..', valueBeforeLastSlash);
|
: path.resolve(activeDocFsPath, '..', valueBeforeLastSlash);
|
||||||
|
|
||||||
|
if (!fs.existsSync(parentDir)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
return fs.readdirSync(parentDir).map(f => {
|
return fs.readdirSync(parentDir).map(f => {
|
||||||
return {
|
return {
|
||||||
label: f,
|
label: f,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
--ui tdd
|
--ui tdd
|
||||||
--useColors true
|
--useColors true
|
||||||
./out/test
|
./out/test
|
||||||
./out/test/pathCompletion
|
|
|
@ -6,7 +6,7 @@
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"lib": [
|
"lib": [
|
||||||
"es5", "es2015.promise", "dom"
|
"es5", "es2015.promise"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue