Disable IDE auto format command - eclipse

I have a code base that many developers work on. Some people blindly use auto format in their IDE and mess up the formatting of sql statements or other things. It appears that some IDE's like eclipse do have the ability to use //#Formatter:off (which I have put around many things I do want to not get formatted), but by default these are ignored. Thus, is there a way to either enable the setting so that will be used by default, or is there a way to disable any shortcut key linked to auto format using some sort of maven plugin? Basically I am looking for a way to enforce this for anyone who is working on the codebase since everyone can change their own formatter settings.
I found https://code.revelc.net/formatter-maven-plugin/format-mojo.html, but I dont think it can do either of those things.
Thanks in advance!

Related

VSCode inserts space after comment sequence

Whenever VSCode formats code, for almost all languages, it will insert spaces after the comment escape sequence (//, #, et cetera).
Although this does not work for C code, I assume that this might be some kind of global setting.
Is it possible to disable the insertion of this extra space somewhere? I follow a style where I don't use the extra spaces after "code-only" comments.
Any (lightweight) extensions that do this (or similar)? Should I make my own...?
I'd like for this solution to work for all languages, although Java is what I use the most.
I tried searching for some extensions related to comments, but it seems that there are none doing this. Is a linter what I need..?
Sorry and thank you in advance!
VS Code doesn't have a default formatter that works across every language so, there is no global solution for you. You will have to check, for every language you noticed such behavior, if the formatter is built in or not, and look for settings individually.
You commented about using Java, and VS Code Java support doesn't provides a formatter, so I suppose you have some Java extension installed, maybe from RedHat. If that's the case, I've noticed (based on extension's Readme) that It has a Java: Open Java Formatter Settings command, which says opens the Eclipse formatter settings. Creates a new settings file if none exists. It's been a long time I don't use Eclipse, so I'm not sure how its settings works, and if it does support the format rule you want. But I suggest you to take a look.
Hope this helps
There is a setting that should affect all languages:
Editor > Comments: Insert Space
It is enabled by default, uncheck it.
It seems that setting java.format.comments.enabled to false was somewhat helpful:
java.format.comments.enabled setting in VSCode
However, it disables formatting for all comments, even JavaDoc ones.

VSC command palette (too narrow)

Is there any possibility to make command palette wider?
When looking for symbol (e.g. same functions with different set of arguments) to less characters are shown to choose proper definition.
Is there any possibility to mitigate this problem?
Using standard VS Code settings looks like you can't do this, which I agree should be possible. The strange thing is that I can't find an extension too that does this, so there may be a specific reason why this can't be done at the moment. By the way you can open an Issue on the VSCode Github and ask the developers themself to add this feature or why seems to be missing at the moment

WebStorm formatting settings - port to another editor

Is there any way to get another editor, like VSCode, to format code ( JavaScript in my case, if it matters ) like the WebStorm IDE formats code by default? I'm not familiar with that IDE, but I'm hoping that it uses a config of some sort that can maybe be exported and imported in another editor. I tried looking for one, but couldn't find anything.
The core problem, if it matters, is that all of our team members use WS to write code and they use the built in formatter, so if I use another one it creates inconsistencies and long commits when editing already written files. As you are probably guessing by now, I would like to use another editor, because I find IDE's bloated and slow.
I don't know if there is a way to import Webstorm formatting rules into VS Code, but I think there is another solution:
I remember in one of the projects i worked on, we used a linter which also auto-formatted code. The advantage is that Webstorm and VSCode can pick pick the linter rules automatically, and then you have same formatting on both.
The downside is that you would need to agree with the team on what does rule will be and then configure them on the linter.

how to switch/control syntax highlighting in eclipse flexibly?

I have a file with extension .xml.
But it doesn't necessarily contain XML. It may also contain HTML and JavaScript. Now I would like to either have Eclipse decide inteligently/heuristically which syntax highlighting would be appropriate or to switch it myself.
Any ideas?
Eclipse associates files with an editor. You can let eclipse decide which editor to use (e.g. defaults per file extension) or select the editor by yourself. I guess you might already know that or have at least experienced it.
Syntax highlighting isn't always set seperately but instead part of some editor (together with stuff like keyboard shortcuts). So what you are going to need is an editor that behaves the way you want it to. I do not know if there is an editor like this available but one options is writing an eclipse plug-in and implementing such an editor.
Fortunately there are great editors for each of XML, javascript, HTML, etc that are all open source. I guess you might be able to use some of their code. Ideally as a client of their API / Objects or if it won't work out just by reusing code.
short answer: not possible. use PHPStorm instead :)

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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;Xi;Xj;Xk;Xl;Xm;Xn;Xo;Xp;Xq;Xr;Xs;Xt;Xu;Xv;Xw;Xx;Xy;Xz;Ya;Yb;Yc;Yd;Ye;Yf;Yg;Yh;Yi;Yj;Yk;Yl;Ym;Yn;Yo;Yp;Yq;Yr;Ys;Yt;Yu;Yv;Yw;Yx;Yy;Yz;Za;Zb;Zc;Zd;Ze;Zf;Zg;Zh;Zi;Zj;Zk;Zl;Zm;Zn;Zo;Zp;Zq;Zr;Zs;Zt;Zu;Zv;Zw;Zx;Zy;Zz;aaa;aab;aac;aad;aae;aaf;aag;aah;aai;aaj;aak;aal;aam;aan;aao;aap;aaq;aar;aas;aat;aau;aav;aaw;aax;aay;aaz;aba;abb;abc;abd;abe;abf;abg;abh;abi;abj;abk;abl;abm;abn;abo;abp;abq;abr;abs;abt;abu;abv;abw;abx;aby;abz;aca;acb;acc;acd;ace;acf;acg;ach;aci;acj;ack;acl;acm;acn;aco;acp;acq;acr;acs;act;acu;acv;acw;acx;acy;acz;ada;adb;adc;add;ade;adf;adg;adh;adi;adj;adk;adl;adm;adn;ado;adp;adq;adr;ads;adt;adu;adv;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!