feat: use tree-sitter to parse requirements.txt more correctly#391
Conversation
cd46b6f to
d906a56
Compare
0c78fce to
62d1183
Compare
Review Summary by QodoReplace requirements.txt parsing with tree-sitter and add async support
WalkthroughsDescription• Replace manual requirements.txt parsing with tree-sitter for better accuracy • Add async/await support to provider methods for proper Promise handling • Implement tree-sitter-based requirement parsing with version extraction • Add web-tree-sitter and tree-sitter-requirements dependencies Diagramflowchart LR
A["Manual String Parsing"] -->|"Replace with"| B["Tree-Sitter Parser"]
B -->|"Extract"| C["Package Names & Versions"]
D["Sync Methods"] -->|"Convert to"| E["Async Methods"]
E -->|"Return"| F["Promise<Provided>"]
G["Dependencies"] -->|"Add"| H["web-tree-sitter<br/>tree-sitter-requirements"]
File Changes1. src/providers/requirements_parser.js
|
Code Review by Qodo
1. Missing await on install
|
62d1183 to
d7f26ca
Compare
d7f26ca to
57aafed
Compare
57aafed to
83dd6e4
Compare
Description
Replaced the original manual "parsing" of requirements.txt with a proper tree-sitter based approach. For more info on tree-sitter see https://tree-sitter.github.io/tree-sitter/
Related issues (if any): #242
Checklist
Additional information
Tested this with https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension, some changes required there will be included in the PR that bumps the version of this library too