Notify Coding standards violation on Eclipse Editor while developers are writing code - eclipse

Is there a plugin on eclipse which helps to check the code written in Eclipse Editor against some coding best practices ?
The features which i am looking for exactly are :
The violations of coding standards should appear as warning on the Eclipse Editor itself against the line which violates it. (Same way warnings are shown using the yellow triangular symbol)
The coding standard itself should be easily editable ( I may be able to include or exclude some rules ). I want it to be tailored according to my organization's coding standards.
Should check against standards in .java , .jsp and .js files.
There are tools which can help in achieving that but they need to be run explicitly and can be run only when code is written completely.
I want the developers to be notified the instant they are going against coding standards.

You can do it without a plugin. Eclipse can generate warnings based on style problems:-
Java -> Compiler -> Errors/Warnings
You can even get it to auto-format when files are saved:-
Window -> Preferences -> Java -> Editor -> Save Actions -> Format Source Code
WARNING: Enforcing this will annoy developers.
Also see Eclipse custom code style parameters

Related

Eclipse Generic Text Editor Sort OUtline

I thought this would be very simple to achieve but I cannot sort the outline in alphabetical order in the generic text editor that is now the default editor for javascript files in Eclipse 2020-12. In fact I have no sorting options whatsoever in the outline.
This is all I have in any perspective using the generic text editor.
This really affects my productivity having to sroll through many functions in a javascript file to find the correct one. I have hundreds of javascript files with hundreds of functions each.
I am using Wild Web Developer tools as this is the way Eclipse is heading (and because each update automaticaly installs it). Also I have node.js installed even though I don't require node.js for anything other than the generic text editor.
I'd prefer to not have the overhead of uninstalling Wild Web Devleoper and installing JDT each time Eclipse updates. Ideally, I should be able to simply update when prompted and all works as previously.
This is the Eclipse version I am using
Version: 2020-12 (4.18.0)
Build id: 20201210-1552
Does anybody have any idea how I can simply sort my functions and variables alphabetically in the generic text editor please? (I can sort the outline in java files

How to setup a new language IDE

At work we are using a proprietary language and to program we are using Notepad++ with a simple code highlight. That is really annoying so, what I want to do is to invest some time to setup a text editor or an existing IDE to support my language.
I've googled a lot and there are so many options and before starting to work I wanna ask to you what is the best choice.
What I want to do is to have, like an IDE, a syntax highlight, a window with the function list tree, with the local function variables inside the same subtree, maybe text autocomplete (if I type "pro" I would like to see the suggestion "procedure" and if I press enter it will write for me something like
procedure "name" {
--code--
}
with the cursor on "name" ready to change it.
etc etc...
Can you suggest me the right path to follow?
Is it to keep using Notepad++? With sourcecookifier? functionlist?
Or I have to change to another text editor?
Or there is some famous IDE like Eclipse, NetBeans etc that allow to easily add my own language?
PS. my language is pretty simple, I don't have complex structures, is Pascal-like. Something like that:
variable int xyz
PROCEDURE asd
BEGIN
END PROCEDURE asd
I would recommend you to stay with Notepad++ and extend it with some plugins and configuration. This would be fairly quick and easy to set up and still give a big win, even though you might not be able to get all the nice features of something like Eclipse. But since you already know the Notepad++ it wouldn't require learning an entirely new tool.
Some plugins that I have found useful
Function List
Light Explorer
XBrackets Lite
There are probably a lot more that can be useful to you.
Notepad++ also got some built in auto-completion functionality that can be enabled in the settings.
Have you evaluated Eclipse XTEXT ?
What is Xtext?
Xtext is a framework for development of programming languages and domain specific languages.
The only IDE I have used for the last few years is Eclipse. There are lots of other IDEs available, also notable and popular is Netbeans. There are many others. It's important to note that all IDEs have their fans, but I can only speak to Eclipse.
Eclipse is a platform, which means it is an application on which you can build other applications. Eclipse provides a framework which you can customize and extend to produce a working application. It takes care of the user interface, preferences storage, modularisation using OSGi, and lots of other things.
Eclipse has facilities to support what you're looking for:
Syntax highlighting in the editor.
The Outline View provides function and variable listing in a tree
Autocompletion and Suggestions (activated by hitting ctrl-space)
Code Templates to fill out files and procedures etc.
The disadvantage is that customising and extending Eclipse to do what you want isn't trivial. Having written a language debugger for Eclipse, I can tell you that leveraging Eclipse's platform helped enormously, but there's a learning curve. You'd essentially have to be coming up with a new set of plugins to provide your highlighting, outlining, autocomplete suggestions and templates (I'm not sure if template support is built into the platform or not).
So I would say, unless you can find some sort of extensible editor for Eclipse - I know Aptana is extensible for tag-based markup - you are probably as well staying with your existing tooling.
Do explore the other IDEs though - I've heard good things about IDEA as well as Netbeans. :)
Good luck!
I can recommend SynWrite editor. Good support for external languages, fully customizable. (Editor of new lexers is there)

Is it feasible to extract the code assist/completion part from Eclipse and use it in an other editor?

I often hear how good the code completion, coding assist features of Eclipse are compared to other editors which raises the question if these parts could be separated from the Eclipse code base.
If this part is separated with an API through which it can be told things it needs to know (where are the files of the project, what are the include paths, etc.) then it can return the necessary information (help for a symbol at the cursor, possible completions, etc.) and any editor (emacs, vim, etc.) can use it.
Why is it not done already? Are these code assist parts tied too tightly to Eclipse internals and they can't be sepaarated easily? Could someone who knows about the internal workings of Eclipe shed some light on this?
Edit: Here's a working setup with SharpDevelop for C#, emacs is the UI and the info comes from the SharpDevelop module. See the screenshot on this page. Eclipse's completion support could support emacs and other editors similarly.
The eclim project tries to solve this problem by interfacing directly with eclipse. Thus at least an headless running eclipse is required. While eclim's focus is afaik the vim integration, there also exist plugins for other editors (emacs, textmate, etc). The communication between eclim and an editor happens through a server interface.
Maybe not exactly what you where looking after, but imho worth a look:
http://www.eclim.org/
The content assist uses an internal model of the Java projects - without this model the content assist cannot work (that effectively).
I am not sure, how tightly is integrated to Eclipse internals, but I do know that it uses the Eclipse Resources API (file system handling) and other features such as Eclipse extensions (new completion providers can be added without modifying the code).
Alltogether, I believe to port this completion engine to other editors the mentioned editors would lose their (in some case relative) simplicity to Eclipse, thus it might not provide the smaller footprint of the mentioned editors - so I don't think, it is feasible to provide such engines effectively for other editors.

Checkstyle for ColdFusion?

Is there some kind of Checkstyle plug-in for Eclipse available for ColdFusion.
There aren't really any coding specifications for ColdFusion. Sean Corfield wrote one for Macromedia's internal development departments that some folks use, but there really isn't a set of coding conventions and rules that the community adheres to. Thus, there is no plugin to test that your code follows those rules.
That said, if you have standards that you prefer/enforce in your company or team, then you can use the code formatter in ColdFusion Builder 2 (still in public beta, at this time) to quickly check/update source files.
You set the formatting guidelines in the Eclipse preferences, and then you can run the formatter from the menu: Edit > Format (Keyboard shortcut: cmd/control + shift + F)
I search around a bit for cf specific Checkstyle tool, no luck. I think since CF is a tagging language as much as a scripting language, it lags behind in tools like this. You could check out the coldfusion specific eclipse plugin, it may have some of its own type checkstyle functionality.
http://cfeclipse.org/
Hoping this is still relevant to someone...
Long time ago, I've tried an approach using checkstyle regexp tags.
I wrote a blog post, check if there is any useful hint:
http://rcastagno.blogspot.it/2009/09/checkstyle-50-regexps-and-eclipse.html
There is a static code checker, written in ColdFusion, FOR ColdFusion. see https://github.com/wellercs/CodeChecker. There is also a linter that can plug in to Eclipse or ColdFusion Builder, called CFLint. See https://github.com/cflint/CFLint for that tool.
So CodeChecker is a stand-alone application and CFLint may be used, as I remember, stand-alone or as a plug-in to a number of IDEs.
You can easily add rules and guides to CodeChecker, I haven't tried with CFLint.

Eclipse plugins for working with Apache Wicket projects

Are there any widely adopted, currently maintained Eclipse plugins for working with Apache Wicket projects? If so, where are they? Who maintains them? What do they do?
Take a look at Qwickie (eclipse plugin): https://github.com/count-negative/qwickie
The standard used to be wicket bench, but it has been discontinued and you can find a fork named stump.
I don't know stump, but wicket bench mainly had a refactoring listener (if you rename a java class, the HTML is also renamed) and some wizards (create a Panel with associated markup etc).
I haven't used bench in years, as it was rather buggy in newer eclipse versions. But I have made pretty good experiences using a custom set of eclipse HTML templates that you can download from this location: http://www.wicket-praxis.de/blog/wp-content/uploads/2010/01/wicket-template.xml
(German) description on this page: http://www.wicket-praxis.de/blog/download/
You can install these as HTML Code Templates in Eclipse:
Window -> Preferences -> Web -> HTML Files -> Editor -> Templates -> Import...
and that will enable wicket-specific template shortcuts in the HTML editor.
It's too bad you don't use IntelliJ IDEA. It has an excellent plugin called WicketForge.
Not right on the question, but not completely off it, either.
I have released a tool that can be used as an eclipse save action. It generates Java interfaces with constants for ids in wicket templates and resource keys from translation files, so that you don't need to use strings for component ids and translation keys, but can use these generated constants.
It can be integrated in eclipse quite simply as an annotation processor. After a save of a component the interfaces will be generated and built. See its readme:
https://github.com/neurolabs/wicket-id-bindings-generator
I'm maintaining it on github (feel free to fork/contribute) and am using it in all of my wicket projects.