Merge pull request #211244 from microsoft/benibenj/experimental-yak

Fix custom labels with absolute pattern
This commit is contained in:
Benjamin Christopher Simmonds 2024-04-24 15:15:32 +02:00 committed by GitHub
commit f3765fb6eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -177,6 +177,7 @@ export class CustomEditorLabelService extends Disposable implements ICustomEdito
private getNthDirname(path: string, filename: string, n: number): string | undefined {
// grand-parent/parent/filename.ext1.ext2 -> [grand-parent, parent]
path = path.startsWith('/') ? path.slice(1) : path;
const pathFragments = path.split('/');
const length = pathFragments.length;