@@ -10,7 +10,6 @@ import { Lazy, lazy } from '../util/lazy';
1010import MDDocumentSymbolProvider from './documentSymbolProvider' ;
1111import { SkinnyTextDocument , SkinnyTextLine } from '../tableOfContentsProvider' ;
1212import { flatten } from '../util/arrays' ;
13- import { DocumentIndex } from '../docIndex' ;
1413
1514export interface WorkspaceMarkdownDocumentProvider {
1615 getAllMarkdownDocuments ( ) : Thenable < Iterable < SkinnyTextDocument > > ;
@@ -27,7 +26,6 @@ class VSCodeWorkspaceMarkdownDocumentProvider extends Disposable implements Work
2726 private readonly _onDidDeleteMarkdownDocumentEmitter = this . _register ( new vscode . EventEmitter < vscode . Uri > ( ) ) ;
2827
2928 private _watcher : vscode . FileSystemWatcher | undefined ;
30- private _docIndex : DocumentIndex = this . _register ( new DocumentIndex ( ) ) ;
3129
3230 async getAllMarkdownDocuments ( ) {
3331 const resources = await vscode . workspace . findFiles ( '**/*.md' , '**/node_modules/**' ) ;
@@ -83,9 +81,9 @@ class VSCodeWorkspaceMarkdownDocumentProvider extends Disposable implements Work
8381 }
8482
8583 private async getMarkdownDocument ( resource : vscode . Uri ) : Promise < SkinnyTextDocument | undefined > {
86- const existingDocument = this . _docIndex . getByUri ( resource ) ;
87- if ( existingDocument ) {
88- return existingDocument ;
84+ const matchingDocuments = vscode . workspace . textDocuments . filter ( ( doc ) => doc . uri . toString ( ) === resource . toString ( ) ) ;
85+ if ( matchingDocuments . length !== 0 ) {
86+ return matchingDocuments [ 0 ] ;
8987 }
9088
9189 const bytes = await vscode . workspace . fs . readFile ( resource ) ;
0 commit comments