VS Code formatting plugins - visual-studio-code

Is there a way in VS Code to format code according to the style that a person prefers? I guess there might be a plugin for this sort of thing but I've not found that.
For example, I prefer 'K&R' coding style while a colleague prefers 'Whitesmiths' style. When we share code or functions it would be nice to autoformat code into the style that each prefers.
This does not seem like it should be so difficult for a plugin to do except that coding style also has to parse the language of the code, so Whitesmiths PowerShell is going to be different from Whitesmiths on Perl I would imagine.
Are there any plugins like this (or internal functionality in VS Code - it's a very comprehensive tool without installing any plugins of course!) that people use regularly like this?

In contrast to its name, "JIndent" (commercial) is a tool I've been using for the exact purpose you're asking about.

Related

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)

Any windows based IDE to view objective-c code?

I want to be able to browse through the source code of an iPhone application in windows. I do not want to compile and run the code, just need to have some kind of tool that understands the Objective-C code and iPhone application source structure. Something that view the source code as a whole (project-based) and ideally can link different classes and methods. Something more than just a plain editor with code styling and something less than a full feature IDE. Do you suggest any tools?
Most editors will support Objective-C syntax highlighting. Personally I use VIM or NotePad++. I would recommend NotePad++ for ease of use. But as far as I know there is no 'IDE' for Objective-C for Windows.
I use jEdit if I need to see the source code in Windows. Pretty much handles all the structure and syntax highlighting of objective C.
EDIT: Its an editor. Not a IDE. But with your needs of just viewing code, I guess it must suffice.
If you want a bit more than just syntax highlighting, GNUStep has an IDE called PRoject Center. GNUStep can run on Windows, so allegedly Project Center will too.
Emacs has good syntax and indentation support for Objective-C, for example it can indent the method calls the way Xcode does (based on ':') and there's a Windows version of it available here.
Though it's not an IDE, most of the time I use it for Obj-C/GNUstep without much problems.
If you use something like ctags to tag your source code you could use any editor with support for ctags.
It looks like ctags does not support Objective-C directly, but it is fairly easy to add a new language configuration to ctags.

Writing custom IDE on top of Eclipse

I wish to write my own Python IDE (just for the heck of it). I was wondering if I could use Eclipse as a foundation. This will save me from coding a whole lotta things (code editor, intellisense and so on).
To understand what I mean, please take a look at Visual Studio Isolated Shell. I'm essentially looking for something equivalent. Searching on Google hasn't helped. Is there anything like this available in Eclipse's case?
Yes. Eclipse is designed to have additional languages added and there is extensive support for this kind of plugin development. I'm surprised Googling didn't help - there's an entire site dedicated to a tutorial on the basics and a toolkit for developing such things

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.

OpenOffice syntax highlighting

I have some big documentation to do that will contain pieces of code I'd like to give the conventional "coding language" syntax highlighting. I've searched the styles feature to do such a thing, but there is no way to do that (in fact I could only found a forum where people were fighting about adding this feature or not, but this is not the point).
There is an abandoned extension for OpenOffice, but using it freezes my installation of OpenOffice.
What's the easiest way to do this? Should I try to recompile the extension and debug it (although I'm already having a hard time compiling another Java project), or maybe I should use a macro? How to implement this?
One possibility is to use one of the many code to html tools out there and then include the html in your OpenOffice document (using "File..." on the Insert menu).
One possibility is highlight. Vim has a :TOhtml command that will convert the current file to syntax highlighted html using the current colour scheme. I've not tried it, but this looks promising. There are also a few online ones, such as this. I'm sure there are a great many other options.