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

When using param in manifold-templates, Idea reports that param may not have been initialized #588

Closed
moheng233 opened this issue May 11, 2024 · 6 comments

Comments

@moheng233
Copy link

Describe the bug
When using param in manifold-templates, Idea reports that param may not have been initialized

To Reproduce
I used the following code to demonstrate the bug

<%@ params(String param1) %>

Hello ${param1} test

<%if (param1 == "1") {%>
<%}%>

Such code will report an error in idea: param1 may not be initialized.
Although the compilation is fine, the idea's error reporting still affects the enjoyment of the development.

Screenshots
image

I'm Chinese for this, so please don't mind my Chinese screenshots. But the reported error is the same as described above.

Desktop:

  • OS Type & Version: Windows11
  • Java/JDK version: JDK21
  • IDE version (IntelliJ IDEA or Android Studio): IntelliJ IDEA 2024.1.1
  • Manifold version: 2024.1.14
  • Manifold IntelliJ plugin version: 2021.1.0
@rsmckinney
Copy link
Member

Hi @moheng233. Sorry for the wait. This issue is specific to the Chinese (Simplified) Language Pack / 中文语言包. Manifold has a lot of the Chinese translations covered, but still more to go. This issue will be fixed along with many other translation related fixes within a couple of days when the next Manifold IntelliJ plugin is released. Thanks for your patience.

@moheng233
Copy link
Author

moheng233 commented May 14, 2024

Hi @rsmckinney, thank you for your reply, but I realized that the language pack is not the cause of the error, because when I uninstalled the language pack, it still had the error.
image

@rsmckinney
Copy link
Member

I can't reproduce this. Although, the sample you have will produce a different error because your template example uses a statement, but should instead use an expression: use <%= param1 %> or ${param1}.

In any case, regarding the Chinese lang pack use, I am positive that's the cause of the error. Lang pack related changes are ready that will be included in the next plugin release tomorrow.

@moheng233
Copy link
Author

I appreciate your response. I will await the next iteration of the software, as I am particularly interested in your work. It is encouraging to see improvements being made to the shortcomings of Java, and it is also beneficial to note that it works well with lombok.

@rsmckinney
Copy link
Member

Nice to hear, thank you very much.

rsmckinney added a commit to manifold-systems/manifold-ij that referenced this issue May 15, 2024
- chinese lang pack support in templates
@rsmckinney
Copy link
Member

Fix available with latest plugin release.

Here you can see a sample template file open with Chinese Language Pack installed. Notice no errors on the param reference.

image

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

No branches or pull requests

2 participants