Visual Studio Code plugin (IntelliSense) for BYOND code

How, what and why to code in BYOND.

Moderators: MisterPerson, Code Maintainers

SpaceManiac
Code Maintainer
 
Joined: Fri Sep 22, 2017 4:06 am
Byond Username: SpaceManiac
Github Username: SpaceManiac

Visual Studio Code plugin (IntelliSense) for BYOND code

Postby SpaceManiac » Sun Jul 29, 2018 3:58 am #429772

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




User avatar
Denton
Code Maintainer
 
Joined: Wed Aug 23, 2017 3:53 pm
Byond Username: Denton-30
Github Username: 81Denton

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

Postby Denton » Sun Jul 29, 2018 8:22 pm #429856

Thank you for putting a lot of work into that. Looks amazing!

User avatar
Qustinnus
TGMC Maintainer
 
Joined: Tue Nov 07, 2017 12:30 am
Byond Username: Qustinnus

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

Postby Qustinnus » Mon Jul 30, 2018 11:47 am #429996

Woow awesome, this might make me move from Atom to VS!

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

SpaceManiac
Code Maintainer
 
Joined: Fri Sep 22, 2017 4:06 am
Byond Username: SpaceManiac
Github Username: SpaceManiac

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

Postby SpaceManiac » Wed Aug 01, 2018 7:02 am #430463

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.

SpaceManiac
Code Maintainer
 
Joined: Fri Sep 22, 2017 4:06 am
Byond Username: SpaceManiac
Github Username: SpaceManiac

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

Postby SpaceManiac » Sun Mar 17, 2019 6:27 am #483903

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).

AnturK
Code Maintainer
 
Joined: Fri Apr 18, 2014 4:42 pm
Byond Username: Anturke

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

Postby AnturK » Sun Mar 17, 2019 10:53 am #483939

:heart: Find all references :heart:

SpaceManiac
Code Maintainer
 
Joined: Fri Sep 22, 2017 4:06 am
Byond Username: SpaceManiac
Github Username: SpaceManiac

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

Postby SpaceManiac » Mon Jun 24, 2019 9:41 pm #500689

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.


Return to Coding

Who is online

Users browsing this forum: No registered users