Skip to content

Move tree-sitter as a selectable analysis back-end to a commons module and use functionalities without exposing it in the core. #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rahlk opened this issue Feb 8, 2025 · 0 comments · Fixed by #113
Assignees
Labels
enhancement New feature or request

Comments

@rahlk
Copy link
Collaborator

rahlk commented Feb 8, 2025

Description:
Currently, the tool allows users to select Tree-sitter as an analysis backend through the core module. However, to streamline the architecture and encapsulate implementation details, Tree-sitter should be moved to a commons module. This refactoring will allow the tool to leverage Tree-sitter's functionalities internally without exposing it as a configurable option at the core level.

Additionally, CodeQL will be removed and therefore there is no longer a need to expose tree-sitter this way.

Acceptance Criteria:

  1. Tree-sitter is moved to a commons module, encapsulating all Tree-sitter-related logic.
  2. The core module no longer exposes Tree-sitter as a selectable analysis backend.
  3. Update all relevant documentation and code examples to reflect these changes.

Current Code (Before):

if self.analysis_backend in [AnalysisEngine.CODEQL, AnalysisEngine.TREESITTER]:
    # Perform analysis

Proposed Code (After):

from cldk.analysis.commons.treesitter import TreeSitterEngine

# Tree-sitter is now the fallback backend, no need for conditional checks

Steps to Implement:

  1. Create a commons module to house the Tree-sitter engine and related utilities.
  2. Refactor the core module to remove references to Tree-sitter as an exposed option.
  3. Update the initialization logic to use Tree-sitter as the default backend.
  4. Update documentation to reflect these structural changes.

Benefits:

  • Simplifies the core module by reducing unnecessary exposure of backend configurations.
  • Improves maintainability by isolating Tree-sitter-specific logic.

Environment:

  • OS: Fedora 41
  • Java Version: 21
  • Tool Version: 0.4.0 (and lower)
@rahlk rahlk added the enhancement New feature or request label Feb 8, 2025
@rahlk rahlk self-assigned this Feb 8, 2025
@rahlk rahlk linked a pull request Feb 21, 2025 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant