Open arbitrary file in existing Intellij Project - intellij-idea

Intellij is my goto editor for .. just about everything . I tried sublime, vscode, adam and others.. and I do always come back to IJ.
In the past I had been able to use the command line launcher /usr/local/bin/idea and it would open a general file in the currently opened Intellij project. Split second to open. That is not working presently : instead a new Intellij window/application is launched for the sole purpose of editing maybe a small text file. This can take minutes and lots of memory.
The command line options to the launcher are v limited and do not include specifying "open in new window" or not:
$idea --help
Usage:
/usr/local/bin/idea -h | -? | --help
/usr/local/bin/idea [project_dir]
/usr/local/bin/idea [-l|--line line] [project_dir|--temp-project] file[:line]
/usr/local/bin/idea diff <left> <right>
/usr/local/bin/idea merge <local> <remote> [base] <merged>
I would also mention: I do want separate windows for Intellij projects so do not want to reset this option under Appearance & Behavior | System Settings | Project Opening:
Also: note there is a similar question here
Edit non-project files in IntelliJ but that question does require specific project-related capabilities and does not answer my question. My question is for opening general text files.

A partial solution is to use the --temp-project command line option. It creates an unnecessary additional window but does not open an entirely new Application. It's pretty quick. E.g. for
idea --temp-project zoo.data
we get a project with that one file:
I'd still prefer to open the arbitrary file within the currently opened Project - which did happen in the past.

Related

Pipe console output of IntelliJ to a script

It is possible to pipe the console output of an intellij application to a bash command so I can pretty-print it on the console directly?
I know I can save the log output to a file, but I still want to keep it on the stout window only, but just parse it through a script.
Piping output is a feature of the terminal shell.
IntelliJ IDEA is not using a terminal to run your app, therefore it's not possible with the default Run/Debug configurations.
You could use an external tool that will open a command line shell and run your app there, but the shell has to be open in a separate window and it will not be possible to get the formatted output directly in the IDE.
There is a related feature request in YouTrack, but it's unlikely to be implemented soon.

Sigasi in Eclipse

I have just installed the Sigasi Studio pluginin Eclipse (version: Eclipse IDE 2018-12). When I try to launch it,to make a new VHDL file, I get the following:
The selected wizard could not be started. org/eclipse/lsp4j/Range
(occurred in com.sigasi.hdt.vhdl.ui.VhdlExecutableExtensionFactory)
org/eclipse/lsp4j/Range
How I could solve it, please?
Thank you in advance.
Thanks to the Sigasi support, I was able to solve the problem. They wrote me:
The lsp4j plugin version is to recent for the xtext version that ships
with Sigasi Studio 4.2. This issue has been resolved in the preview
channel of release 4.3. Therefore - if you wish to use the plugin
version of Sigasi Studio - I recommend to install the 4.3 preview
following the steps explained on
http://insights.sigasi.com/tech/preview.html.
That's all. Now, I would like to configure Sigasi with GHDL (as a compiler, when I run the project) and GTKWAVE (ad a waves viewer). How can I do that?
Thanks in advance.
SIGASI + GHDL + GTKWAVE (all in one)
It is very powerful combo that you can set up. ATTENTION i use macOS 10.13.6:
Step 1
Make sure you have both installed GHDL and GTKWAVE typing
$ which gtkwave
/usr/local/bin/gtkwave
$ which ghdl
/usr/local/bin/ghdl
Step 2
Open Sigasi an make new Project and create an additional compile.sh file with:
#!/bin/sh
PROJECT_NAME="PWM_Generator"
PROJECT_NAME_TB="PWM_Generator_tb"
WORKING_DIR="/Users/imeksbank/Dropbox/UMHDL"
/usr/local/bin/ghdl -a --workdir=$WORKING_DIR/work.ghdl $WORKING_DIR/$PROJECT_NAME/$PROJECT_NAME.vhd;
/usr/local/bin/ghdl -a --workdir=$WORKING_DIR/work.ghdl $WORKING_DIR/$PROJECT_NAME/$PROJECT_NAME_TB.vhd;
/usr/local/bin/ghdl -e --workdir=$WORKING_DIR/work.ghdl $PROJECT_NAME_TB;
/usr/local/bin/ghdl -r --workdir=$WORKING_DIR/work.ghdl $PROJECT_NAME_TB --vcd=$WORKING_DIR/$PROJECT_NAME/simulation.vcd;
now, be aware, for each project you create your own variables like
PROJECT_NAME
PROJECT_NAME_TB
WORKING_DIR
I use always Dropbox for such approach because then i can access via Windows as well.
And of course, there is a possibility to create custom variables in Sigasi -> External Tool Configurator -> Program -> compile_sh -> environment to pass them to make compile.sh independent. Here you have to deal with it by yourself =)
Step 3 .
Set up you External Tools Configurations to let shell script be executed by Sigasi Studio and create the .vcd file for gtkwave:
Click on currently created Project (in my case it is the PWM_Generator).
After that click on Run -> External Tools -> External Tools Configurations ....
Then go to the left sidebar and under Program create your own anchor like compile_sh.
Finally you have your route :
Program
--compile_sh
And now extend this anchor by a custom created shell script :
Main->Location gets ${workspace_loc:/PWM_Generator/compile.sh}
Main->Working Directory gets ${workspace_loc:/PWM_Generator}
Click Apply and Run and that's it !!! After this you can program VHDL / Verilog and compile via Run -> External Tools -> compile_sh having created .vcd. In your project appears the gtkwave file and there just double click and it starts. =)

