mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 05:21:08 +01:00
fixes #114203
This commit is contained in:
@@ -21,6 +21,7 @@ import { match } from 'vs/base/common/glob';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IPathService } from 'vs/workbench/services/path/common/pathService';
|
||||
import { hasDriveLetter } from 'vs/base/common/extpath';
|
||||
|
||||
const resourceLabelFormattersExtPoint = ExtensionsRegistry.registerExtensionPoint<ResourceLabelFormatter[]>({
|
||||
extensionPoint: 'resourceLabelFormatters',
|
||||
@@ -73,10 +74,6 @@ const resourceLabelFormattersExtPoint = ExtensionsRegistry.registerExtensionPoin
|
||||
const sepRegexp = /\//g;
|
||||
const labelMatchingRegexp = /\$\{(scheme|authority|path|(query)\.(.+?))\}/g;
|
||||
|
||||
function hasDriveLetter(path: string): boolean {
|
||||
return !!(path && path[2] === ':');
|
||||
}
|
||||
|
||||
class ResourceLabelFormattersHandler implements IWorkbenchContribution {
|
||||
private formattersDisposables = new Map<ResourceLabelFormatter, IDisposable>();
|
||||
|
||||
@@ -268,7 +265,7 @@ export class LabelService extends Disposable implements ILabelService {
|
||||
});
|
||||
|
||||
// convert \c:\something => C:\something
|
||||
if (formatting.normalizeDriveLetter && hasDriveLetter(label)) {
|
||||
if (formatting.normalizeDriveLetter && hasDriveLetter(label.substr(1))) {
|
||||
label = label.charAt(1).toUpperCase() + label.substr(2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user