Associate a new instance of it to the file when it is opened or has content changed.
Scan for the file in directives (include, inherit and require) and get the file paths, then store the file paths and their content.
Recursively repeat the step 2 for each file scanned.
When the scan is complete, Loop the stored file paths and content in step 2 to get the symbols (Declared variables and exported variables. e.g. VAR = 'var' and export VAR = '123') using RegEx.
What I am trying to do here:
Without changing the goal of the original SymbolScanner, use the tree-sitter instead of the RegEx.
Move all implementations to the analyzer.
Optimized the file reading since SymbolScanner was doing a lot of the reads while the file didn't change.
Extract the symbols right after reading a file instead of getting all the files first and then looping each file to extract them.
How I do recursive reading on files:
Note that the analyze action inside the sourceIncludeFiles() will invoke file read on disk.
This PR also includes using those symbols for the completion feature.
What
SymbolScanner
was doing:VAR = 'var'
andexport VAR = '123'
) using RegEx.What I am trying to do here:
SymbolScanner
, use the tree-sitter instead of the RegEx.analyzer
.How I do recursive reading on files:
Note that the analyze action inside the sourceIncludeFiles() will invoke file read on disk.
This PR also includes using those symbols for the completion feature.