Opening files with drag n drop in jedit for ubuntu

This may seem like a stupid question, but I really can't find a way to open files from nautilus using jedit. I tried drag n drop and it doesn't work. Couldn't find any plugins in jedit to do this either.
Alternatively, I don't mind just double clicking to open, but I can't set jedit as default text editor application since it doesn't appear in my application list for some reason. So there's no way I can open the files from nautilus.
The only way i can open at the momemnt is either within jedit or in the terminal, but these are really inefficient for me. So it would be great if anyone could give me a hand in solving this trivial problem.
I did some googling and from here http://jedit-devel.narkive.com/3Qsqp2II/jedit-devel-jedit-drag-and-drop-bug-in-gnome, seems like the versions may be affecting this issue. Not sure about this. But here are my facts
java version "1.7.0_65"
jEdit 5.1.0
How about adding jEdit to List of Applications in “Open With” When Right-Clicking Files in Nautilus?
Instructions from https://ubuntugenius.wordpress.com/2012/06/18/ubuntu-fix-add-program-to-list-of-applications-in-open-with-when-right-clicking-files-in-nautilus/
For example, this is my jedit.desktop file:
$ cat /usr/share/applications/jedit.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=jEdit
GenericName=Text Editor
Comment=Text editor for code
Exec=jedit %F
Terminal=false
MimeType=text/plain;
Icon=jedit
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;
[Desktop Action Window]
Name=New Window
Exec=jedit
OnlyShowIn=Unity;
[Desktop Action Document]
Name=New File
Exec=jedit
OnlyShowIn=Unity;
If you want to make jEdit the default for opening the particular filetype, you can now right-click one, choose Properties, go to the Open With tab, click on jEdit under Recommended Applications, and click the Set as default button.
Hope this helps.
This should work and works just fine for me.
If you are using the version included in the Ubuntu repository, try changing to our official version in our own repository as described on our homepage.
If you are using the official version, look in your Activity Log for anything suspicious when trying to drag&drop.
Also jEdit should be available as a normal Application and for "Open with Application..." just fine, at least with our official packages.
If all does not work, open a bug in the bugs tracker, then we can maybe help you better than here.
This might be something unique to my wonky machine running Ubuntu 12.04, but I found the line JAVA="${JAVA_HOME}/bin/java" to be the problem.
From a terminal, it resolves to the correct value of /usr/lib/jvm/java-8-oracle/bin/java.
However, from the desktop or launcher bar, it resolves to /com/home/users/current/local/java.
Maybe someone more learned than I can explain this, but my solution was to edit the file at /usr/local/bin/jedit, replacing the last line:
exec "${JAVA}" -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -jar "/usr/local/share/jEdit/5.3.0/jedit.jar" -reuseview "$#"
With:
exec "java" -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -jar "/usr/local/share/jEdit/5.3.0/jedit.jar" -reuseview "$#"
This only works if the JVM is set up properly.

phpStorm 7 Code completion stopped working

