-
Notifications
You must be signed in to change notification settings - Fork 5
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
Object only used in String template is marked as unused #39
Comments
An even worse case: String text = "${StringUtils.substring(value, 1)}" If |
Latest version of everything:
This also happens for me with the sample project: |
Looking at your earlier screenshots, it appears string templates aren't really enabled, for instance local var usage s/b highlighted. This is probably the root of the problem. Can you provide your build file[s]? A simple change will probably fix things up for you. |
It is enabled. Using the Edit: However, it's not fixed everywhere. Method parameters still don't get marked as being used: So now I'm not sure anymore what the config should be. When looking at the documentation, I see that only an annotated processor is added: <annotationProcessorPaths>
<path>
<groupId>systems.manifold</groupId>
<artifactId>manifold-strings</artifactId>
<version>${manifold.version}</version>
</path>
</annotationProcessorPaths> However, I don't see this in the <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<manifold.version>2024.1.17</manifold.version>
<maven.compiler.source>22</maven.compiler.source>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<encoding>UTF-8</encoding>
<compilerArgs>
<arg>-Xplugin:Manifold</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>systems.manifold</groupId>
<artifactId>manifold-strings</artifactId>
<version>${manifold.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>systems.manifold</groupId>
<artifactId>manifold-strings</artifactId>
<version>${manifold.version}</version>
</dependency>
</dependencies>
</project> It looks like only the dependency is needed, not the annotationProcessorPath. edit2: It does work when I add it in the |
Yeah, most of the test modules aren't setup for IntelliJ use. Always refer to the setup docs for manifold features. In this case, see the manifold-strings setup docs. Also see the android docs if you're working in that environment. |
I have the same issue. Intellij thinks a static function that's used in a string template as unused, and removes it when organizing imports. Intellij manifold plugin version 2024.1.6, pom.xml:
|
Objects that are only used in a String Template are marked as unused.
Also applies to method parameters:
The text was updated successfully, but these errors were encountered: