@@ -336,7 +336,7 @@ export function toggleInlayHints(_ctx: Ctx): Cmd {
336
336
// The contents of the file come from the `TextDocumentContentProvider`
337
337
export function syntaxTree ( ctx : Ctx ) : Cmd {
338
338
const tdcp = new ( class implements vscode . TextDocumentContentProvider {
339
- readonly uri = vscode . Uri . parse ( "rust-analyzer://syntaxtree/tree.rast" ) ;
339
+ readonly uri = vscode . Uri . parse ( "rust-analyzer-syntax-tree ://syntaxtree/tree.rast" ) ;
340
340
readonly eventEmitter = new vscode . EventEmitter < vscode . Uri > ( ) ;
341
341
constructor ( ) {
342
342
vscode . workspace . onDidChangeTextDocument (
@@ -388,7 +388,9 @@ export function syntaxTree(ctx: Ctx): Cmd {
388
388
389
389
void new AstInspector ( ctx ) ;
390
390
391
- ctx . pushCleanup ( vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer" , tdcp ) ) ;
391
+ ctx . pushCleanup (
392
+ vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer-syntax-tree" , tdcp )
393
+ ) ;
392
394
ctx . pushCleanup (
393
395
vscode . languages . setLanguageConfiguration ( "ra_syntax_tree" , {
394
396
brackets : [ [ "[" , ")" ] ] ,
@@ -417,7 +419,7 @@ export function syntaxTree(ctx: Ctx): Cmd {
417
419
// The contents of the file come from the `TextDocumentContentProvider`
418
420
export function viewHir ( ctx : Ctx ) : Cmd {
419
421
const tdcp = new ( class implements vscode . TextDocumentContentProvider {
420
- readonly uri = vscode . Uri . parse ( "rust-analyzer://viewHir/hir.txt" ) ;
422
+ readonly uri = vscode . Uri . parse ( "rust-analyzer-hir ://viewHir/hir.txt" ) ;
421
423
readonly eventEmitter = new vscode . EventEmitter < vscode . Uri > ( ) ;
422
424
constructor ( ) {
423
425
vscode . workspace . onDidChangeTextDocument (
@@ -467,7 +469,9 @@ export function viewHir(ctx: Ctx): Cmd {
467
469
}
468
470
} ) ( ) ;
469
471
470
- ctx . pushCleanup ( vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer" , tdcp ) ) ;
472
+ ctx . pushCleanup (
473
+ vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer-hir" , tdcp )
474
+ ) ;
471
475
472
476
return async ( ) => {
473
477
const document = await vscode . workspace . openTextDocument ( tdcp . uri ) ;
@@ -481,7 +485,7 @@ export function viewHir(ctx: Ctx): Cmd {
481
485
482
486
export function viewFileText ( ctx : Ctx ) : Cmd {
483
487
const tdcp = new ( class implements vscode . TextDocumentContentProvider {
484
- readonly uri = vscode . Uri . parse ( "rust-analyzer://viewFileText/file.rs" ) ;
488
+ readonly uri = vscode . Uri . parse ( "rust-analyzer-file-text ://viewFileText/file.rs" ) ;
485
489
readonly eventEmitter = new vscode . EventEmitter < vscode . Uri > ( ) ;
486
490
constructor ( ) {
487
491
vscode . workspace . onDidChangeTextDocument (
@@ -528,7 +532,9 @@ export function viewFileText(ctx: Ctx): Cmd {
528
532
}
529
533
} ) ( ) ;
530
534
531
- ctx . pushCleanup ( vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer" , tdcp ) ) ;
535
+ ctx . pushCleanup (
536
+ vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer-file-text" , tdcp )
537
+ ) ;
532
538
533
539
return async ( ) => {
534
540
const document = await vscode . workspace . openTextDocument ( tdcp . uri ) ;
@@ -542,7 +548,7 @@ export function viewFileText(ctx: Ctx): Cmd {
542
548
543
549
export function viewItemTree ( ctx : Ctx ) : Cmd {
544
550
const tdcp = new ( class implements vscode . TextDocumentContentProvider {
545
- readonly uri = vscode . Uri . parse ( "rust-analyzer://viewItemTree/itemtree.rs" ) ;
551
+ readonly uri = vscode . Uri . parse ( "rust-analyzer-item-tree ://viewItemTree/itemtree.rs" ) ;
546
552
readonly eventEmitter = new vscode . EventEmitter < vscode . Uri > ( ) ;
547
553
constructor ( ) {
548
554
vscode . workspace . onDidChangeTextDocument (
@@ -591,7 +597,9 @@ export function viewItemTree(ctx: Ctx): Cmd {
591
597
}
592
598
} ) ( ) ;
593
599
594
- ctx . pushCleanup ( vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer" , tdcp ) ) ;
600
+ ctx . pushCleanup (
601
+ vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer-item-tree" , tdcp )
602
+ ) ;
595
603
596
604
return async ( ) => {
597
605
const document = await vscode . workspace . openTextDocument ( tdcp . uri ) ;
@@ -688,7 +696,7 @@ export function expandMacro(ctx: Ctx): Cmd {
688
696
}
689
697
690
698
const tdcp = new ( class implements vscode . TextDocumentContentProvider {
691
- uri = vscode . Uri . parse ( "rust-analyzer://expandMacro/[EXPANSION].rs" ) ;
699
+ uri = vscode . Uri . parse ( "rust-analyzer-expand-macro ://expandMacro/[EXPANSION].rs" ) ;
692
700
eventEmitter = new vscode . EventEmitter < vscode . Uri > ( ) ;
693
701
async provideTextDocumentContent ( _uri : vscode . Uri ) : Promise < string > {
694
702
const editor = vscode . window . activeTextEditor ;
@@ -714,7 +722,9 @@ export function expandMacro(ctx: Ctx): Cmd {
714
722
}
715
723
} ) ( ) ;
716
724
717
- ctx . pushCleanup ( vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer" , tdcp ) ) ;
725
+ ctx . pushCleanup (
726
+ vscode . workspace . registerTextDocumentContentProvider ( "rust-analyzer-expand-macro" , tdcp )
727
+ ) ;
718
728
719
729
return async ( ) => {
720
730
const document = await vscode . workspace . openTextDocument ( tdcp . uri ) ;
0 commit comments