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

Generate for directive #738

Open
wants to merge 2 commits into
base: analyzer-element2
Choose a base branch
from

Conversation

scheglov
Copy link
Contributor

@scheglov scheglov commented Jan 1, 2025

Continue #735

Note that it restores applies to annotated directives test, as discussed in the previous PR.
This functionality is indeed used, by package:checks generator.

The first version uses analyzer dependency override, because I want want you to look at the code before I publish analyzer .

@scheglov scheglov requested a review from jakemac53 January 3, 2025 18:50
Copy link
Contributor

@jakemac53 jakemac53 left a comment

Choose a reason for hiding this comment

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

LGTM but I don't have too much context for this particular API so @kevmoo might want to look?

@kevmoo
Copy link
Member

kevmoo commented Jan 6, 2025

@scheglov – needs to do some tweaks here, it appears.

Comment on lines 31 to 36
dependency_overrides:
analyzer: ^7.1.0
analyzer:
path: /Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer
build:
git:
url: https://github.com/dart-lang/build.git
Copy link
Member

Choose a reason for hiding this comment

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

Should just delete this section, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, definitely need to use an actual published analyzer.
I need to know if the general approach looks good to you.
If it is, I will publish the analyzer, and update the dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I don't see any objections, so I will move forward with publishing the required analyzer version.
https://dart-review.googlesource.com/c/sdk/+/403264

Copy link
Member

Choose a reason for hiding this comment

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

Uh...I haven't had time to reason about this change yet, honestly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is ETA for reviewing this?

///
/// Implementations should return `null` when no content is generated. Empty
/// or whitespace-only [String] instances are also ignored.
dynamic generateForAnnotatedDirective(
Copy link
Member

Choose a reason for hiding this comment

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

What's the deal w/ this @scheglov ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry, i don't understand the question.
This method is invoked at the line 62.

We cannot use the same method for elements and directive.

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.

3 participants