JetBrains-Research / JetBrains-Research/TestSpark
Provide access level & potentially remove methods' docstrings in the methods information prompt component
- Dominant language
- Kotlin
- Stars
- 88
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
# Description
Currently, the methods information prompt component may look as follows:
```kotlin
=== methods in org.jsoup.Connection.KeyVal:
- /** * Update the key of a keyval * @param key new key * @return this KeyVal, for chaining */ KeyVal key(String key);
- /** * Get the key of a keyval * @return the key */ String key();
- /** * Update the value of a keyval * @param value the new value * @return this KeyVal, for chaining */ KeyVal value(String value);
- /** * Get the value of a keyval * @return the value */ String value();
- /** * Add or update an input stream to this keyVal * @param inputStream new input stream * @return this KeyVal, for chaining */ KeyVal inputStream(InputStream inputStream);
- /** * Get the input stream associated with this keyval, if any * @return input stream if set, or null */ @Nullable InputStream inputStream();
- /** * Does this keyval have an input stream? * @return true if this keyval does indeed have an input stream */ boolean hasInputStream();
- /** * Set the Content Type header used in the MIME body (aka mimetype) when uploading files. * Only useful if {@link #inputStream(InputStream)} is set. *
Will default to {@code application/octet-stream}.
* @param contentType the new content type * @return this KeyVal */ KeyVal contentType(String contentType);- /** * Get the current Content Type, or {@code null} if not set. * @return the current Content Type. */ @Nullable String contentType();
```
I.e., it contains the **methods' docstrings** but does not mention the **access level** (`private/protected/public`) of the listed methods, which 1) inflates the context, potentially leading to the token limit overflow, and 2) may disturb the LLM with too much information if the methods' docstrings are lengthy (the latter point is negotiable since it is hard to reason whether it benefits or degrades the quality).
It is better to 1) provide information about the method access level and 2) either remove the docstring completely or introduce the settings toggle, which indicates whether to include the methods' docstrings.
# Definition of Done
* [ ] In the method information prompt component, list one of the keywords `private/protected/public` before the method signature. Another solution may be to omit the private (and protected) methods, as the LLM still cannot use them without the Reflection API or other non-trivial approaches.
* [ ] Either remove the methods' docstrings from the prompt component or introduce a settings toggle to allow the user to select whether to have the docstring before the method signature [**this one is negotiable**].
Contributor guide
Research direction
Locate the method information prompt component and inspect how it formats method signatures and docstrings. Update the prompt so each method includes its access level and either omits docstrings or exposes the requested setting; done means the generated methods section meets the Definition of Done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100