Build OS-independent notepad with some code completion - appropriate platform? - programming-languages

I want to build as simple notepad application with some code-completion.
It should be easy to compile to Linux, OS X and Windows.
I'm looking at wx-widgets or GTK. Others?? (as web-service as worst case.),
and without library dependencies.
Or does there exist any OS-independent FOSS editor with plug-in functionality.
(Eclipse way to heavy).
To be specific, what I want is a "helper" when coding XML towards an application-framework that use XML extensively. As libraries are loaded (through XML) new tags should be allowed and their existence should be prompted to user, both in toolbar (tags) and auto-complete (attributes).
Recommendations?
regards,
//t

XML Copy Editor: I've used it and it's not the best editor, but it does do the autocompletion.
Conglomerate: Looks quite promising but I never got it to work when I tried it out a year ago. Perhaps it's improved since then.
As for an OS-independent FOSS editor with plugin functionality that is more lightweight than Eclipse, try Gedit. It's not too difficult to write plugins for whatever functionality you may need. It's based on GTK.

Related

Writing a Verilog autoformat extension for Sublime/VS Code

As an RTL developer, I find it annoying that my favorite text editors (Notepad++, Sublime, VS Code) don't have autoformat options for RTL languages like Verilog and VHDL. So I took it upon myself to create one.
I want to develop an auto-format extension for one of those editors. I dropped Notepad++ because it doesn't have native support for Linux and macOS.
So, the question is: how to get started in developing an auto-format extension for a language for Sublime and VS Code?
Notes:
I don't intend to develop an extension for both editors but I'd want to see which would be more feasible.
With Verilog being closer to C syntax, it might be easier to start there (and I also prefer it over VHDL, but let's not get into religious discussions)
I know that Emacs and Sigasi editors provide auto-format options for RTL languages but their format options are strict and I don't like the outcome, hence I intend to make the formatting style configurable
I ran into this work https://github.com/thomasrussellmurphy/istyle-verilog-formatter it might be useful to build on it if possible
I don't intend to develop an extension for both editors but I'd want to see which would be more feasible.
In my opinion, I would prefer coding RTL languages in VS code because it's more versatile than sublime text as in free beer and speech. I would highly recommend beginning from here https://code.visualstudio.com/docs/extensions/example-hello-world.
Oh, you also need to know Typescript / Javascript to write an extension.
I ran into this work https://github.com/thomasrussellmurphy/istyle-verilog-formatter it might be useful to build on it if possible
I am excited to see the port of this to VS Code/ Sublime Text. I am sorry I don't know how to work on from C++ to TypeScript. My guess would be to copy the implementation method and write in TypeScript.
From their website :
Prerequisites:
You need Node.js installed and available in your $PATH. Node.js includes npm, the Node.js Package Manager, which will be used to install the extension generator.
I am pretty excited to see auto formatting extensions for Verilog. I hope i can contribute too :)
Edit :
I found this https://github.com/g2384/VHDLFormatter written in TypeScript. The transition to VSCode/Sublime would be easier than the above in C++. I have tested it personally and it works awesome! Hope it helps :)

"Jump to definition" in Rust

