Extend and make glob pattern configurable #187
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Context
Issue: #47
This builds on the work done a year ago (#113). I ended up re-implementing it to get back into the problem space. Thanks to @przepompownia for re-booting this (#156).
This PR
Here we add support for configuring the glob pattern used when pre-analyzing all bash files (this is done to support jump to definition). Besides making it configurable we extend it from
**/*.shto**/*@(.sh|.inc|.bash|.command).I recommend reviewing commit by commit.
Next steps
This will introduce a few false positives as we do not parse the shebang or mime types (yet), as I tried to document in the fixture folder.
Next step might be to implement the shebang part of #113 or mime types (#47 (comment)) and consider the ideas introduced in #156
But the challenge is that not everyone use shebangs in their bash files... so I guess we shouldn’t make that a filter?
If we can get the included files out of tree sitter, then we could potentially parse those files.