File tree 2 files changed +19
-8
lines changed
2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -381,10 +381,20 @@ function encodeURIComponentMinimal(path: string): string {
381
381
* TODO this probably needs to be moved to the workspace service
382
382
*/
383
383
export function asAbsoluteUri ( uri : URI , baseFolders : URI [ ] ) : URI {
384
- return URI . file (
385
- pathUtils . asAbsolutePaths (
386
- uri . path ,
387
- baseFolders . map ( f => f . path )
388
- ) [ 0 ]
389
- ) ;
384
+ const path = uri . path ;
385
+ if ( pathUtils . isAbsolute ( path ) ) {
386
+ return uri ;
387
+ }
388
+ let tokens = path . split ( '/' ) ;
389
+ const firstDir = tokens [ 0 ] ;
390
+ if ( baseFolders . length > 1 ) {
391
+ for ( const folder of baseFolders ) {
392
+ const lastDir = folder . path . split ( '/' ) . pop ( ) ;
393
+ if ( lastDir === firstDir ) {
394
+ tokens = tokens . slice ( 1 ) ;
395
+ return folder . joinPath ( ...tokens ) ;
396
+ }
397
+ }
398
+ }
399
+ return baseFolders [ 0 ] . joinPath ( ...tokens ) ;
390
400
}
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export function formatMarkdownTooltip(content: string): MarkdownString {
54
54
55
55
export const mdDocSelector = [
56
56
{ language : 'markdown' , scheme : 'file' } ,
57
+ { language : 'markdown' , scheme : 'vscode-vfs' } ,
57
58
{ language : 'markdown' , scheme : 'untitled' } ,
58
59
] ;
59
60
@@ -219,9 +220,9 @@ export async function createMatcherAndDataStore(excludes: string[]): Promise<{
219
220
let files : Uri [ ] = [ ] ;
220
221
for ( const folder of workspace . workspaceFolders ) {
221
222
const uris = await workspace . findFiles (
222
- new RelativePattern ( folder . uri . path , '**/*' ) ,
223
+ new RelativePattern ( folder . uri , '**/*' ) ,
223
224
new RelativePattern (
224
- folder . uri . path ,
225
+ folder . uri ,
225
226
`{${ excludePatterns . get ( folder . name ) . join ( ',' ) } }`
226
227
)
227
228
) ;
You can’t perform that action at this time.
0 commit comments