How to show Javadoc on hover in VS Code in Java Project? - visual-studio

In my Mac OS 10.14 I have VS Code 1.47.3 and yesterday installed Java Extension Pack 0.9.1. I am able to run Java project (Maven) but I do not see any javadoc on hover feature. For example when mouse pointer is hovering on ds.show() (line 29) in screenshot, I expect to see hover pane showing docs on show method like it shows in same eclipse project. I have JDK8 and OpenJDK14 installed on my system.
Here is the screenshot:
Below is not important:
Also how to disable annoying logs in Terminal window when I am editing file? These logs look like:
3a6e249d Publish Diagnostics [Done]
6dcf0221 Building [Done]
ebb16695 Building [Done]
0e4416a3 Validate documents [Done]
As can be seen in screenshot.

If you are still stuck, I found a way, just try enabling 'Intellisense' in your red hat java extension. This may work for you.
And for those logs, looks like your are running your application in debug mode. Your can't disable them if that's the case.
EDIT (The actual solution):
Javafx java docs in vs code
To achieve the above results, follow bellow steps.
Go to User/Workspace settings.
Hit ctrl f and type java.project.referencedLibraries.
Click edit in settings.json.
Paste the following setting.
"java.project.referencedLibraries": {
"include": [
"lib/**/*.jar",
"%PATH_TO_FX%/lib/*.jar"
],
"sources": {
"%PATH_TO_FX%/lib/javafx.base.jar": "%PATH_TO_FX%/src.zip",
"%PATH_TO_FX%/lib/javafx.controls.jar": "%PATH_TO_FX%/src.zip",
"%PATH_TO_FX%/lib/javafx.fxml.jar": "%PATH_TO_FX%/src.zip",
"%PATH_TO_FX%/lib/javafx.graphics.jar": "%PATH_TO_FX%/src.zip",
"%PATH_TO_FX%/lib/javafx.media.jar": "%PATH_TO_FX%/src.zip",
"%PATH_TO_FX%/lib/javafx.swing.jar": "%PATH_TO_FX%/src.zip",
"%PATH_TO_FX%/lib/javafx.web.jar": "%PATH_TO_FX%/src.zip",
"%PATH_TO_FX%/lib/javafx.swt.jar": "%PATH_TO_FX%/src.zip"
}
}
Here %PATH_TO_Fx% is the path to the javafx folder or javafx env variable. Be sure if you are linux/mac user type it like $PATH_TO_FX. To set enviorment vairable for javafx refer the getting started section of openjfx.org

Try viewing it with an Keyboard-Shortcut, to see if the documentation is availible or if your IntelliJ has pathing issues:
The Command for this is editor.action.showHover command. Default it's mapped to cmd+k -> cmd+i, I think.
Another problem which happens often with my JS environment is that i have to select the call (In your case ds.show()) and then hover over it, while selected.

Related

How to remove an application "tile" from Anaconda Navigator Home tab

I have a bunch of apps that I will never use (GLueviz, Orange3, Rstudio) that I would like gone from my Home tab. They are not installed, but there is no way to remove the tile for the app. The gear icon isn't going to do it for me.
I dug into the config file ~/.anaconda/navigator/anaconda-navigator.ini and nothing obvious there. Oddly it says that vscode_enable = False yet VS Code does appear as a tile.
I'm running 1.9.12 individual edition on MacOS Catalina.
On navigator 2.1.1, I was able to comment out the two lines for Datalore and IBM Watson in ~/opt/anaconda3/pkgs/anaconda-navigator-2.1.1-py39_0/lib/python3.9/site-packages/anaconda_navigator/api/external_apps/__init__.py.
web_apps: 'typing_extensions.Final[typing.Mapping[str, WebAppInitializer]]' = {
#'datalore': DataloreApp, # noqa: F405
#'ibm_watson': IBMWatsonApp, # noqa: F405
}
Based on the Anaconda docs https://docs.anaconda.com/navigator/tutorials/custom-tiles/, you can create a yaml file that will allow you to disable some of the tiles.
In practice, I've found this works for some apps, but may not work for all. For example, some of the gnuradio apps go away, but many do not (e.g., gnuradio-build-deps).
Create a yaml file at ~/.anaconda/navigator/applications/ (MacOS)
Add the code to disable an application from view:
glueviz:
is_available: false

