@@ -14,20 +14,22 @@ interface WorkspaceFileIndexedResponse {
1414 codeData : RawCodeData
1515}
1616
17- class Indexer {
17+ export default class Indexer {
1818 private readonly INDEX_DOCUMENT_REQUEST_CHANNEL = '/matlabls/indexDocument/request'
1919 private readonly INDEX_DOCUMENT_RESPONSE_CHANNEL = '/matlabls/indexDocument/response'
2020
2121 private readonly INDEX_FOLDERS_REQUEST_CHANNEL = '/matlabls/indexFolders/request'
2222 private readonly INDEX_FOLDERS_RESPONSE_CHANNEL = '/matlabls/indexFolders/response'
2323
24+ constructor ( private matlabLifecycleManager : MatlabLifecycleManager , private pathResolver : PathResolver ) { }
25+
2426 /**
2527 * Indexes the given TextDocument and caches the data.
2628 *
2729 * @param textDocument The document being indexed
2830 */
2931 async indexDocument ( textDocument : TextDocument ) : Promise < void > {
30- const matlabConnection = await MatlabLifecycleManager . getMatlabConnection ( )
32+ const matlabConnection = await this . matlabLifecycleManager . getMatlabConnection ( )
3133
3234 if ( matlabConnection == null ) {
3335 return
@@ -46,7 +48,7 @@ class Indexer {
4648 * @param folders A list of folder URIs to be indexed
4749 */
4850 async indexFolders ( folders : string [ ] ) : Promise < void > {
49- const matlabConnection = await MatlabLifecycleManager . getMatlabConnection ( )
51+ const matlabConnection = await this . matlabLifecycleManager . getMatlabConnection ( )
5052
5153 if ( matlabConnection == null ) {
5254 return
@@ -79,7 +81,7 @@ class Indexer {
7981 * @param uri The URI for the file being indexed
8082 */
8183 async indexFile ( uri : string ) : Promise < void > {
82- const matlabConnection = await MatlabLifecycleManager . getMatlabConnection ( )
84+ const matlabConnection = await this . matlabLifecycleManager . getMatlabConnection ( )
8385
8486 if ( matlabConnection == null ) {
8587 return
@@ -143,7 +145,7 @@ class Indexer {
143145 // Find and queue indexing for parent classes
144146 const baseClasses = parsedCodeData . classInfo . baseClasses
145147
146- const resolvedBaseClasses = await PathResolver . resolvePaths ( baseClasses , uri , matlabConnection )
148+ const resolvedBaseClasses = await this . pathResolver . resolvePaths ( baseClasses , uri , matlabConnection )
147149
148150 resolvedBaseClasses . forEach ( resolvedBaseClass => {
149151 const uri = resolvedBaseClass . uri
@@ -153,5 +155,3 @@ class Indexer {
153155 } )
154156 }
155157}
156-
157- export default new Indexer ( )
0 commit comments