I have an import ordering setup in IntelliJ:
But when I do Ctrl + alt + O to optimize my imports, it shoves the google imports on top followed by the company imports and does not insert a blank line either. Anything I'm missing here?
Notice how the import packages are displayed:
import com.company.*.* and import com.google.*.*
vs
import java.* and import javax.*
When you specify the package name do not add .* at the end (i.e you have written com.company.*, but you should write com.company instead).
There is a bug listed in IntelliJ's IDEA's bug tracker IDEA-142468 which I believe describes this issue. It appears to particularly not work well when attempting to list static imports first. Unfortunately, I don't see much of a resolution or workaround within that ticket.
While these aren't completely satisfying, here's what I suggest:
Voting for that issue within IDEA's bug tracker system, and perhaps commenting referencing your screenshots of your configuration and how it isn't working for you, if you think doing so may help them understand the conditions of the problem.
Somehow dealing with the problem until the bug is fixed, either by seeing if it's acceptable to your team to have the static imports at the bottom (assuming that it fixes the problem), or otherwise using IDEA's default import ordering. (Which is pretty lousy suggestion, I admit, I'm just not sure what else to suggest if IntelliJ IDEA isn't working and you want to continue using it.)
If you have a support contract with Jetbrains, you could try contacting support to see if they have further suggestions, and to ensure that they know how this bug is affecting your productivity using their tools.
Related
as shown below:
I don't understand why, the syntax and format is correct, it's extremely confusing.
I review my code carefully but can't figure out
this seems to be a bug with VS Code. This could be because VS Code is not updated, or an extension that is not supported anymore.
first, try ctrl + shift + p and running >Developer: Reload Window this should reload your current environment and the error should be fixed.
If that doesn't work, try a different extension. I currently use Vetur, and Prettier.
And don't forget to make sure your VS Code is up to date. go to the bottom left and click the settings cog, then check for update or updates.
My answer is, "Start from scratch, and record your steps." I'm happy to share my notes on what is presently working: https://github.com/TheAutomaTom/VsCodeSettings-Vue3
My personal machine had been in that spot for some weeks, so I took a step back and dump out your cornucopia of extensions and their dependencies.
Only run pertinent language services. This is a tall order given how much a Vue + Typescript + Tailwind on Vite app covers. I am suspicious of generalized HTML/CSS/JS packs though, because they may not be built to parse Vue SFCs. Every new release of a services intended for other frameworks, like Angular or React, are still possible culprits (and moving targets).
I gave up getting Prettier and ESLint on stable ground. For a non-workplace thing, I feel okay about that. You may be having issues with a global package, if you've been experimenting. I've tossed out a couple branches following different tutorials. I intend to revisit this one since it has some example projects: rvest.vs-code-prettier-eslint
I've noticed the Volar team seems to let oddities squeak out a little more frequently than I remember in Vetur.... but we love them just the way they are. Sometimes I downgrade just to check if I've gone crazy, yet.
I am working on a web visualisation for a given project (db with genes, proteins, task is to do some nice visualisation with springboot and thymeleaf). The project was provided with all files, yet I am missing some libraries (also leading to some errors in the code ofc).
When trying to import:
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
lang3 gives me a "cannot resolve symbol" error and automatically searching jars on web results in "no jars found".I found the lang3-jar manually and successfully added it to the project library. When importing:
import org.apache.commons.lang3.*;
All errors for tuple.Pair-usage are gone. Yet, usage of ImmutablePair still results in a "cannot resolve symbol" error.
Firstly, I am confused and now unsure, if my knowledge of imports is correct. I learned, if for example you import something.anything.x and something.anything.y, you could also just import something.anything.*; and x and y would be covered.
Secondly, if needed, where do I find the jars I need (I could not find them yet).
Thanks :)
So, I do not know, where this error results in, yet I do know a solution. When adding the library, select "From Maven" and search for Apache lang3 and add it. Resolves the problems.
Coming from Eclipse world, I really miss this important feature where Eclipse suggests if particular package needs to be imported for compilation error
e.g.
new ArrayList , this simply says Can't resolve symbol
'ArrayList' but doesn't suggest which package to import like eclipse
does.
Is this bug with IDEA or some setting needs to be done in it ?
[Solution]
The problem turns out be bad UX from IDEA
If user does mouse over, it show error message as per above screen shot
If user puts mouse somewhere else; it suggests package to import sometimes. It's not as friendly as Eclipse though
I've posted answer in bottom part of question. IDEA has got confusing & not so user friendly UX which gives hints about package to import.
I find it more useful in Eclipse, hope IDEA team will fix this
https://www.jetbrains.com/help/idea/auto-import.html
I get this error when trying to import a script library from my project.
The Script Library does not use Java and I'm not Turkish. Also, recompiling did not help and it is not LSX.
I even removed the whole code from it and still get the problem. What could be wrong?
Try restarting the Domino Designer.
We have this problem here sometimes and it usually does the trick. It is easy to forget the obvious things sometimes.
Ver 14.1.1 Ultimate:
Can somebody please explain what is going on, what is the so special about crypto package mysterious behavior?
A. Mac class is unresolved according to editor.
B. SecretKeySpec is resolved only via .* notation and would give the same underscore red marking error if I would import individually the class.
C. I can run the method so it compiles?!
Glad I could help :)
IntelliJ has some hickups from time to time, in such cases I choose File -> Invalidate caches and restart. This is my first best shot at such kind of issues, and mostly the go away with that.