visual studio code "launch json" on run, how to set debug console as default

I went to user settings to set the debug console to default (when I try to debug now the default console is terminal. I lose the small debug icons to skip, stop etc even when I manually select debug console). I am watching Python tutorials using Vs Code and his default is debug. How can I do this?
Secondly, when I try to run or debug, I am prompted to open LaunchJS, even if it is already open. I attempted to run it using the debug selection "current file, integrated terminal" and also "Python: Attach". Neither will work although the JSON file has these options. I looked at some MS videos but I am not understanding the problem.
Any help is appreciated. Thanks.
I found the answer at this link: https://code.visualstudio.com/docs/python/python-tutorial
I had not selectd a Python interpreter which establishes a python workspace. Was just trying to run with debugger. A simple program now runs. My guess is that the Python tutorial I selected is too old to follow with this version of VS Code, since I am unfamiliar with any version of VS Code.
Thanks.

Unable to find APP_BUNDLE_PATH. Cannot find a built app that is linked with calabash.framework

I am running calabash-cucumber in xcode 5.0.1 on OSX 10.9.1, but getting this error while executing the test script. I have installed calabash framework successfully, but don't know why this error occurs.
Error... Unable to find APP_BUNDLE_PATH.
Cannot find a built app that is linked with calabash.framework
Please build your app from Xcode
You should build your calabash target.
Alternatively, specify APP_BUNDLE_PATH in features/support/01_launch.rb
This should point to the location of your built app linked with calabash.
(RuntimeError)
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.9.168/lib/calabash-cucumber/launch/simulator_helper.rb:178:in `app_bundle_or_raise'
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.9.168/lib/calabash-cucumber/launcher.rb:307:in `relaunch'
/Users/mymac/Desktop/myproject/myproj/features/support/01_launch.rb:29:in `Before'
Does your simulator or device contain the YourApp-cal target installed? Check weather you run the YourApp-cal target once from the xcode to install the app with calabash server on simulator or device.
Then Check you have followed setup Process
You need to have xcode tools installed too.
Check these things too.
Build the yourApp-cal target and run using xcode once.
While App is running open a Terminal(console) and type calabash-ios console. If your ruby environment is correct it will open you a ruby console.
In that console type
server_version['version']
and
Calabash::Cucumber::FRAMEWORK_VERSION
you should get something like "0.9.164"
calabash.framework is installed correctly in your app.
If so You should go to the file /YourProject/features/support/01_launch.rb open it check weather app bundle path is specified or not (if it is commented out calabash automatically detect the default app bundle path) if you are building your app to somewhere else than the default place you need to specify the appbundle path here in this file.
Tell us more details after check this list so we can help you more..
I hit the same issue, the way I got around to it is, on Xcode's top-right corner there is "Identity and Type" window. There you will find the full path of anything that you select on left (Project Explorer window).
Now usually on the ProjectExplorer window you should have "Classes", "Common", "Frameworks", "Other Sources", "Product", "Resources", "Scripts" etc. (It might be slightly different project by project). Inside "Product" is where your .app lives.
Select your app and you'll see the whole path on "Identity and Type" window.
Copy and paste it to "support/launch.rb" where it says APP_BUNDLE_PATH.
Should work now.
Edit 29/07/14: Do you see
HTTPServer: Started HTTP server on port 37265 on 'All output' window of Xcode (my version of Xcode is 5.1) when you build ?
There is a better way to set up calabash so you won't have this problem.
It involves creating a configuration, rather than a -calabash target. Basically you
1. create a configuration
2. add calabash framework to that configuration in build settings
3. add framework search path to find that framework
4. create a scheme to run calabash
The longer version can be found
http://fangmobile.com/2014/05/08/do-you-love-calabash-ios-but-hate-that-cal-second-target/
Deleting the contents of /Library/Developer/Xcode/DerivedData and compiling again solved this problem for me.
My error message was Unable to auto detect APP_BUNDLE_PATH.

Changing node webkit app icon on windows from cli

I'm currently trying to build a .bat script to autobuild my node-webkit application, and the only missing thing is changing the generated .exe icon.
I've been digging the interwebs for a while whitout finding any working solution.
So far I've tried :
Resource Hacker : I managed to change the icon using the application, but could not make it work with a script. Here is a screenshot of resource hacker with my exe
I tried the following commands :
ResHacker -modify App.exe, AppTest.exe, MyIcon.ico, Icon, 1
ResHacker -modify App.exe, AppTest.exe, MyIcon.ico, Icon, 1, 1033
ResHacker -addoverwrite App.exe, AppTest.exe, MyIcon.ico, "Icon Group", IDR_MAINFRAME, 1033
ResHacker -addoverwrite App.exe, AppTest.exe, MyIcon.ico, "Icon Group", IDR_MAINFRAME
Unfortunately, none of these created the AppTest.exe file neither did they print and error message.
RCEDIT.exe which is part of the WinRun4JS application, their home page shows an example of using RCEDIT to change the icon : RCEDIT.exe /I [YourApp].exe [YourApp].ico, this is indeed working iconwise, but it breaks the node-webkit executable and leaves me with an application running the default nodejs page. ( As a reminder, node-webkit exe are built this way
Various other applications worked fine but none of them seemed to propose a command line interface.
I feel like I'm quite close to the solution with Resource Hacker and I might have missed something obious while fiddling with it but right now I can't thing of anything else to try.
Thank you for reading and have a nice day !
As always, I was not trying hard enough, the right command for ResHacker was :
ResHacker -addoverwrite "App.exe", "AppTest.exe", "MyIcon.ico", ICONGROUP, IDR_MAINFRAME, 1033
Also if someone wants to dig mvanderw's solution you will need Resourcer and then run the following command :
Resourcer -op:upd -src:App.exe -type:14 -name:IDR_MAINFRAME -file:MyIncon.ico
I would rather not update the icon of the nw.exe, since it's what NodeWebKit provides. What my solution was to launch the application through a shortcut and setting the proper icon for the shortcut. That way we are using NW but not hacking it.
Note: context was windows and a setup creator like "Inno Setup", makes it easy to do.
UPDATE:
Now that I got your question, why don't you use the WinIco options of the nw-builder.
options.winIco
Extracted from the gulp task
var nw = new NwBuilder({
version: '0.12.0',
files: [ bases.dist + '**'],
platforms: ['win'],
buildDir: bases.webkit,
winIco: 'YourApp.ico',
macIcns: 'YourApp.icns'
});

How to debug play2 in idea?

I found some articles on the internet and some discussions on google group, but they don't work any more.
How to do it with the latest play2-RC3 ?
You can start the play server in debug mode from console [docs], and should be able attach a debugger instance from Idea given that you know the port debugger is listening on.
I haven't use Idea so not sure if it is doable or not. It is fairly easy from netbeans. I suspect, it should be similar from Idea.
EDIT: They have also posted this in their customization guide for IDEs.
Debugging Play 2.x is very easy with IntelliJ IDEA 12.x, here are the steps you have to do:
Step 1. Enable the Play Framework Support plugin and the Play 2.0 Support plugin in File > Settings > Plugins.
The generic plugin usually comes with IntelliJ but make sure it's enabled. The Play 2.0 Support plugin can be downloaded by clicking Install Jetbrains plugin.... Simply locate and install the plugin from the list, the latest working version for 12.x is v.0.2.49. (it may prompt that a Scala plugin needs to be installed aswell)
Step 2. Create a new Play app if you haven't or use an existing one
Step 3. Create a new Debug configuration: Run > Edit configurations...
You can click the + icon in the top left corner to add a new configuration. Simply select Play 2 app from the list and give the configuration a name. The default options should be correct but feel free to change them if necessary. When done, click Apply and Ok.
Step 4. Your toolbar should now have a Run icon and a Debug icon enabled.
Simply click the green arrow to run the Play application. This is the equivalent of doing play run from the commandline (except without the commandline).
To debug, click the green bug, next the the arrow. This is the equivalent of doing play debug from the commandline.
You will now be able to debug when a breakpoint is encountered.
Notes:
Make sure there is only 1 configuration running at a time because Play doesn't like multiple instances running at the same time.
If you're having trouble compiling, do a play clean-all and play package on the commandline, this should resolve most problems. If there are further problems, also try play idea from the commandline.
Make sure the Play configuration is filled in in your settings. You can do this by going to File > Settings > Play Configuration.
A video of these steps can also be found in this video by James Ward (start at around 1:40 min.).
Go to Run -> DEBUG -> Edit Configurations
use "Remote" Configuration and set the Port to 9999

Resources