eclipse editor, how to work with text editor (theme) when working with a specific perspective? - eclipse

Is there a way to change the 'Appearance color' (or theme) in the editor when choosing to work with a specific view/perspective?
To be more specific, I'm starting to use python and I wish to have a different theme but when switching to Java I'd like to use the default editor.
Doable?

There is nothing to make the theme depend on the perspective, I believe.
The straightforward solution would be installing a Python plugin, which then has its own editor (and own syntax highlighting settings). You would have to do that for every file type, nonetheless.
Apart from that, your best choice is probably the Eclipse Colorer plugin, which can do syntax coloring based on the file type.
(Disclaimer: I've never used any of those myself).

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 there any text editor for Mac that can be configured to have, or already has, autocomplete for Lua?

I know TextWrangler shows the option, but it doesn't actually do anything. So what I want is autocomplete, either with a key combination, or while I type.
Syntax coloring/highlighting is a requirement as well, though I know Xcode and TextWrangler have that.
You might want to use Lua Development Tools for this purpose. It has syntax coloring, plus it is doing smart autocomplete, depending on what your actual context is (required modules, ...)
It is an Eclipse Technology project, and it is Open Source! (EPL license).
Project web page - http://www.eclipse.org/koneki/ldt
Installation via Eclipse Marketplace - http://marketplace.eclipse.org/content/lua-development-tools-koneki
I don't know if you have seen this page, but it seems a good place to start:
http://lua-users.org/wiki/LuaEditorSupport
If I search for "completion" I get:
Decoda (Win)
LuaEdit (Win)
DForD (Win)
NsEditor (Win)
Visual Studio + LuaLite
Eclipse + LuaEclipse or LunarEclipse (java)
I personally use Vim + SuperTab (which only auto-fills with things that you have previously written).
There's a nice plugin for IntelliJ IDEA for Lua. IntelliJ IDEA is really nice, though kind of biggish.
Aside of that there is also TextAdept which is a lot smaller, and 100% configurable in Lua.
And probably a bunch of others.
If you want full (semantic) autocompletion, you should try lua-inspect (source code), which can be installed in the SciTE editor, and also into ViM using vim-lua-inspect.
It uses Metalua to fully parse the source code into AST and then performs code analysis. Apart from simple keyword-based syntax highlighters, it can:
differentiate between local/global variables, parameters and unused variables
jump to the definition of a variable/function
autocomplete table members
correctly rename variables/functions (not only definitions but also uses)
Even though it is not yet stable, and tends to hang on large scripts, it is very usable for standard Lua programs, mainly for it's intelligent autocompletion and renaming.

Code style preferences using Sicstus and Eclipse (Spider)

I am currently using Sicstus Prolog VC9 4.1.1 within Eclipse Galileo (Spider). I have a very newbie question: how would I automatically control indentation and in general code style preferences?
Currently there is only one setting that affects coding style, the default indentation level.
Open the Preferences in Eclipse. Under SICStus Prolog you will find all SPIDER-related preferences. There you can also change some of the highlighting preferences.
More powerful source code formatting is planned.
(I am one of the SICStus Prolog developers and I am responsible for SPIDER.)
I dont know much about SPIDER but you can adjust Eclipse to be Emacs Compatible editor. Emacs also can understand you are writing code in sicstus so your Eclipse can become a very friendly environment for you coding in sicstus as well as keeping the indentation
also try using Cmd+Shift+F in case you are Mac user

Is it possible in Eclipse to define syntax highlighting for a language without resorting to Java programming?

I am looking for a way to define some syntax coloring for a language in Eclipse. I only need to highlight certain sets of keywords, so the logic is trivial. So I would like to be able to define these in a plain definition file. Is there perhaps some Eclipse plugin which allows this, or is it possible out of the box?
XText is a more generic and complex solution, which will generate for you the code for a custom Editor able to offer the usual IDE features, that are derived from a grammar (your "plain definition file"), including.
syntax coloring, but also
model navigation (F3, etc.),
code completion,
outline view, and
code templates.
The EclipseColorer plugin may fit the bill!
It's a bit fiddly, but try http://gstaff.org/colorEditor/.
It uses the jEdit syntax highlighting files. So you need to create your highlighting file and add it to the jar in the plugin, as well as editing the catalog file in there to include it.
I used jEdit itself to test and debug my custom highlighting, rather than having to exit Eclipse, make the change and reload it each time.