-
Notifications
You must be signed in to change notification settings - Fork 69
[native_doc_dartifier] Extract Public API Signatures for LLM Context #2370
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
base: main
Are you sure you want to change the base?
[native_doc_dartifier] Extract Public API Signatures for LLM Context #2370
Conversation
? (node.parent as ClassDeclaration).name.lexeme | ||
: ''; | ||
|
||
if (className.isEmpty || !_isPublic(className)) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipped the "fields" that are outside classes, is that true, or JNIgen may generate ones that are outside classes?
Same with "methods"
return; | ||
} | ||
|
||
final returnType = node.returnType?.toSource() ?? 'dynamic'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the default value for the returnType, if not explicit, should be "dynamic", or "void"?
expect(withParamsConstructor.className, 'Bar'); | ||
expect(withParamsConstructor.name, 'withParams'); | ||
expect(withParamsConstructor.factoryKeyword, isNull); | ||
expect(withParamsConstructor.parameters, '(this.a, this.b, {int? k})'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (this.a, this.b) should I get the type of them to be (int? a, int? b)
const code = ''' | ||
class Bar { | ||
int _privateField; | ||
int publicField = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here ... in case of final publicField = 10
, the return type will be dynamic ... should I use Dart analyzer to infer its type?
closes #2309
This PR statically extracts public API signatures from Dart source code. The extracted information includes: