Checkstyle for ColdFusion? - eclipse

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.

Related

In the Eclipse HTML editor, is there an easy way to have custom tags available in content assist (autocomplete)?

I'm learning to use a new hosted e-commerce system at work which uses a proprietary markup/scripting language for its page templates. They are similar to JSP pages (although the server tags don't have a prefix, i.e. there is no "xsp:") and use ${expressions} similar to Expression Language. We are transitioning from a .Net system, so all of my fellow devs are very used to having thorough IntelliSense available in our editors.
So, my question is whether it is possible to make these custom tags available in content assist, and whether it is worth the hassle if there is any. (I'm aware the latter is subjective - I'm a reasonable guy and open to opinions.)
FYI, I'm more concerned with auto-completion of tags, but expressions would be great as well depending on how much work is involved. We are using eclipse for Java EE, Juno (core IDE v4.2.1) with WTP... Sorry I'm not really sure how or what to share as far as versions and components go! Let me know if any additional info would help.
Thanks in advance.
A decidedly non-hassle-free answer would be to create an Eclipse plug-in to support your proprietary template language. One place to start might be Veloeclipse, a HTML/XML/JSP/Velocity Editor for Eclipse, which claims to have the following features which you may find interesting:
Smart indentation of velocity directives (on pressing return or when using tabs)
Code folding
Code Formatting
Smart indentation of html tags (on pressing return or when using tabs)
Syntax highlighting for both html and velocity
Autocompletion and Content assist for tags, directives and references (Ctrl + space in html attribute values or when opening or closing tags)
Sources here: http://code.google.com/p/veloeclipse/source/checkout

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)

Netbeans - How to extend HTML vocabulary

I've been using netbeans for a couple of years now, mainly on PHP / CakePHP projects.
Recently I've started using Coldfusion, which isn't directly supported. I've found, however, that if I use PHP as a project type, I can load the files and the HTML Renderer does an admirable job with the Coldfusion tags.
I want to make it better and help the renderer to understand some of the tags and, hopefully, thereby improve code indentation and syntax highlighting.
My question, then, is how can I access the HTML dictionary to extend the vocabulary?
NB: This isn't a 'which IDE' question so don't recommend them. I want to know if and how I can achieve this in NetBeans and only Netbeans.
Here are a few ideas. If you render it in HTML, you could probably add a custom name space to the HTML. If setup correctly it can help NetBeans realize that the tags are valid and shouldn't show as an error. It might not give you all the preview and WYSIWYG functionality, but it may be better than what you are getting now. I have only done this on other platforms, but I'm pretty sure NetBeans supports it.
Also I think that NetBeans will let you add CustomTags doing something like this:
http://wiki.netbeans.org/CustomTagActions
Just to note, in terms of ColdFusion the other alternatives are NotePad++ with the CF plugin and IntelliJ now supports CF.
I really like Eclipse - the number of plugins available (SVN, Javascript, CSS, CodCollab, Flashbuilder etc.) is what makes it indispensable IMHO.
I am, however, looking forward to the new version of CFBuilder.
This answer on the same/similar question suggests that there is nothing out there for ColdFusion on netbeans : NetBeans as an editor for ColdFusion scripts?
If you want to build your own ColdFusion plugin for netbeans you need to look at plugin development; http://platform.netbeans.org/tutorials/60/nbm-google.html You could use the Dictionary project from cfeclipse as a basis for your plugin. See this Google Group thread for a bit more information

Using (Java) Eclipse abilities in other programming language

I use Eclipse mainly for LSL (linden Scripting language). The plug-in for this language does not provide things like templates or task-tag recognition. Is there any way that these kind of features in LSL-files (or any other generic file/code for that matter) can be used?
Take look at the XText project. If you can define the grammar of LSL there it will generate full Eclipse plugin for it, complete with syntax Highlighting, code Completion, validation and quick Fixes and more.
Another one to try (one i use myself) is LSL Editor
Full Syntax highlighting, code suggest, and even a off world run time environment. plus able to test multiple scripts by building test objects with prims.
Take a Look :)
LSLForge is being actively maintained, and has most of what you describe. If there's something missing, the developer is always looking for new challenges.

using eclipse for other languages than java?

I came to know that eclipse can be used for other languages as well. But will it give the same comfort level as using java? Is there anybody who has used eclipse for other languages?
I've used Eclipse for both C/C++, Ruby, Erlang, and a few others. None of these are as tightly integrated with Eclipse as Java is, but CDT (C/C++) gives Visual Studio a good run for its money. I usually use Emacs for the other ones.
Yes, you can use Eclipse for many languages other than Java. I personally use Eclipse to code in C++, Perl, PHP, and do JavaScript as well inside of it. While it also supports plugins for connecting and executing queries against databases, I tend to prefer other options there such as Toad or Oracle SQL Developer. There are numerous other plugins to support many other languages that you can find either through the Update Manager or a simple Google search, many of which are excellent.
As a side note, if you're not using Mylyn, you're missing out.
Eclipse is used as a base for other language and tool:
for example As3 with FlashBuilder; PHP, Javascript with Aptana studio, C,Python,... with other plugins, etc...
You can found here for example some plugins for other languages.
I've used it for Javascript (jQuery): compile-time checks are a godsend to the barren lands of javascript.
For Java developement I feel most comfortable using Eclipse.
I tried using Eclipse for coding with Python. There is PyDev, an Eclipse plugin that can be used to work with the Python code in Eclipse. Though PyDev provides features like Code Completion, Syntax highlighting etc, I felt comfortable to use editors like gvim or emacs rather than Eclipse
for working with Python code. YMMV
Yes, Eclipse supports many other languages.
But you knew that already when you saw http://www.eclipse.org/downloads/
So, I guess that you are asking how well it supports them...
It is possible to have Eclipse without Java. Imagine taking that and then adding Java support. Compare that with CDT for C++ and - in my experience - they are pretty much the same.
Yes, Eclipse is slanted at Java, and I doubt that anyone will deny that, but at the same time it tries to be fair and generic and pretty much achieves it. Any few % less other language support doesn't matter when you realize that no other IDE compares.
Bottom line, whatever your language, you will be hard pushed to beat Eclipse.
And that's before I get started on the myriad plugins ...
Not only programming, debugging with Eclipse is sweet. Beside Java, the other languages I mostly work on Eclipse are PHP and Python.
While I was working on the Eclipse Web Tools Platform (WTP) project we often said that the Java Development Tools (JDT) were the model that we referenced for features for Web related languages. I think JDT has set the bar and many other projects that implement language specific tooling try to reach the JDT bar. I don't know that any have or that copying everything about JDT is the point but I do think the Java tools are exemplary development tools.