简体   繁体   中英

Are there any text-editors/IDEs that support languages generically?

I'm looking for an editor/IDE that can provide features that are nice to have while coding (example: being able to click-through to function definitions) for languages that it is not specifically built for. By these, I have in mind languages designed for a very specific purpose and often only used by a small community. In other words, ones that would not have native support in most software.

I realize this would require a fair bit of fairy dust but I don't think it's out of the scope of what's possible. Basically, the editor would have to be smart enough to recognize the commonly used syntax and semantics that many declarative languages have in common. It's quite possible this would require some amount of configuration.

Does something like this exist? If not, what challenges do you think there would be in creating it?

If you need only the feature to jump of to the definition of a specific function or class, then VIM (and many other editors, like Emacs, Epsilon and JOE) can read the jump location from the ctags file. You just have to write a ctags file generator for your custom language.

For programmable editors (like VIM, Emacs, Epsilon, Eclipse and gedit), you can write your own plugin for your custom language, but it may quickly become time-consuming and a maintenance nightmare, because new versions of editors tend to change the plugin interface.

Please note that adding support for syntax highlighting is usually much easier than adding ctags-like support for symbol lookups. More advanced features, like refactoring and context-sensitive symbol completion (like Ctrl-Space and Tab in modern IDEs) are even harder to implement.

GNU Emacs has a pretty good infrastructure for this sort of thing. Until recently Haskell was a relatively unknown language used primarily by researchers. Nevertheless, in a few thousand lines of Emacs Lisp, we have

  • Syntax highlighting with colors
  • Automatic indentation
  • Package support
  • Automatic highlighting of type and other information when placing the cursor over library functions
  • Meta-dot on an identifier to jump to its definition (through the standard emacs tags mechanism)

The nice thing about Emacs is that (a) there are many models to follow, and (b) you can build up the environment gradually, starting with those aspects that are most important to you.

I'm suprised no one has mentioned Notepad++ yet: http://notepad-plus-plus.org/

It offers syntax support for a great many languages and offers the user to add new languages, and an active community that adds many languages that are not included out-of-the-box.

Most good IDE's are language agnostic and supports several if not many programming languages. If you are talking about DSL's, eclipse has a solution that seems pretty awsome - Xtext

EditPadPro comes with a set of tools that allow you to build your own syntax highlighting , code folding and file navigation schemes, based on a very powerful regex syntax. So if your language is not among the many that have already been provided out-of-the-box or can be downloaded off the website , you can roll your own quite easily (and share it with the community).

替代文字

Visual Studio is designed to allow for this, but it requires the language to add explicit support. For example, Delphi Prism will install into Visual Studio, and provide full language support.

This is far above and beyond "configuration", however, and requires quite a bit of custom development to support.

SciTE and Scintilla offer a generic editor/platform for different languages. The library contains several parsers that work with many programming languages and you can reuse one of these for your own language to add formatting and syntax highlighting.

They don't offer advanced features like click-throughs, but you could build it on top of the library.

Visual Studio and Eclipse also support language plug-ins.

Zeus is a language neutral IDE for the Windows platform and it provides this go to definition/declaration functionality for any language supported by ctags .

To make it work you just create a Zeus project/workspace and then add the files to this workspace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM