When I want to find usage of accessors in my Java class IntelliJ perform searching in whole project which hangs whole IDE. Can I disable or narrow this "deep" searching?
I am currently using the latest version of IDEA Ultimate--(2017.3)
In the menu for accessor usage, there should be a filter icon that you can use to narrow the search to a group as you define it. See the below link for more info:
https://www.jetbrains.com/help/idea/finding-usages-in-project.html
hope this helps!
Related
As the question mentions, what happens when AndroidStudio does indexing? What is the use of indexing?
Could somebody please help me understand.
from https://www.jetbrains.com/
while Android studio is using InteliJ idea :
Indexing in IntelliJ IDEA is responsible for the core features of the
IDE: code completion, inspections, finding usages, navigation, syntax
highlighting, and refactorings.
It starts when you open your project, switch between branches, after
you load or unload plugins, and after large external file updates. For
example, this can happen if multiple files in your project are created
or generated after you build your project.
you can read more about IntelliJ indexing here https://www.jetbrains.com/help/idea/indexing.html
When I try to find usages (Alt F7 or Mouse-Click with CTRL-Button down on the method name at the declaration) of a Java method or field in Android Studio (Version 3.5.3) I am often receiving the message "No usages found in all places" although the method/field is definitely used - often even in the same class.
Is there some kind of index which needs to be updated?
Or any other idea, why obviously existing usages are sometimes not found.
Found it: There is a menu entry "File->Invalidate Caches/Restart ...".
After trying that, everything worked fine again.
Hope this helps others when running into the same problem.
BTW: Pretty dangerous if one relies on the wrong usage information and starts to delete unused methods...
Android and IntelliJ both have support for highlighting log messages based on the log level.
I'd like to go a step further and also highlight "my" classes, means classes from "my" packages - in a different way so that I can recognize them quickly in the log. So I'd like to see an option where I can define a custom string and then give lines which contain this string a custom highlighting. The "string" could be a package name, a debug string, or whatever.
Do you know if such a solution exists already? Maybe there's already a plugin for that?
I'm not aware of anything specifically targeting this use case, but I have workarounds for you.
Search
Focus the LogCat window by clicking into it and the press Ctrl+F, this brings up the local search bar and you can enter your package name:
Filter logs
This solution is from my question: How can I disable Android's internal logging for specific tags (e.g. AbsListView, GestureDetector, endeffect)
If you're having problems with spamming log lines you don't care about just filter them out, for example I have this configuration:
^(?!AbsListView|endeffect|GestureDetector|CustomFrequencyManager|ApplicationPackageManager|PersonaManager|ProgressBar|ViewRootImpl|MotionRecognitionManager)
^(?!Unable to resolve superclass of|Link of class|DexOpt: unable to opt direct call|Could not find class|Could not find method|VFY: )
This leaves only the most important/relevant log lines:
your app's logs
dalvikvm's Garbage Collections
StrictMode
and other unexpected things
High-level logging
I don't suggest you do this, included for completeness. Use only Log.wtf and Log.e for your own logging and set colors/LogCat view's level filter accordingly. This is not really useful if you want to have 5 levels of logging. There may be some sneak-in log lines, but less than normal.
What about the plugin https://plugins.jetbrains.com/plugin/7125-grep-console.
I use it and it is quite good.
I'd like to be able to display an image below a class-level javadoc in Android Studio. My assumption is that I should write a plugin to make this happen.
Does anyone know what I need to do to get an image (JPEG or PNG) to display below a class-level javadoc comment in a Java class file?
I looked into basic information about creating an IntelliJ IDEA plugin but I have no idea where to look to accomplish my task.
This is not possible in the current version of IntelliJ IDEA. The editor can display only text, and does not support embedding of non-text things such as an image file.
You can display images on hover, or in popups, or in dialogs, but not within the editor itself.
Do you want the image to show in the class' source code itself? As an aside, images in Javadocs will show when you view the formatted javadoc view the Quick documentation action (Windows/Linux: Ctrl+Q or Mac: ^J)
If you still want the image to show in the source code, then yes, you will need to write a plug-in. You can look at the Information for Plugin Developers
Setting Up the Plugin Development Environment section of this web page - https://www.jetbrains.com/idea/plugins - to get started. You'll have to dig through source code to try and find some ideas for how to display an image in the source code. As much as I love IntelliJ IDEA, there plug-in documentation is a bit weak. When I wrote a plug-in, I had to do a lot of looking through the IDEA code to find code that was doing things similar to what I wanted to do. I also downloaded the source code for some of the better plug-ins out there and looked through them.
Finally, you can ask for some guidance in the IntelliJ IDEA Open API and Plugin Development forum. That forum is monitored by JetBrains developers. Your best bet to getting answers in that forum is to ask very specific questions. Do not try and get someone to explain from start to finish what you need to do. As you do each step, ask questions about what you are trying to do.
In Resharper, if you ctrl-click the name of a class to naviate to its definition and that has a designer fie, Resharper will ask if I want to go to the X.cs or X.Designer.cs because the class is partial.
Does anyone know how to disable this annoyance so that it just goes to X.cs and ignores designer files?
A workaround I use is Ctrl-Shift-N (ReSharper classic bindings) or Ctrl-T (Visual Studio bindings) and start typing the class name. If you have your classes in files with the same name, you'll then be able to choose the correct one from the dropdown list.
This is a good question. Whenever I have a question like this, I file a suggestion at the ReSharper JIRA site. I'd recommend you do the same.
http://www.jetbrains.net/jira/browse/RSRP
I don't believe you can do what you want at the moment, even with the latest nightly build.
your best bet is to download the nightly build
i have no idea if they addressed this, although i think this is a feature, not an issue.
Nightly Builds