Is there any text editor for Mac that can be configured to have, or already has, autocomplete for Lua? - autocomplete

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.

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)

IDE support for Scala scripting

I plan to try some exploratory programming with Scala, e.g. loading some scala source files and call the functions defined in these source files interactively, maybe doing some plotting in the between.
I want to keep a scripting source file, and occasionally send some lines in it to the scala console using a short-cut such as Ctrl+Enter.
Which IDE supports scripting well?
The Scala plugin for Eclipse offers two different interpreters. One is the standard REPL, simply integrated within the IDE, the other one is the Run Selection Interpreter which may be very handy for the kind of experimentation you'd like to do, give it a try.
The Scala plugin for eclipse is the best out there .
http://www.scala-ide.org/
With the Run Selection Interpreter you can achieve what you want :
An expression can be executed in the interpreter by selecting text in
any Scala editor and either selecting the toolbar button (see
screenshot) or by using the Ctrl+Shift+X key combination (Cmd+Shift+X
on the Mac). The key combination can be changed by going to Keys ->
Preferences and changing the binding for the command "Send Selection
to Scala Interpreter"
In latest version of scala plugin for IntellJ Idea 11 (Nika EAP) scala console works much better. Read more in plugin blog http://blog.jetbrains.com/scala/2011/10/19/scala-language-console-nika-builds/
you can try Slate while I am still heavily developing. Although, for basic scripting, you can probably do command line as well. Almost all IDEs support integration with the interpreter btw.
It is obligatory to mention emacs here. Can emacs do _? Yes, emacs can do that!
In all seriousness, though, you might want to google around for "scala mode emacs" and see what you can find.

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.

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.

Eclipse Style Function Completions in Emacs for C, C++ and JAVA?

How Do I Get Eclipse Style Function Completions in Emacs for C, C++ and JAVA?
I love the power of the Emacs text editor but the lack of an "intellisense" feature
leaves me using Eclipse.
M-/ is a quick and dirty autocomplete based on the contents of your current buffer. It won't give you everything you get in Eclipse but is surprisingly powerful.
I can only answer your question as one who has not used Eclipse much. But! What if there was a really nice fast heuristic analysis of everything you typed or looked at in your emacs buffers, and you got smart completion over all that everywhere, not just in code?
M-x load-library completion
M-x global-set-key C-RET complete RET
When I was doing java development I used to use the:
Java Development Environment for Emacs (JDEE)
The JDEE will provide method name completion when you explicitly invoke a jdee provided function. It has a keyboard binding for this functionality in the jdee-mode.
The CEDET package provides completion for C/C++ & Java (and for some other languages). To initial customization you can take my config that i use to work with C++ projects
Right now, I'm using Auto Complete for Emacs. As a current Visual Studio and ex-Eclipse user, I can say that it rivals both applications quite well. It's still not as good as Microsoft's IntelliSense for C#, but some would say that C++ is notoriously difficult to parse.
It leverages the power of (I believe) the Semantic package from Cedet, and I find it feels nicer to use when compared to Smart Complete. It completes C++ members, local variables, etc. It's pretty good. However, it falls down on not being able to complete overloaded methods (it only shows the function once with no parameters, but thats a limitation of Cedet I believe), and other various things. It may improve in future though!
By the way, I could be wrong here, but I think you need an EDE project set up for the class member completion to work (just like you would normally with Semantic). I've only ever used it while having an EDE project, so I assume this is true.
Searching the web I find http://www.emacswiki.org/cgi-bin/wiki/EmacsTags#toc7 describing complete-tab in etags. It is bound to M-Tab by default. This binding may be a problem for you
Also, etags has some limits, which may annoy you...
The link also points to CEDET as having better symbol completion support.
Have you tried the emacs plugin for eclipse?
http://people.csail.mit.edu/adonovan/hacks/eclipse-emacs.html
I've written a C++-specific package on top of CEDET that might provide
what you want. It provides an Eclipse-like function arguments hint.
Overloaded functions are supported both for function arguments hint
and for completion.
Package is located here:
https://github.com/abo-abo/function-args
Make sure to check out the nice screenshot:
https://raw.github.com/abo-abo/function-args/master/doc/screenshot-1.png
auto-complete-clang is what you want. Can't go wrong with using an actual C++ compiler for completions.
The only problem it has is there's no way to know what -I and -D flags to pass to the compiler. There are packages for emacs that let you declare projects and then you can use that.
Personally, I use CMake for all C and C++ work so I wrote some CMake code to pass that information to emacs through directory-local variables. It works, but I'm thinking of writing a package that calls cmake from emacs so there's less intrusion.