Change:
assert.equal(labelService.getUriLabel(uri1, { relative: false }), 'LABEL: /END'); }); }); <ins> suite('multi-root worksapce', () => { let labelService: LabelService; setup(() => { const sources = URI.file('folder1/src'); const tests = URI.file('folder1/test'); const other = URI.file('folder2'); labelService = new LabelService( TestEnvironmentService, new TestContextService( new Workspace('test-workspaace', [ new WorkspaceFolder({ uri: sources, index: 0, name: 'Sources' }, { uri: sources.toString() }), new WorkspaceFolder({ uri: tests, index: 1, name: 'Tests' }, { uri: tests.toString() }), new WorkspaceFolder({ uri: other, index: 2, name: resources.basename(other) }, { uri: other.toString() }), ])), new TestPathService()); }); test('labels of files in multiroot workspaces are the foldername folloed by offset from the folder', () => { labelService.registerFormatter({ scheme: 'file', formatting: { label: '${authority}${path}', separator: '/', tildify: false, normalizeDriveLetter: false, authorityPrefix: '//', workspaceSuffix: '' } }); const tests = { 'folder1/src/file': 'Sources • file', 'folder1/src/folder/file': 'Sources • folder/file', 'folder1/src': 'Sources', 'folder1/other': '/folder1/other', 'folder2/other': 'folder2 • other', }; Object.entries(tests).forEach(([path, label]) => { const generated = labelService.getUriLabel(URI.file(path), { relative: true }); assert.equal(generated, label); }); }); test('labels with context after path', () => { labelService.registerFormatter({ scheme: 'file', formatting: { label: '${path} (${scheme})', separator: '/', } }); const tests = { 'folder1/src/file': 'Sources • file (file)', 'folder1/src/folder/file': 'Sources • folder/file (file)', 'folder1/src': 'Sources', 'folder1/other': '/folder1/other (file)', 'folder2/other': 'folder2 • other (file)', }; Object.entries(tests).forEach(([path, label]) => { const generated = labelService.getUriLabel(URI.file(path), { relative: true }); assert.equal(generated, label, path); }); }); }); </ins>

Discussion:
Issue Type: <bBug</bI have a multi-root workspace with this config: When I open search results in an editor, the part is incorrectly shown as part of the path: And while this looks like just a cosmetic issue , it also breaks opening the file via F12/doubleclick, since the now gets duplicated in the actual path is tries to open. VS Code version: Code - Insiders 1.47.0-insider (, 2020-06-23T09:03:35.861Z) OS version: WindowsNT x64 10.0. Remote OS version: Linux x64 4.14.83-gentoo Remote OS version: Linux x64 4.14.83-gentoo Remote OS version: Linux x64 5.4.28-gentoo Remote OS version: Linux x64 4.14.83-gentoo <details<summarySystem Info</summary </details<details<summaryExtensions (32)</summaryExtensionVersion ------ systemd-unit-file1.0.6 udev-rules1.0.0 viml0.1.7 tmux0.1.0 remote-containers0.123.0 remote-ssh0.51.0 remote-ssh-edit0.51.0 remote-wsl0.44.4 vscode-remote-extensionpack0.20.0 jinjahtml0.13.0 gitconfig2.0.1 mako0.2.0 vscode-icons10.1.1 overtype0.2.0 vscode-module-templates1.3.0 vscode-postgres1.1.11 quick-open-prefill-selection0.0.1 vscode-eslint2.1.5 gitlens10.2.2 EditorConfig0.15.1 prettier-vscode5.1.0 Go0.14.4 search-editor-apply-changes0.1.1 vsc-python-indent1.10.1 restructuredtext128.0.0 MagicPython1.1.0 vscode-github-actions3.0.0 vscode-docker1.3.1 python2020.7.-dev puppet-vscode0.27.3 vscode-yaml0.8.0 vscode-stylelint0.84.0 (1 theme extensions excluded) </details<!-- generated by issue reporter --
Thanks for submitting this! Should be fixed in the next insiders.