I have been working with phpStorm and it had suddenly stopped showing suggestions for code completion. When i do Ctrl + space its behaving correctly by showing all the possible options in a drop down.
I have followed the below link and have did invalidate cache but still of no use.
PhpStorm code completion doesn't show core classes/extensions
My Setup is:
OS: Mac - 10.9.2 (Mavericks)
PHPStorm: 7.1.3
I just had the same problem, fixed it when I realized I mistakenly put PHPStorm in Power Save Mode. Click the little fellow on the bottom right of your PHPStorm window and switch that off
Indeed, the Power saving mode (File > Power Saving Mode) allow you to disable the code inspection functionnality.
However sometimes the PhpStorm code analysis failed and you lost your code completion. In this case you juste have to ask for a new code analysis (File > Synchronize [CTRL+ALT+Y]) or invalid the cache and force a restart (File > Invalid cache / Restart).
Hope that helps.
Invalidating the cache did not work for me, but this did:
Enable power save mode (File > Power Save Mode), then disable it.
If your are using a Linux distro (Ubuntu, Debian, Centos) etc, it is due to ibus.
Just change the Shortcut (run: ibus-setup and change to Super+Ctrl+Space for instance) and everything will be fine again.
Or (my favorite): uninstall ibus if you are not using it.
In a Debian/Ubuntu distro should be:
sudo apt-get remove ibus
Ctrl+Space autocompletion should be back.
It was power saving mode for me too. It's an option at the bottom of the File menu.
install a previous version
https://www.jetbrains.com/phpstorm/download/other.html
Worked for me after I tried everything.
I struggled with this for a few hours this morning. After invalidation of caches, a complete reinstall, etc.. nothing worked.
I closed phpstorm and removed the .idea folder in the filesystem. I then renamed the project folder and reopened it. Autocomplete was now working!
I noticed that phpstorm then created the old project directory in the background, even though I did not open it and put a .idea folder in it. Something is obviously corrupted here.
" ... stopped showing suggestions for code completion".
On mac you can invoke it by fn+ctrl+space.
Going to php-storm -> Settings -> Keymap -> Set Active Changelist you can see it is associated with ^+space.
on windows ctrl+space

How do I install uncrustify?

How do I install uncrustify? I followed the instruction to install uncrustify but when I run it, it does not work. Can anyone give me some help installing this tool? I want to run it on objective-c code in xcode 4. Thanks in adavance
On OS X Mavericks 10.9.1 :
1- to install brew, open a terminal windows and type :
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
It will ask you to download some other files, answer OK for all (for more information see : http://brew.sh/index_fr.html).
2 - to install uncrusify, open a terminal windows an type :
brew install uncrustify
3 - to make your code beautiful, download BBUncrustifyPlugin-Xcode available at https://github.com/benoitsan/BBUncrustifyPlugin-Xcode
You will just have to :
compile the project
copy the file uncrusify.cfg in your home directory
restart Xcode.
NB : With BBUncrustifyPlugin, you don't need to use Automator.
4 - After restarting Xcode, use the menu Edit > Uncrustify Selected Files to uncrustify the selected items in the project navigator.
Your code is now beautiful! That's magic!
post-scriptum : You can easily change your uncrusify configuration file by using :
https://github.com/ryanmaxwell/UncrustifyX
http://universalindent.sourceforge.net (better in my case)
I hope that this will help!
I setup Uncrustify with Xcode 4 like so: http://blog.carbonfive.com/2011/03/10/code-formatting-in-xcode-4/
Can you explain what you tried to do, what you expected to happen, and how it didn't work?
Download zip
On Windows, download the latest version of Uncrustify here: https://sourceforge.net/projects/uncrustify/files/latest/download
Extract zip
The program is a standalone exe, so just extract the downloaded uncrustify-...-win32.zip file anywhere. For this example, I'll use C:\Uncrustify. So, the uncrustify.exe would be in that directory.
Add directory to PATH System Environment Variable
In Windows 7+: Type Winkey + env - Select "Edit the system environment variables"
On the Advanced tab, click the Environment Variables button at the bottom.
In the System variables section at the bottom, click the Path variable, then click the Edit... button.
Click the New button, and type C:\Uncrustify, or the directory that you extracted uncrustify.exe to.
Important: Click OK to close the dialog boxes or your change will not save.
Verify
In a CMD window, typing where uncrustify should return the path to the uncrustify.exe.
In my case it shows C:\Uncrustify\uncrustify.exe
Close Atom and reopen it. Now you should be able to atom-beautify and it will use Uncrustify to format your selection