* Plugin Editors -- another alternative (Visual Studio Code)

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Plugin Editors -- another alternative (Visual Studio Code)

Post by ColeValleyGirl »

As some of you know, I've been using the Zerobrane editor for Lua for sometime, having looked at all the options a few years back and failed to find all the features I wanted in any of them. Zerobrane came closest to meeting my needs but fell down on software version control (specifically Git integration).

Last week Jane (thanks!) suggested I took another look at Visual Studio Code, so I did.

It has come on leaps and bounds since I looked at it last. I can now have:
  • Code folding (at various levels)
  • Git integration
  • Mutiple files open for editing side by side within an single instance
  • Todo items
as well as the usual outlining, formatting, problem analysis, etc.

I've added a few extensions to the basic editor to make it a better match for my needs:
  • Lua (sumneko.lua) which handles Autocompletion, cross-reference, syntax checking etc.
  • vscode-lua-format (koihik.vscode-lua-format) -- does what it says on the tin
  • Todo Tree (gruntfuggly.todo-tree) which searches for comment tags (e.g. TODO, FIXME or others of your definition) and creates a todo tree so you can see what you've noted you still need to action
  • GitLens (eamodio.gitlens) which adds to the Git functionality built into the editor. (You neeed to install Git on your PC to make the Git functionality available).
I still have to work out how to make it recognise the fh API (plus iup etc.), but I can at least tell it to stop reporting library calls as problems, which is another step up from Zerobrane... And I might tweak the formatting behaviour, although I can probably live with what comes out of the box. Plus, you still have to transfer the code into the fh Lua editor to debug it...

If what you're using doesn't quite suit you, and you're not averse to using a free Microsoft product, or you need an editor both for Lua and other languages and you want to reduce the number of programmes you have installed, you might want to take a look. I'm planning to get rid of ZeroBrane and seriously consider ditching Visual Studio 2019 (if I can work out how to compile LuaRocks without it).

There is a lot of online documentation.
User avatar
jimlad68
Megastar
Posts: 921
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: Plugin Editors -- another alternative (Visual Studio Code)

Post by jimlad68 »

I am no programmer, at best simple scripting or "copy/butcher" other script/code. I have used Notepad++ for a long time now and serves most of my needs including a GEDCOM LEXER (a bit fiddly to instal).

But when I came to do some simple scripting for Autohotkey (AHK) I could not find a Notepad++ Lexer for it, and after some searching I too found Visual Studio Code (aka VS Code or Code.exe), Microsoft have put a lot of work into it.

For AHK I use lexer AutoHotkey Plus Plus by Mark Wiemer, there are others.
It also has a Gedcom lexer called GEDCOM Language by Florian Guitton, which I have not used much as I am too familiar with Notepad++ to take the time to make the move, and Notepad++ still has some tricks up its sleeve I cannot find anywhere else (e.g. line up columns with blanks).

I for one would be interested in any other observations.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Plugin Editors -- another alternative (Visual Studio Code)

Post by ColeValleyGirl »

Thanks, Jim -- I should investigate the Gedcom lexer.
User avatar
Valkrider
Megastar
Posts: 1563
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: Plugin Editors -- another alternative (Visual Studio Code)

Post by Valkrider »

The nice thing is that M$ also supply this editor for the Mac. I will have to give it a try.
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Plugin Editors -- another alternative (Visual Studio Code)

Post by Mark1834 »

At the other end of the scale, users just starting to explore writing plugins who would probably find a full-fat IDE such as Zerobrane or Visual Studio too intimidating could get significant benefit from Notepad++ rather than just relying on the FH7 editor and debugger (although even that is a significant step up from the version in FH6).

Having automatic syntax highlighting makes code much easier to follow, and automatic indents allows easy entering of loops and other control structures. Neither FH7 nor Notepad++ lock the plugin file while editing, so it is straightforward to enter the code in Notepad++ and run it in FH. I also find it very useful for proofreading code, often from a prepared PDF viewed on the iPad sitting in the garden or with my feet up on the sofa :). Mind you, even my longer plugins only run to about 5-6 pages of printed code, not the 100+ pages of some of the store plugins!

To illustrate, the screen dumps below show the same section of code from a typical store plugin viewed in FH7 and Notepad++. I know which one I find easier to follow!
Plain text in FH7
Plain text in FH7
FH7.PNG (25.05 KiB) Viewed 2345 times
Automatic syntax highlighting in Notepad++
Automatic syntax highlighting in Notepad++
Notepad++.PNG (26.47 KiB) Viewed 2345 times
Mark Draper
Post Reply