Page 1 of 1

Visual Studio Code plugin (IntelliSense) for BYOND code

PostPosted: Sun Jul 29, 2018 3:58 am
by SpaceManiac
I am proud to announce DreamMaker Language Client, a Visual Studio Code extension which delivers not only a better text editing experience than Dream Maker, but language smartness (IntelliSense) features including warnings and go-to-definition for navigating the codebase quickly. The /tg/station codebase loads in the background and IntelliSense becomes available after about 3-6 seconds. (For the unfamiliar, Visual Studio Code is an easy-to-install text editor/ide-lite, and is NOT the same thing as Visual Studio.)

(Sublime Text 3 package with similar features here.)

IntelliSense features include:
  • Workspace symbol search to find types, procs, vars, and macros (Ctrl+T).
  • Robust go-to-definition (Ctrl+Click) support.
  • As-you-type autocomplete of types, procs, vars, and macros.
  • Hovering var and proc definitions to see their parents.
  • Outline view of the current file.
  • Find all references, for finding places where a type/proc/var is used.
  • Warnings against certain kinds of bad style.
Additional extension features include:
  • Project object tree view.
  • Ctrl+Shift+B to run the compiler.
    • Ctrl+Shift+P "Default Build Task" to remove prompts for tgui builds.
    • Errors will appear in VS Code's "Problem" pane, clickable to navigate to that code file.
  • Status bar control to toggle a file's tickmark in the .dme.
    • Optionally automatically ticking created/unticking deleted files.
  • Built-in DM Reference browser.
    • Open index with "DreamMaker: Open DM Reference" in the command palette.
    • Look up items with workspace symbol search (Ctrl+T) or by Ctrl+Clicking where they're used.
  • Status bar button which can be clicked to reload the environment.
The IntelliSense is powered by the SpacemanDMM parser, the same as used by MapDiffBot. The VS Code extension has a separate source code repository.

A separate extension is available for syntax highlighting, which I recommend but do not maintain: BYOND DM Language Support.

The go-to-definition support is brand new and I think finally adds enough meat to the IntelliSense to warrant an announcement on the forums. A few of the maintainers in #coderbus, particularly Antur, have been helping test and providing feedback (thanks!). I've been using this setup for several months and it's huge productivity improvement. I have a very rough roadmap going forward, but am open to suggestions if they make sense. Future updates will be posted in this thread.

tl;dr


Re: Visual Studio Code plugin (IntelliSense) for BYOND code

PostPosted: Sun Jul 29, 2018 8:22 pm
by Denton
Thank you for putting a lot of work into that. Looks amazing!

Re: Visual Studio Code plugin (IntelliSense) for BYOND code

PostPosted: Mon Jul 30, 2018 11:47 am
by Qustinnus
Woow awesome, this might make me move from Atom to VS!

[Deleted]

PostPosted: Tue Jul 31, 2018 9:49 am
by Jaredfogle
PostThis post was deleted by Jaredfogle on Tue Jul 31, 2018 9:50 am.

Re: Visual Studio Code plugin (IntelliSense) for BYOND code

PostPosted: Wed Aug 01, 2018 7:02 am
by SpaceManiac
I spent the day marathon-coding an initial version of as-you-type autocomplete. There's some obvious room for improvement but it came out surprisingly well! Restart VS Code or reload the window to get the update.

Re: Visual Studio Code plugin (IntelliSense) for BYOND code

PostPosted: Sun Mar 17, 2019 6:27 am
by SpaceManiac
The language server now supports Go To Type Definition, Find All References, and current-file outline view. The VS Code extension now supports an Object Tree pane (similar to what you might see in DreamMaker).

Re: Visual Studio Code plugin (IntelliSense) for BYOND code

PostPosted: Sun Mar 17, 2019 10:53 am
by AnturK
:heart: Find all references :heart:

Re: Visual Studio Code plugin (IntelliSense) for BYOND code

PostPosted: Mon Jun 24, 2019 9:41 pm
by SpaceManiac
By commission, I developed a Sublime Text 3 package with similar functionality to the Visual Studio Code plugin, although I still recommend VSC: https://github.com/SpaceManiac/sublime-dm-langclient

It will be on Package Control eventually.