After years of coding in modern IDEs (Visual Studio, Xcode, JetBrain's products) I'm quite used to invaluable Jump to definition feature. It is especially invaluable for system libraries and frameworks when you yet learning the core features of the new language.
Is there any way to achieve the same functionality for the Rust combined with any modern IDE or text editor? Any vim, sublime text plugin?
IDE support for Rust is not there yet. There exists at least the Racer project, that provides a jump-to-definition feature among other things.
Racer is intended to be integrated into any IDE/text editor, and ships with an emacs integration.
In Vim and emacs you can use ctags to get you a lot of the way there; the language definitions are in src/etc/ctags.rust and you can produce tags for the Rust distribution with make TAGS.vi (or make TAGS.emacs for emacs’ format). See mk/ctags.mk for more information.
For setting them up and using them in Vim, see :help tags.
There is a project called rusty-tags generating ctags for Rust. At the time of this post, it is still actively maintained.
The RustDT IDE now supports Open Definition functionality, using the Racer tool.
Sublime's RustAutoComplete has a working Go to Definition using a separately installed Racer.
I'm using it and it works.
That being said, in 2014 the language is still in a flux and the Racer functionality is still limited.
I currenly have "auto_complete": false and only use the completion manually (with a keyboard shortcut) in order to avoid some Racer crashes.
Emacs can be integrated with rust-analyzer via lsp-mode. This will allow you to navigate the source code using Rust's type system. I describe a detailed setup in the code navigation section of my Rust with Emacs guide.
dumb-jump works well for rust.

VIM: More precise C/C++ code parsing solutions?

Pre:
I've been working in VIM for like a year already. Lots of great things: combinations, scripts. Whenever I'm editing something in a different editor, I feel sluggish/uncomfortable without VIM's navigation.
The problem:
The thing that really bothers me most of all is source code navigation using existing tools (ctags, cscope). Often, ctags can't find the declaration of a variable, cscope as opposed to ctags finds all definitions with the same variable name. Same craziness with call tree navigation, finding forward declarations along with a single class definition etc.
Compared to MS Intellisense, Visual Assist or even source code navigation in Eclipse, Exuberant Tags/cscope seems to be deprecated for at least 10 years.
I know there are tools like ViEMU, but they don't really solve the problem, since you lose lots of VIM's functionality.
The question:
I was wondering if there is a tool that does the source parsing better, or there is some way to integrate source parsing engines like Intellisense into VIM ?
Maybe there are commercial solutions or there are people who are ready to implement one ?
All the benefits of VIM seem to save less time than is being wasted while navigating to class definition, compared to Visual Assist, where it's done by a single Alt-G shortcut.
Search and Call tree
You could try eclim, which is a way to use some Eclipse features in Vim.
For C/C++, it provides :
Context sensitive completion (although it is disabled on Windows because it is buggy)
Context sensitive search in Project files (through :CSearchContext)
Call tree for functions/methods (:CCallHierarchy)
Code Validation (:Validate)
It is not great, but it can help in some cases.
Code Completion
Regarding automatic code completion, I primarily use OmniCppComplete, which is using tags to provide Context aware code completion. It is not that bad.
As advised by Luc Hermitte, you can also use clang_complete which does not need ctags, but needs clang installed.
Unfortunatelly, it is a real problem. ctags or cscope can hardly compete with Visual Studio code browsing - it actually uses a C++ compiler front-end to parse the code for the editor.

A Linux tool that will display errors as I type, Visual Studio style

I'm looking a tool that will display details of syntax errors in my code as I'm typing it, in the same way that Visual Studio does. I'm currently using Gedit, but am not adverse to acquiring a new text editor. I'm using C++ and HTML/CSS right now, but will be branching out to more languages in the future, so it needs to have support for as many languages as possible. I'd also like to avoid using an IDE as I feel more productive using a text editor and the GNU toolchain. Any suggestions?
You will likely have difficulty finding a simple one-file editor that can do this. An IDE is virtually a necessity, since it integrates with a compiler to detect errors/warnings.
If you use an IDE (and I would recommend Eclipse or maybe KDevelop), you can continue to use the GNU toolchain; you don't need to build your project from the IDE if you don't want to. I regularly use Eclipse for programming and then Ant or Make in a terminal for building.
How about Eclipse?
vim does syntax highlighting well. As far as I know, however, it doesn't have the ability to display the details of the syntax errors in the editor. The constant "hands on keyboard" does speed up programming, though.
vim with the pyflakes plugin does this for python, but I don't know about other languages.

Emacs/VIM vs. Compiler

Since Emacs and VIM are just text editors, does that mean I have to copy paste the code into an IDE so it can be compiled?
Well you edit your files in emacs or vim. Then you save them and then you invoke the target language compiler.
Typically, C projects would use Makefiles that are meant to track down the files needed to be compiled into a program, and their dependencies. Then you typically type make in the command line and make reads the Makefile you authored and takes care of invoking the compiler on the files etc...
For Java, people often use Ant or Maven to build their software.
...I know that my answer is vague, the list of languages and build tools is long, you should narrow down your question.
Very often, under Linux, when I don't need a massive IDE, I'm using Pida. It brings me a list view of the different Vim buffers, a convenient treeview of the filesystem and a shell: see screenshot.
See:
GNU Make
CMake
Autotools
Ant
Maven
[insert your favorite build tool here]
Text editors just edit files.
Compilers just compile files.
IDE's just bring files and the compiler together in a convenient way.
So... No, you don't need to copy/paste the code into an IDE, however you do have to make sure your compiler (IDE in your case) knows where to find the file you want to compile.
You don't need an IDE to compile a program. You just need a compiler. Emacs/Vim are text editors that allow you to write your program. You then call the compiler and it will do the compilation.
Also, Emacs and Vim are scriptable and have routines that allow you to call a compiler directly on the file you're editing.
In vim, you type :make. In emacs, you type a M-x compile-frobnicate style command which I'm sure someone will provide.
Apart from what already has been said, take a few tutorials to learn how to code/compile with vim and Emacs:
Intro to C/C++ Programming with vim
Using Emacs for programming
In VIM (with no extensions installed) something like
! /path/to/make (C/C++ world)
or
! /path/to/ant build (Java world)
It depends on your compiler, platform, and program. Most, like gcc, can be called from the command line (or from within either of those editors) although you may have to first write a makefile for the linker. Other compilers are integrated into IDEs (or are difficult to control externally), although even these won't require copy/pasting. Simply save your program and open it from within the IDE.
So far: IDE = a poor editor + compiler + debugger + other_unnecessary_stuffs
Go get a compiler and a debugger and you do not need an IDE anymore
Many IDEs can detect if the source file is changed by an external program, and prompt you to reload. I know this is the case with MS Visual Studio and CodeWarrior.
This is useful if your project is already managed by the IDE and you don't want to move it to something like Make, for example if you're on a team who mostly use the IDE, but you want to use a different editor. Simply edit and save the file in vim or emacs, switch back to your editor and hit Compile.
No, you don't need an IDE to compile code that you write in emacs.
I use emacs very extensively for building .NET code in C#.
The .NET runtime includes compilers.
I downloaded the .NET SDK, which includes other tools, like nmake, msbuild, XML tools, debuggers and so on.
I grabbed csharp-mode.el, which teaches emacs how to highlight and indent C# modules.
C-x C-e , for me, runs the command compile. I type in msbuild there, and emacs runs the build, using the .NET SDK tools.
I do something similar with C code, and with Java code, and with Javascript.
The same idea will work with other languages as well.
For Visual Studio integration, I highly recommend ViEmu.
It basically turns the editor in VS into Vim. I use it every day at work, and it is very stable. I can't imagine working without it!
(source: viemu.com)

Resources