mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Empty links in recent workspaces list. FIxes #74363
This commit is contained in:
parent
fd2133691a
commit
715cdf7c63
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { sep, posix, normalize, basename as path_basename, dirname as path_dirname } from 'vs/base/common/path';
|
||||
import { sep, posix, normalize, win32 } from 'vs/base/common/path';
|
||||
import { endsWith, startsWithIgnoreCase, rtrim, startsWith } from 'vs/base/common/strings';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { isLinux, isWindows, isMacintosh } from 'vs/base/common/platform';
|
||||
|
@ -387,8 +387,12 @@ export function unmnemonicLabel(label: string): string {
|
|||
* Splits a path in name and parent path, supporting both '/' and '\'
|
||||
*/
|
||||
export function splitName(fullPath: string): { name: string, parentPath: string } {
|
||||
if (fullPath.indexOf('/') !== -1) {
|
||||
return { name: posix.basename(fullPath), parentPath: posix.dirname(fullPath) };
|
||||
const p = fullPath.indexOf('/') !== -1 ? posix : win32;
|
||||
const name = p.basename(fullPath);
|
||||
const parentPath = p.dirname(fullPath);
|
||||
if (name.length) {
|
||||
return { name, parentPath };
|
||||
}
|
||||
return { name: path_basename(fullPath), parentPath: path_dirname(fullPath) };
|
||||
// only the root segment
|
||||
return { name: parentPath, parentPath: '' };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue