-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Scripting: Parse stdlib files for parameter names #67837
Scripting: Parse stdlib files for parameter names #67837
Conversation
* Task generateContextApiSpec takes optional system parameter `jdksrc` with path to extracted java standard library source files. * stdlib source files are the source of `parameter_names` list and the `javadoc` value. * javadoc values may contain newlines and markup such as `{@code XX}`, `<p>`, `@throws` Example method: { "declaring": "Appendable", "name": "append", "return": "Appendable", "javadoc": "Appends a subsequence of the specified character sequence to this...", "parameters": ["CharSequence", "int", "int" ], "parameter_names": ["csq", "start", "end"] }
Pinging @elastic/es-core-infra (Team:Core/Infra) |
…ing/jdk-src-parse-01
…ing/jdk-src-parse-01
this.importedMethods = Method.fromInfos( | ||
info.getImportedMethods(), | ||
javaNamesToDisplayNames, | ||
new StdlibJavadocExtractor.ParsedJavaClass() |
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.
Verify if necessary.
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.
LGTM! Thanks for the walkthrough earlier.
A couple of thoughts:
- We chatted briefly about this, but would you please double check that String is correctly inserted for shared API methods, so we don't end up with the same bug our current documentation has.
- I wonder if on the design it would make more sense to collect the jdk info after collecting our whitelist info so that if it's null it doesn't have to be checked for null multiple times.
modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/StdlibJavadocExtractor.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/StdlibJavadocExtractor.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/StdlibJavadocExtractor.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java
Show resolved
Hide resolved
modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java
Outdated
Show resolved
Hide resolved
* Scripting: Parse stdlib files for parameter names * Task `generateContextApiSpec` takes optional system parameter `jdksrc` with path to extracted java standard library source files. * stdlib source files are the source of `parameter_names` list and the `javadoc` value. * javadoc values may contain newlines and markup such as `{@code XX}`, `<p>`, `@throws` Example method: ``` { "declaring": "Appendable", "name": "append", "return": "Appendable", "javadoc": "Appends a subsequence of the specified character sequence to this...", "parameters": ["CharSequence", "int", "int" ], "parameter_names": ["csq", "start", "end"] } ```
* Scripting: Parse stdlib files for parameter names (#67837) * Scripting: Parse stdlib files for parameter names * Task `generateContextApiSpec` takes optional system parameter `jdksrc` with path to extracted java standard library source files. * stdlib source files are the source of `parameter_names` list and the `javadoc` value. * javadoc values may contain newlines and markup such as `{@code XX}`, `<p>`, `@throws` Example method: ``` { "declaring": "Appendable", "name": "append", "return": "Appendable", "javadoc": "Appends a subsequence of the specified character sequence to this...", "parameters": ["CharSequence", "int", "int" ], "parameter_names": ["csq", "start", "end"] } ``` Backport: 7c98d9a * Scripting: readable array types for context api (#68237) Instead of fixing up array names post-hoc when generating the api spec and painless context docs, fix them up in the `_scripts/painless/_context` API call. Backport: 460b33f
master: 7c98d9a |
jdksrc
with path to extracted java standard library sourcefiles.
parameter_names
listand the
javadoc
value.{@code XX}
,<p>
,@throws
Example method: