Thanks for sharing this⌠Though does not have all the awesome features (especially code folding) of IntelliJ while editing a java file, this still is very helpful.
I just wanted to share few of my observations -
How about using âJShell Snippetâ option instead of âJavaâ under âInject language or referenceâ? With this option, there is no need to add prefix or suffix and you can keep the import statements inside the Source tag itself.
If you choose to use âJavaâ, instead of Going to File>Settings>⌠you may simply right click on the beanshell code area and click on âShow Context Actionsâ again and select âLanguage Injection Settingsâ to insert the prefix and suffix
Thanks @iamnithesh I will adjust this Show&Tell to incorporate your observations
We have been using the injection of Java before Java9 was released. JShell is indeed a better option. For instance the imports will not show up as Unexpected tokens.
BTW I have Code Folding, but it seems only to be enabled after I reformat the code (Ctrl-Shift-L). Also an awesome feature when using Java/SHell injection
@Remold thank you for your post
I have a question i follow up your steps when I refers to the methods it autocomplete with the package and class name,eg
and if i remove the package (line 19)because its in the top does not open later the class java reference (ctrl +b) pops up the message âit cannot find referenceâ so I have fully the qualify name again to get the java class compile
Invalidate Caches and Restart: The issue might be due to corrupted caches. You can invalidate them and restart IntelliJ IDEA by going to File -> Invalidate Caches / Restart -> Invalidate and Restart.
Re-import the Project: Sometimes, IntelliJ IDEAâs project metadata can get out of sync with the actual project state. This can be fixed by re-importing the project.
Check the Project SDK and Classpath: Ensure that the correct SDK is set up for the project (File -> Project Structure -> Project -> Project SDK), and that the necessary libraries are included in the classpath (File -> Project Structure -> Libraries).
Enable Auto-Import: Ensure that auto-import is enabled for your project. This can be done by going to File -> Settings -> Auto Import (or IntelliJ IDEA -> Preferences -> Auto Import for macOS), and checking the options for optimizing imports on the fly
Note - I took the help from chatGPT here based on the issue you mentioned.
Can you right-click around there area youâre editing and select Show Context Actionsâ
â
Then click 'Edit JShell Snippet Fragment`
A new sub-window will open with the full JShell script (including the Prefix configured).
Maybe there are some syntax error in the top of this fragment, like some extra characters, which prevents the correct import of the sailpoint.object.Filter.
Using the IntelliJ hack is not 100% fail-safe.
Indeed I see the same when I press <ctrl><space>.
Intellij does not know the Object type of Filter when someone directly types Filter, so it extends it to sailpoint.object.Filter This has something to do with code-styling. However I donât know how to âfixâ this issue
Just a quick feedback: - everything works as expected before setting prefix. After setting prefix, autocompletion on IIQ objects stopped working. This happens when the rule script has imports. So when prefix is applied, the implicit object declaration was put between the 2 import sections, which broke the feature. The way to make this work is by putting the object declaration in the suffix.
an answer after 12 months, hopefully this helps. do you want to try my suggestion in the above post? basically just move the object declaration to suffix from prefix.