-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved support for globs in multiroot workspace (#1083)
* Added path util to resolve absolute path from multiple base directories * Better support for multiple roots in include/ignore globs * URI.asAbsolutePath to use path utils * Lint
- Loading branch information
1 parent
1a961aa
commit 8fe8692
Showing
10 changed files
with
104 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { asAbsolutePaths } from './path'; | ||
|
||
describe('path utils', () => { | ||
describe('asAbsolutePaths', () => { | ||
it('returns the path if already absolute', () => { | ||
const paths = asAbsolutePaths('/path/to/test', [ | ||
'/root/Users', | ||
'/root/tmp', | ||
]); | ||
expect(paths).toEqual(['/path/to/test']); | ||
}); | ||
it('returns the matching base if found', () => { | ||
const paths = asAbsolutePaths('tmp/to/test', [ | ||
'/root/Users', | ||
'/root/tmp', | ||
]); | ||
expect(paths).toEqual(['/root/tmp/to/test']); | ||
}); | ||
it('returns all bases if no match is found', () => { | ||
const paths = asAbsolutePaths('path/to/test', [ | ||
'/root/Users', | ||
'/root/tmp', | ||
]); | ||
expect(paths).toEqual([ | ||
'/root/Users/path/to/test', | ||
'/root/tmp/path/to/test', | ||
]); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
packages/foam-vscode/src/features/commands/create-note-from-template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters