Run eclipse editor action on entire project - eclipse

Question:
Is there a way to run an eclipse action that is available from the context menu in the editor on every file of an project.
Actual Case:
I have to work with the leon3 and my dull mind has trouble enough understanding the code, that I do not want to scan lines to see if there is a semicolon hidden in there to see if there are multiple instructions or if the end if happens to be behind another instruction rather than on a line of its own (I missed an end if, which caused me to think that statements were conditional,...), therefore I would like to format the source nicely. I have access to Sigasi PRO which offers the option to "beautify" code as an operation in the editor. I would like to run this operation on all files in the leon project automatically.

Sigasi indeed only offers formatting in the editor at this time. In the Sigasi editor, you can format a selection or the entire editor's content. But, you can not trigger the formatting action without an editor.
I have not tried this, but I think you can achieve this with the Eclipse EASE project. EASE is a scripting environment for Eclipse.

Related

Eclipse is very slow on Save Action. Any way to improve this?

I am using Eclipse 2019. It is very slow on Save Action. It is necessary for me to enable the Save Action to do code format and indent check. But it is really a pain to watch Eclipse busy and slow at that point.
Is there a way to improve this?
I am trying Intellij. It is much much better than Eclipse on the Save Action.
I really hope Eclipse has the same or similar performance.
EDIT:
I am using Eclipse IDE for Enterprise Java Developers, Version 2019-12.
I only installed two editor plugins: One for resource bundle file and one for bash file.
EDIT 2:
Sorry, I should say that the Save Action on big Java file is slow. We have many files are more than 2 thousand lines. Some of them are double, triple that size, or even more. We often see the dialog telling us that we can turn off the Save Action to shorten waiting time. I tested with Intellij. The same file, the same formatter and Save Action, there is no noticeable delay in Intellij but Eclipse needs more time (noticeable even that dialog does not show up) to finish the action. There is nothing to do with the change itself, change many places, or change one line is the same. My guess is that Intelliji may be tracing the changes during the process and do format and Save Action only on where is changed. But Eclipse may not tracing the changes during the process and do format and Save Action on the entire file at the end.
I have no source control and other things attached.
Were you saving with Ctrl-S?
I was having a similar (or the same problem) whenever I was Ctrl-C/V to copy/paste. It seems the underlying problem may have been that my Hyperlink key was "Ctrl", so that whenever I was about to Copy/Paste, it was trying to work out Hyperlink options - stalling the editor.
Changing the Hyperlink modifier key (General > Editors > Text Editors > Hyperlinking) to Alt and the slow copy/paste is no more.

Netbeans Formatting from Terminal

SITUATION: In Netbeans you can format the whole project or its folders recursively by selecting a tree node in Project window and pressing Ctrl+Shift+F.
PROBLEM: To get unified format for our team project we need to format it with fixed formatting settings before merges. Some don't use Netbeans. Opening it for this sort of operation is uncomfortable. Also imported formatting settings can be manually modified by irresponsible programmers later. Automation is required. A possibility to call this function as a part of special script is required.
QUESTION: Is there a way to call this Netbeans function from terminal (command line)?

Groovy-Grails Tool Suite (GGTS) content assist not recognizing basic groovy

I have installed GGTS, on ubuntu and am trying to edit .Groovy files with the built in editor.
The autocomplete is extremely annoying because while it will recognize my domain objects i.e. my User class etc.. It doesn't recognize basic groovy, for instance I start typing "def" to define a variable then hit space and it will autocomplete to "Default", similarly if I try to type in "return" it autocompletes to "RETURN" while I am typing as soon as I hit space, which is very annoying.
Like i said it will recognize classes, so if I type def u = new User(), the User part will complete ok, but the problem is that the variable u I defined earlier isn't recgonized later in the code.
I hope you guys get my meaning... No idea how to fix it, short of not using the groovy editor and treating it as plain text. I even tried disabling content assist, but that didn't seem to work for some reason
I was having this problem in GGTS 3.4.0.RELEASE today, and getting very angry with the situation.
Somehow my workspace had the "Auto activation triggers for Java" set to "_.abcd....z" (all the lowercase letters)
Window -> Preferences
Java -> Editor -> Content Assist
"Auto activation triggers for Java" set to just "."
This seems to have helped dramatically.
I'm still not sure what caused my workspace to have this setting.
Make sure that you're in the Grails perspective; that can impact some of the Groovy/Grails features and how Eclipse (even GGTS) leverages them. You'll find the perspective button in the upper right. If you're in Java or Debug, odd things like this may occur.
Also, how are you creating and opening your Groovy files? Do you use the context menus or the Grails command prompt tool to issue orders like "create-controller"? If you're creating the files in some other way, try using those methods to generate them, and see if you get the same results.

how to write notepad++ auto-complete plugin

I'm trying to develop a small plugin that will do a sort-of auto-completion along with some other advanced features in order to create a primitive IDE to use with a custom scripting language we've developed.
So I want to know, how do the auto-complete plugins usually work? I have a basic plugin template that I'm playing around with (the C# one) and I see how the commands work, from a high level anyway, but I'm trying to figure out how I would create my auto-complete feature.
My first guess would be to make a command that spawned a new thread that retrieved the entire contents of the notepad++ text every 100 mills or so and then popped-up a little selector box or directly wrote the auto-complete possibilities when the correct pattern was matched on the newly typed text.
Any wisdom from those who have gone before me on this?
Thanks alot.
Well I figured it out. Apparently there is a "beNotified" method in my project template that I downloaded and it handles all events/notifications from the Scintilla/Notepad++ environment. I will probably be using the SCN_CHARADDED event to check the current line of text each time a character is added to the GUI.

Is it possible to make the auto-complete in netbeans not depend on a key-combination?

Is it possible to make the code-completion on Netbeans automatic, like on Aptana or Visual Studio?
I've noticed that Netbeans can sometimes take a while to populate the list, so this might be asking a bit too much, but if possible, I'd like to somehow enable it.
The onlything I've found in the options is the ability to set a custom key-combo, but not to make this automatic.
I know that if you wait a bit, the auto-completion shows up anyway, but I want it to be without delay.
It appears there is a setting in some NetBeans versions that sets the delay for the popup window.
Choose Tools | Options
Choose Advanced Options
Open the Editing and then Editor Settings folders
Select Java Editor and find the Delay of Completion Window Auto Popup property
Enter a new Delay value in milliseconds (default is 250).
Article where I found it: http://www.informit.com/articles/article.aspx?p=519945&seqNum=5
The problem is that this article is a couple years old, so I opened NetBeans (6.1) on my computer and looked for the property but it didn't exist for the Java Editor (It did for other editors like the XML Editor). This leads me to believe my version is newer than the one in the article and the delay property no longer exists for the Java Editor (checking couldn't hurt though).
So instead, I decided to test the delay. I made a sample project, imported and instantiated a list, and then went to call a method. I stopped at the dot to let NetBeans offer suggestions and it was basically immediate (no noticeable delay). It is at this point, I am wondering if the delay you are experiencing is due purely to performance of the computer, especially since you indicate this occurs "sometimes". It is possible that you are looking at rather large classes, and NetBeans is taking extra time to look up the completions. You could try and test to see if this is true or not by testing code completion on a known large class. The other possibility is your computer is not as fast, or is doing work for another program at the same time. You can try and test this by restarting the computer, opening only NetBeans (to maximize resources to NetBeans), and try some code completions. If either exhibit noticeably faster delays, this is most likely the problem.
Hope this helps.
I think I found a solution. I set up autocomplete keyboard shortcuts for all letters and #, it seems to work. In some cases there is a small lag, but it doesn't prevent you from typing. It took about 5 minutes to add those shortcuts.
I tried to get the desired feature by adding the alphabet to the completion selectors. It worked somewhat, you can always try it.
This works for the first two characters you type This is updated one
Goto:
Tools -> Options -> Editor -> Code Completion
Select
Language: [C/C++]
Autopop Triggers for C/C++ Identifiers
.;->;.*;->*;::;new ; a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;y;z;A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z;aa;ab;ac;ad;ae;af;ag;ah;ai;aj;ak;al;am;an;ao;ap;aq;ar;as;at;au;av;aw;ax;ay;az;ba;bb;bc;bd;be;bf;bg;bh;bi;bj;bk;bl;bm;bn;bo;bp;bq;br;bs;bt;bu;bv;bw;bx;by;bz;ca;cb;cc;cd;ce;cf;cg;ch;ci;cj;ck;cl;cm;cn;co;cp;cq;cr;cs;ct;cu;cv;cw;cx;cy;cz;da;db;dc;dd;de;df;dg;dh;di;dj;dk;dl;dm;dn;do;dp;dq;dr;ds;dt;du;dv;dw;dx;dy;dz;ea;eb;ec;ed;ee;ef;eg;eh;ei;ej;ek;el;em;en;eo;ep;eq;er;es;et;eu;ev;ew;ex;ey;ez;fa;fb;fc;fd;fe;ff;fg;fh;fi;fj;fk;fl;fm;fn;fo;fp;fq;fr;fs;ft;fu;fv;fw;fx;fy;fz;ga;gb;gc;gd;ge;gf;gg;gh;gi;gj;gk;gl;gm;gn;go;gp;gq;gr;gs;gt;gu;gv;gw;gx;gy;gz;ha;hb;hc;hd;he;hf;hg;hh;hi;hj;hk;hl;hm;hn;ho;hp;hq;hr;hs;ht;hu;hv;hw;hx;hy;hz;ia;ib;ic;id;ie;if;ig;ih;ii;ij;ik;il;im;in;io;ip;iq;ir;is;it;iu;iv;iw;ix;iy;iz;ja;jb;jc;jd;je;jf;jg;jh;ji;jj;jk;jl;jm;jn;jo;jp;jq;jr;js;jt;ju;jv;jw;jx;jy;jz;ka;kb;kc;kd;ke;kf;kg;kh;ki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;adw;adx;ady;adz;aea;aeb;aec;aed;aee;aef;aeg;aeh;aei;aej;aek;ael;aem;aen;aeo;aep;aeq;aer;aes;aet;aeu;aev;aew;aex;aey;aez;afa;afb;afc;afd;afe;aff;afg;afh;afi;afj;afk;afl;afm;afn;afo;afp;afq;afr;afs;aft;afu;afv;afw;afx;afy;afz;aga;agb;agc;agd;age;agf;agg;agh;agi;agj;agk;agl;agm;agn;ago;agp;agq;agr;ags;agt;agu;agv;agw;agx;agy;agz;aha;ahb;ahc;ahd;ahe;ahf;ahg;ahh;ahi;ahj;ahk;ahl;ahm;ahn;aho;ahp;ahq;ahr;ahs;aht;ahu;ahv;ahw;ahx;ahy;ahz;aia;aib;aic;aid;aie;aif;aig;aih;aii;aij;aik;ail;aim;ain;aio;aip;aiq;air;ais;ait;aiu;aiv;aiw;aix;aiy;aiz;aja;ajb;ajc;ajd;aje;ajf;ajg;ajh;aji;ajj;ajk;ajl;ajm;ajn;ajo;ajp;ajq;ajr;ajs;ajt;aju;ajv;ajw;ajx;ajy;ajz;aka;akb;akc;akd;ake;akf;akg;akh;aki;akj;akk;akl;akm;akn;ako;akp;akq;akr;aks;akt;aku;akv;akw;akx;aky;akz;ala;alb;alc;ald;ale;alf;alg;alh;ali;alj;alk;all;alm;aln;alo;alp;alq;alr;als;alt;alu;alv;alw;alx;aly;alz;ama;amb;amc;amd;ame;amf;amg;amh;ami;amj;amk;aml;amm;amn;amo;amp;amq;amr;ams;amt;amu;amv;amw;amx;amy;amz;ana;anb;anc;and;ane;anf;ang;anh;ani;anj;ank;anl;anm;ann;ano;anp;anq;anr;ans;ant;anu;anv;anw;anx;any;anz;aoa;aob;aoc;aod;aoe;aof;aog;aoh;aoi;aoj;aok;aol;aom;aon;aoo;aop;aoq;aor;aos;aot;aou;aov;aow;aox;aoy;aoz;apa;apb;apc;apd;ape;apf;apg;aph;api;apj;apk;apl;apm;apn;apo;app;apq;apr;aps;apt;apu;apv;apw;apx;apy;apz;aqa;aqb;aqc;aqd;aqe;aqf;aqg;aqh;aqi;aqj;aqk;aql;aqm;aqn;aqo;aqp;aqq;aqr;aqs;aqt;aqu;aqv;aqw;aqx;aqy;aqz;ara;arb;arc;ard;are;arf;arg;arh;ari;arj;ark;arl;arm;arn;aro;arp;arq;arr;ars;art;aru;arv;arw;arx;ary;arz;asa;asb;asc;asd;ase;asf;asg;ash;asi;asj;ask;asl;asm;asn;aso;asp;asq;asr;ass;ast;asu;asv;asw;asx;asy;asz;ata;atb;atc;atd;ate;atf;atg;ath;ati;atj;atk;atl;atm;atn;ato;atp;atq;atr;ats;att;atu;atv;atw;atx;aty;atz;aua;aub;auc;aud;aue;auf;aug;auh;aui;auj;auk;aul;aum;aun;auo;aup;auq;aur;aus;aut;auu;auv;auw;aux;auy;auz;ava;avb;avc;avd;ave;avf;avg;avh;avi;avj;avk;avl;avm;avn;avo;avp;avq;avr;avs;avt;avu;avv;avw;avx;avy;avz;awa;awb;awc;awd;awe;awf;awg;awh;awi;awj;awk;awl;awm;awn;awo;awp;awq;awr;aws;awt;awu;awv;aww;awx;awy;awz;axa;axb;axc;axd;axe;axf;axg;axh;axi;axj;axk;axl;axm;axn;axo;axp;axq;axr;axs;axt;axu;axv;axw;axx;axy;axz;aya;ayb;ayc;ayd;aye;ayf;ayg;ayh;ayi;ayj;ayk;ayl;aym;ayn;ayo;ayp;ayq;ayr;ays;ayt;ayu;ayv;ayw;ayx;ayy;ayz;aza;azb;azc;azd;aze;azf;azg;azh;azi;azj;azk;azl;azm;azn;azo;azp;azq;azr;azs;azt;azu;azv;azw;azx;azy;azz;
Good Luck!