提交 6936409a 编写于 作者: P Pine Wu

Address feedback

上级 16af175b
......@@ -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,
......
--ui tdd
--useColors true
./out/test
./out/test/pathCompletion
\ No newline at end of file
./out/test
\ No newline at end of file
......@@ -6,7 +6,7 @@
"noUnusedLocals": true,
"sourceMap": true,
"lib": [
"es5", "es2015.promise", "dom"
"es5", "es2015.promise"
]
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册