[DGD] DGD and Visual Studio Code
Joakim Romland
romland at gmail.com
Sat Jan 19 16:43:26 CET 2019
Some time back I dipped my toes into the wonderful world of DGD again. I am
using it as the server for a multi-player mobile device game. I'm confident
that that I am not alone in feeling this; if you work with DGD outside of
the MUD scope it becomes a bit painful to not have your entire workflow in
an editor (no fault of DGD, mind).
So, I had merely dabbled a bit in Visual Studio Code prior to this, but
had read good stuff and it seems to be all the rage for a lot of people
these days. Thus, this editor extension was conceived.
Source here: https://github.com/romland/dgdcode
Release here: https://github.com/romland/dgdcode/releases
-Some- of the functionality
---------------------------
- Simulated "intellisense" for DGD's 97 kfuns (klib's l/efuns as well)
- Recompile on save (optional)
- Acting on compile errors (click error to go to problem)
- Execute function in current scope
- The standard stuff: status, recompile, destruct etc are available as
commands (and context menus).
- Run arbitrary code from dialog. Although, personally I just add a
function in a "scrapbook" object and press ctrl or cmd+e to just execute
it there. Which turned out to be a welcome addition to my workflow
as I can easily turn the scrapbook objects into tests.
- List and work with clones (and their master object)
- Object status (hover in added Object Instances view)
- The editor will call to_string() in objects to give an "at-the-glance"
idea of what is going on. It's a simple idea, but it's helped me
enormously. Say, I select "gamed.c" in the editor and the comment
next to its name will then say "152 active games". I had no idea
I *needed* it. This combined with being able to safely tweak and
recompile objects that are in a live environment ... coming from
Java-land ... well, I love DGD for it. But I know I am preaching
to the choir, here.
- "Prettify" output of data
- Follow (DGD) log in built-in terminal (which I must confess to not
using much myself as I want focus on output tab)
- Plenty of things to change in settings. Search for 'dgd' and they
should appear. Because of my laziness, you have to restart editor
if you change DGD related settings.
- ... and more.
Requirements
------------
- Felix' Kernel Library. That said, any lib will work as long as the
"code" command is the same (or at least looks the same). In my case
Kernel Library's wiztool is completely unmodified. Making these
assumptions configurable is definitely an option, though. I have
just not needed to.
- If you want to work with individual clones of objects you will want
something like an objectd. Personally I snagged Noah Gibbs' public
domain one, added a patch to track clones and allowed /usr/admin/
to query for clone IDs of a master object.
- For scope detection (for calling current function, etc) I rely on the
LSP of C/C++. This is something you want for syntax highlighting, etc,
as well. That extension is flagged as a dependency and editor will
act accordingly.
License is MIT. I like MIT.
It should work on macOS, Windows and Linux, but it's early days and
there will be bugs.
Cheers,
Joakim
PS. I never really use Github (and had more or less forgotten about this
account)
but it turns out I have used it for DGD before so ... why not put it there!
More information about the DGD
mailing list