A Simple automatic completion Editor - editor

I have a genric BNF grammar and I would like to implement an editor, starting from that grammar and through an automatic completion feature, that can suggest phrases and signle strings belonging to a language derived from that grammar.
What can be the best approach to implement this editor?
Thank you for your attention.

I suggest KDE's "kate" editor:
mature and flexible editor
Qt based, so cross platform
excellent highlighting engine
working autocompletion engine
usable standalone or embedded
Using such an existing editor just leaves the task to implement a syntax description and load it into the editor. This approach is much less error prone as starting from scratch trying to implement editor number 29583659.

Related

Autocomplete punctuation using grammar

I'm working on a tool that is able to autocomplete the necessary literals defined in a grammar. For example: in C# if a programmer enters: for with a space after it, then it's entirely possible to parse the code, determine that the programmer has started a for statement and autocomplete the necessary punctuation: ( ; ; ).
The more I think about the problem, the more I think there must already be a solution for it, because it's such a common use case, but I can't find anything.
Is there a tool that can do this using a given grammar?
If you don't mind using ANTLR v3 instead of v4 you can use Xtext in order to generate an editor that features auto-complete and error-highlighting. This will happen in form of a plugin for eclipse and apparently also for IntelliJ IDEA.
If you want to use a different IDE or simply want to make use of ANTLR v4's powerfull features you could still have a look at the Xtext Sources as they have to do what you are searching for in order to provide the above mentioned features properly...
This package looks very promising at first glance... You might find the respective code in there.
Be aware though that Xtext is mainly written with Xtend so you either have to do so as well or you have to rewrite it a bit

How to get type info from Go compiled packages in language x?

I want to write a simple editor with basic autocomplete functionality for the Go language as a pet project. How would one go about doing it? I took a look at the Go plugins for Eclipse and IntelliJ, but they were too big for me to comprehend (not to mention getting one to compile).
The Go standard library offers the building blocks for a Go parser which
you can use to parse the source files and look for function definitions and the like.
There's also the godoc command which
already does what you want: extracting method definitions and it's documentation. You may look in the
source code to see how godoc is
working or use godoc directly.
This editor written in Go projects has a manageable amount of code,
you may look into it.
The de facto standard approach to this problem is to use nsf's gocode. I have tried it only in Vim - it works very well.
Even though there's ready made support for specific editors, gocode is not editor specific. It's a daemon with a communication protocol. It is thus usable from any program.

is there any tool to auto tidy up F# code

Visual Studio doesn't offer automatic formatting for F#, is there any other editor I can use to automate that?
I would like it would put reasonable white spaces in between arithmetic operators (a+b) goes to (a + b) or assignment operators =
I have been developing a source code formatter for F#. The source can be found on Github.
At the moment, a VS extension has been released in Visual Studio gallery. Integration to other IDEs and editors should be possible while the API and command line are already available.
The VS extension can handle the situations you described quite well via formatting selection feature.
Generic code indentation is supported in FSharpMode in Emacs:
Link to download site
But it wont help you to do automatic white-space separation of operators, only indentation.
Maybe write a simple formatter based on Tomas Petriceks code for syntax highlighting?
Link to FSharp.Formatting

Cucumber IDE for feature writing with autocomplete?

Is there any Eclipse plugin for writing features for cucumber with autocomplete functionality?
I guess that would be good to find and reuse steps from other features. Any ideas?
The cucumber-eclipse plugin illustrates one possible approach.
As Xtext seems not to be the perfect solution for this special case, it is more like a case study then a working plugin.
Based on XText, it uses the cucumber grammar (as in Gherkin), it uses XText features to produce a full-fledge editor.

Online programming editor

For a school project i need to write or use a online programming editor. It is a part of a bigger project. I thought of a java application, php/html/javascript or flash.
I have a couple of things i could do:
Find a good working application and edit it so it works with the rest of the project
Find good parts for a editor and make it working my self (syntax highlighter, auto-indent, autocompletion, etc.)
Combination of those two
Does anybody know a good editor or have tips for this project or a editor?
Thanks for reading,
Leon
For the syntax highlighting and basic editing part, check out my recent question Textarea that can do syntax highlighting on the fly?
Solutions presented there:
CodeMirror
Bespin (Mozilla only, but great)
For the rest - autocompletion etc. - ... Check out the Wikipedia article Comparison of JavaScript-based source code editors
Interested to see what other suggestions come up.
Bespin comes to mind. Though it might be too bleeding edge, depending on how the rest of the project is built/meant to be used (but hey, programmers love bleeding edge).
If you decide to use PHP/HTML/CSS/JavaScript, see GeSHi for syntax highlighting.
I have a side project developed with ACE.
It connects to your server through SFTP and allows you to create new files,read and edit all from your browser with your file tree at sidebar.
Demo at TePe
Code at Github Repo
I found Cobalah Editor it's also built on CodeMirror but with some customization. There are some themes available we can set, increase or decrease font size.

Resources