Skip to content

Conversation

@shivasurya
Copy link
Owner

Description:

This pull request introduces support for parsing and handling Java break statements within the code graph. The changes include updates to the parser, model, and tests to incorporate this new feature.

Parser and Model Updates:

  • Added BreakStmt to the Node struct in sourcecode-parser/graph/construct.go to represent break statements in the graph.
  • Implemented the ParseBreakStatement function in sourcecode-parser/graph/java/parse_statement.go to parse Java break statements.
  • Introduced the BreakStmt struct in sourcecode-parser/model/stmt.go to model break statements.

Graph Construction:

  • Updated the buildGraphFromAST function in sourcecode-parser/graph/construct.go to handle break statements and add them to the graph.

Query Enhancements:

  • Added support for querying BreakStmt in sourcecode-parser/graph/query.go by adding relevant methods and mappings. [1] [2] [3] [4]

Testing:

  • Added tests for parsing break statements in sourcecode-parser/graph/java/parse_statement_test.go.
  • Updated the test for building the graph from AST in sourcecode-parser/graph/construct_test.go to include break statements. [1] [2]

Checklist:

  • Tests passing (gradle testGo)?
  • Lint passing (golangci-lint run this requires golangci-lint)?

@shivasurya shivasurya added the enhancement New feature or request label Nov 4, 2024
@shivasurya shivasurya self-assigned this Nov 4, 2024
@shivasurya shivasurya enabled auto-merge (squash) November 4, 2024 17:35
@shivasurya shivasurya merged commit d8bbf0c into main Nov 4, 2024
2 checks passed
@shivasurya shivasurya deleted the shiva/break-stmt branch November 4, 2024 17:36
@codecov
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 62.22222% with 17 lines in your changes missing coverage. Please review.

Project coverage is 73.17%. Comparing base (d6d1f4d) to head (964d297).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sourcecode-parser/model/stmt.go 0.00% 13 Missing ⚠️
sourcecode-parser/graph/query.go 55.55% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #174      +/-   ##
==========================================
- Coverage   73.53%   73.17%   -0.37%     
==========================================
  Files          15       16       +1     
  Lines        2184     2229      +45     
==========================================
+ Hits         1606     1631      +25     
- Misses        538      557      +19     
- Partials       40       41       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 this pull request may close these issues.

2 participants