Default presentation of Explorer: Copy Relative Path Separator in Setting...

Default presentation of Explorer: Copy Relative Path Separator in Setting editor is confusing (fix #128345)
上级 4f90d808
......@@ -275,7 +275,14 @@ CommandsRegistry.registerCommand({
async function resourcesToClipboard(resources: URI[], relative: boolean, clipboardService: IClipboardService, labelService: ILabelService, configurationService: IConfigurationService): Promise<void> {
if (resources.length) {
const lineDelimiter = isWindows ? '\r\n' : '\n';
const separator = relative ? configurationService.getValue<'/' | '\\' | undefined>('explorer.copyRelativePathSeparator') : undefined;
let separator: '/' | '\\' | undefined = undefined;
if (relative) {
const relativeSeparator = configurationService.getValue('explorer.copyRelativePathSeparator');
if (relativeSeparator === '/' || relativeSeparator === '\\') {
separator = relativeSeparator;
}
}
const text = resources.map(resource => labelService.getUriLabel(resource, { relative, noPrefix: true, separator })).join(lineDelimiter);
await clipboardService.writeText(text);
......
......@@ -407,13 +407,16 @@ configurationRegistry.registerConfiguration({
'type': 'string',
'enum': [
'/',
'\\'
'\\',
'auto'
],
'enumDescriptions': [
nls.localize('copyRelativePathSeparator.slash', "Use slash as path separation character."),
nls.localize('copyRelativePathSeparator.backslash', "Use backslash as path separation character."),
nls.localize('copyRelativePathSeparator.auto', "Uses operating system specific path separation character."),
],
'description': nls.localize('copyRelativePathSeparator', "The path separation character used when copying relative file paths. Will use the operating system default unless specified."),
'description': nls.localize('copyRelativePathSeparator', "The path separation character used when copying relative file paths."),
'default': 'auto'
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册