Skip to content
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

Implement annotating classes, interfaces and enums with source lines data #6

Merged
merged 7 commits into from
Nov 14, 2024

Conversation

daniel-mohedano
Copy link
Contributor

What Does This Do

  • Refactors the old MethodLines annotation into a more general SourceLines annotation
  • Allows annotating classes, interfaces and enums with source lines data

Motivation

In order to display source code for other java structures such as classes in Datadog products the plugin needs to annotate them to provide the source lines information.

Additional Notes

int startLine = (int) lineMap.getLineNumber(startPosition);
int endLine = (int) lineMap.getLineNumber(endPosition);

Name startName = names.fromString("start");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: we can extract the logic that creates the source lines annotation given the start line and the end line to a helper method to avoid duplication

Copy link
Collaborator

@nikita-tkachenko-datadog nikita-tkachenko-datadog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@daniel-mohedano daniel-mohedano marked this pull request as ready for review November 14, 2024 15:28
@daniel-mohedano daniel-mohedano requested a review from a team as a code owner November 14, 2024 15:28
@daniel-mohedano daniel-mohedano merged commit b20f391 into master Nov 14, 2024
5 checks passed
@daniel-mohedano daniel-mohedano deleted the daniel.mohedano/SDTEST-276-class-lines branch November 14, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants