API reference from source

Sorry if has been asked before I am a migratory use from Eclipse.

When highlighting a method and using CTRL-P (parameter info) I see a basic arglist (very rudimentary) which quite frankly isn't that useful, even then it does not seem to work all of the time, and effectively is pretty useless.

How can I, when highlighting/selecting a method pull up immediately on-screen the relevant Android/Java doc for that method?

This really is quite essential for me and would really help.

Other than that a great product but this issue essential to me!

Spasiba bolshoi/Many thanks

2 comments
Comment actions Permalink

Use the Quick Documentation (Ctrl+Q or View > Quick Documentation) to view the javadoc. For this to work, you need to have one of the following configured for the library in question: source jar/zip/directory, javadoc jar/zip/directory, or javadoc URL. (See below.) You can have the quick documentation auto popup after a specified delay whenever you explicitly invoke auto completion. Go to File > Settings (Ctrl + Alt +S) > [IDE Settings] > Editor > Code Completion > "Autopopup documentation in (ms)". The quick documentation window can be docked if desired.While viewing the quick documentation, Shift +F1 (or the up arrow button) will open the documentation in your browser.

edikat wrote:

When highlighting a method and using CTRL-P (parameter info) I see a basic arglist (very rudimentary) which quite frankly isn't that useful, even then it does not seem to work all of the time...


If you do not have sources or javadoc attached for the member in question, it will only show the parameter types. For example: new Rectangle(int, int). This is because it does not have the source or documentation to determine the parameter names. If you have one or the other (or both) attached, you will see the parameter names. For example: new Rectangle(int width, int height).

To attach sources and or javadoc:

  1. For manually created libraries, add them in  the project structure (Ctrl+Alt+Shift+S or File >Project Structure) dialog. On the left, select either the global libraries, project libraries, or modules and then the dependencies tab. Click the add button add2.png to add the location of the source jar/zip file or directory, or the javadoc jar/zip or directory. (IDEA auto detects whether they are classes, sources, or javadocs). Alternatively, you can click the add URL button add-url.png to add the javadoc URL.
  2. For maven, open the maven tool window and execute the download documentation and sources command via the download button download-sources-javadics.png. Since some libraries only publish sources, and others only javadocs (and some neither), I find it best to download both. You can configure maven to always download sources & documentation. Open the maven settings either via File > Settings (Ctrl + Alt +S) > [Project Settings] > Maven or via the Maven Settings button maven-settings.png in the maven tool window. On the "Importing" node of the maven settings, check the desired options for the "Always download" option. To make this a default for all future new projects, set the same value under File > Other Settings > Default Settings.
  3. I have not used Graddle yet, but I suspect it is something similar to maven.
  4. For Java or other SDKs, configure the source and/or documentation in the SDK dialog of the Project Structure dialog.
0
Comment actions Permalink

Many thanks Mark, this has been a great help.

I really appreciate the time you took to reply and the answer pretty much sorts out all my issues.

Thanks again.

0

Please sign in to leave a comment.