Visual Studio Code


#1

Has anyone used Visual Studio Code to ‘debug’ Meteor server-side code? While Google Chrome Developer Tools do an admirable job of helping debug the client side code, there is nothing close for debugging the server side code. Sure, node-inspector works, sort of. It has trouble getting inside anonymous functions for starters. And there are other issues.

I took a detour in learning ‘typescript/angular/node/express’ applications development and was amazed at how powerful ‘visual studio code’ is for writing and more importantly, debugging node applications. In theory, Meteor is a node application, but the devil is in details.

Before I invest my time in trying to set up visual studio code for Meteor server-side debugging, I thought I would ask the community first.


#2

I recently tried again VSC and I have to say I’m quite impressed by its qualities. Switching from Sublime Text, I’m actually missing only a few (small) features while getting a bunch of great new ones (intellisense, git integration…). Getting the built-in debugger work on both the client and the server would be amazing. I’m sure there is a bit of plumbing involved but that should be totally doable as it already work on both vanilla NodeJS and on Chrome apps.

Bumping this topic to give it some visibility.


#3

VSCode is perfect for developing Angular 2 applications in Typescript. The VIM support is rather recent and therefore limited. If only it had better VIM support and easy to set up Meteor development, I would seriously consider it.

Have you tried debugging Meteor apps in it especially ECMAScript2015 compliant code?


#4

The only thing I’ve ever gotten to debug Meteor (Server Side) has been node-inspector… which is pretty much ChromeDevTools. About a month ago, I tried VS Code, and then it’s big brother, Visual Studio with all of the JS plugins enabled. Here’s my take on the matter:

  1. VS Code (and probably VS itself) are on a track to become the best js IDEs (I’ll explain why below)
  2. VS/VS Code have very immature ES6+ support. If it’s Stage 0, I’m probably using it. VS & VS Code do not support many things that are integral to projects I’m working on. This is a deal breaker, my code is constantly marked as invalid, I just can’t use it.
  3. I’ll be using WebStorm in the meanwhile. It’s got nearly full compliance with es6/7, I don’t really run into any issues with it invalidating valid code at all. However, It’s intellisense/autocomplete sucks (but is getting much better)
  • My short term memory only lasts about 12 seconds so …hey wait what were we talking about? :unamused: so I rely heavily on autocomplete.The WebStorm interpreter does not do a very good job at coming up with the autocomplete results you expect. When autocomplete comes up, the options are either A) 1000s of random methods from anything in your node_modules B) the right function, but duplicate (or triplicate) results. And when it finds “multiple definitions” it does not provide any of the parameter/documentation like it should. C) just reserve words. nothing else.
  • So, I’ve resorted to JSDoc’ing literally everything. It’s a huge pain in the ass, I have to define a lot of @typedef for any type of object I pass between functions/classes/files. But, it works. I get the right results (at the top of a list of wrong ones) 98% of the time. In addition WebStorm has better mouse-over-to-view-documentation support than any JS IDE, period. Atom doesn’t have any packages that do this and atom-tern, it’s only autocomplete provider that does type analysis is stagnant, as is much of atom from what I’ve seen. So in the end, I guess there’s the benefit of my code looking like it’s from some huge opensource library… its not, I’m just very particular.
  1. It’s going to take VS Code a while to get there. Only last month did they release JSX/React support, something WebStorm and Atom have had for quite a while. I spent about a day digging arround the internet trying to get things working for es6/7 and noticed that blog posts and releases were about 1-2 months a part. So, I’m not that optimistic about how long it’ll be until it’ll be usable. I’ve been following the WebStorm issue tracker, and their blog. There’s a new EAP for download each week that does contain fixes to many of the reported issues.
  2. Why VS/VS Code is awesome
  • plugins available are very robust, I haven’t looked at how they’re developed, but they must give you easy access to some pretty fundamental parts of the apps inner workings. I haven’t kept track of how frequent their (VS Code’s Plugin’s) updates are, but more than half of the two hundred or so plugins for jetbrains’s suite of IDEs are from like 2007 and broken as hell.
  • it feels like home. The two IDEs i’ve like the best are Eclipse, then VisualStudio. The workflow just feels right to me, both have always had outstanding intellisense/autocomplete. It doesn’t feel clunky like WebStorm. And Atom makes me feel like a T-Rex trying to drive a semi-truck (wtf? idk that simile makes sense to me) It’s too dependant on keybindings. VS Code suffers from this more so than just VS, but its better than atom.
  • it has an extensible api for how to create your own intellisense resolvers. This seems pretty exposed, havent tried it, but I believe it’d be way easier to develop one for what I want than it would be to dig my way in and hijack WebStorm’s lexer.
  • VS has always been top notch imho, given time, I think it will get there for JS.

Disclaimer:
JS is not a statically typed language, it’s not easy to interpret ES5 code, let alone a constantly evolving standard like ES6+ so I’m not saying all the IDE devs suck, they’ve done many amazing things.

There’s a lot better support in all IDEs for TypeScript (because it is Statically Typed) I am aware of that, but I’m writing javascript, not typescript. I’m concerned about the IDE’s functionality for JS.


#5

Hi All,
I’m trying for Typescript with Meteor using VSCode. But I failed to set up break point at server side source code using VSCode attach debugging. It complains "Breakpoint ignored because generated code not found (source map problem?).
Is there anyone who made it work? Please share your experience.

Thanks in advance,
Jin.


#6

I started using this editor lately, and came away impressed.

Has anyone got this working with version 1.3.1 (this version sees enhanced Node.js Debugging with Attach to Process capabilities)?