18 ms·
Visual Studio Code for Go
- dcw303 11y agoDelve integration is better than I anticipated. Breakpoints, step in, step over work as expected. Step out not functional but that's a given as delve doesn't do it either. Call stack is implemented. Variables doesn't seem to automatically work, but adding a var to Watch is ok. With the debug tools, linter, and navigate in/out of definitions, this looks like a pretty efficient workflow. Caveats: I can't compare to Atom, or anything other than vanilla Vim (haven't configured either of them with any of the go integrations).
- dcw303 11y agoEdit: after a restart I can now see Locals in the Variables window! Seems to be related to breakpoint location - if I break at main.main entry I can see variables.
- yegle 11y agoI find it funny that README refer syntax highlighting as "colorization".
- grimgrin 11y agoLooks like it's an old naming convention of theirs: https://msdn.microsoft.com/en-us/library/ms173075(v=vs.80).aspx https://msdn.microsoft.com/en-us/library/ms173075(v=vs.80).a... At least as far back as Visual Studio 2005.
- atonse 11y agoI'm going to add the customary "I love this new MS" line here. About 10 years ago a friend of mine offered to make an introduction with her cousin, who was an exec at MS, to see about a job when I got out of college. I said "no way, they're working on such boring and dull stuff there" But after having worked in C# for a few years now (loving the language) and seeing all the open source moves they're making, it seems like a really exciting place to work these days. And I'm sure there's a ton of renewed energy there.
- 5paceManSpiff 11y ago"Micro$oft"
- jamra 11y agoWell, I don't know about that. They still try and lock you in to their tooling at every turn. I believe that the driving force behind this cool new Microsoft is Azure. They want you to run on their cloud and they'll follow you to OS X and Linux in order to get you there. Make no mistake, Microsoft is the best there is at finding out how to charge you.
- _pmf_ 11y agoI'm kind of a MS fanboy, but please don't believe their lies: - VS is still not free; the community edition can only be legally used by very small companies with slim revenue - the Xamarin acquisition will turn out to be a slap in the face of developers who want to cross target Android and WP - the desaster of the Metro App API that has been replaced by UWP after being hailed as the future of application development for Windows (for a time, you could develop Windows 8.1 Metro Apps only on Windows 8.1 machine, not a Windows 8 machine) Anybody doing any non-desktop application development on Windows is shouldering the full risk of obsolescence within 2 year. I would really, really like a cooperation between Google and Microsoft in the area of the utterly braindead 90ies API of Android development by switching to XAML + C# ... ah, a man can dream!
- valevk 11y agoWhat's the difference between lukehoban's Go extension?
- dvirsky 11y agoit looks like it is his extension, he's committing to this repo if you look at the log. looks like it just moved to the Microsoft org (if it wasn't there already).
- pkaye 11y agoThis is the same thing since he works for Microsoft.
- oldmanhorton 11y agoIt seems as if this is his Go extension, based on the VS Marketplace link and commit history. Microsoft probably just took over ownership to make it "official"
- pkaye 11y agoI like VS Code a lot. It is cross platform and not too heavy. It has a lot of the modern features and look/feel. Don't have to load 50 million plugins to get something reasonable working. I've pretty much stopped using vim/emacs/notepad++ and numerous other editors though occasionally I use vim because I'm on a ssh connection. To me it seems the right balance between complexity and simplicity.
- swah 11y agoWhat is it, though? "Build and debug modern web and cloud applications." Is it like Atom (built on top of a browser)?
- pkaye 11y agoVery similar to Atom. Based on the same framework I think. You really can't tell it is running on a browser. It is more tuned for javascript and other web technologies but with the right plugin, it works fine for Go, Python, C, etc.
- rayiner 11y agoIt's based on Electron, which hosts Chrome in a desktop app. But the actual editor code is different.
- lukehoban 11y agoVS Code aims to be a modern style of editor - lighterweight and more code-focused than an IDE, but with many of the richer capabilities of an IDE offered in context inside the editor. Atom is similar in spirit. Both Code and Atom are built on Electron[0] which hosts libchromiumcontent for rendering cross-platform desktop UI. [0] http://electron.atom.io/ http://electron.atom.io/
- minionslave 11y agoI've never programmed in Go before. Coming from a C# background. Can someone tell me, how does Go feel? Is is pleasant to work in, or is it tricky like C.
- nkozyra 11y agoIt's very pleasant to work in. It has its quirks and language design rigidity and can get tricky, though not quite "like C" unless you're implementing cgo directly.
- rhodysurf 11y agoIts a a very simplistic language. Coming from C# there is no inheritance, only composition. Types are super strict too which can be a pain in the ass (especially cuz you cant add things like an int32 and an int64 together). Its nice once you are used to it though.
- Someone1234 11y ago> especially cuz you cant add things like an int32 and an int64 together Which in some ways makes a lot of sense, in particular if you want to avoid "undefined behaviour" or just behaviour which is subtle. For example: If I add a uint32 and a uint64, what is the format of the result? What about uint64 and int32? Which of those is "larger?" And that's just the least bad example, with two float-formats you can lose precision is strange ways. So I think go forcing the programmer to be specific is painful in the short term but helpful in the medium to long term. Bugs should go down and maintainability up.
- 0xffff2 11y agoI've been dealing with this same issue in Rust, and I think there is definitely a middle ground to be had. In the first example, it's trivial to add uint32 and uint64, and store the result as a uint64. No information is lost at all in that operation. This generalizes to any combination of integral types, where [u]int{x} + [u]int{y} = [u]int{max(x, y)}. It's inexplicable to me why a language wouldn't allow these loss-less operations to be implicit. The other two operations don't have a clear answer, so it makes perfect sense to require an explicit cast in those cases.
- mholt 11y agoI had a good experience overall with this plugin (once it was set up, which wasn't exactly trivial), but it keeps auto-completing in comments so when I hit [return] it inserts some random word rather than going to the next line. Every time I want to go to the next line I have to press [esc] then [return].
- cdnsteve 11y agoDebug support, syntax highlighter, looks very nice. Having trouble getting go build on save working.
- aqtrans 11y agoI've found myself always coming back to VSCode for my (stupid simple, nothing crazy like Docker or anything) Go projects. They've really done a fine job with the editor and extensions. Bravo Microsoft!
- schmichael 11y agoWe're a 100% Go shop and everyone on my team but me uses Visual Studio Code for Go. It's really amazing. (My mind has just been so corrupted by years of vim usage I'm trapped.) It's bizarre to think my team writes in a language created by Google in an editor created by Microsoft on System76 laptops running Ubuntu. Never would have been possible in the Gates or Ballmer eras.
- jalude 11y agoI want to start using Visual Studio Code but I am waiting for a VIM emulator plugin that is "good enough" have you tried any of them?
- jamra 11y agoI tried one recently (2 months ago) and no it's not good enough. The integrated debugger via delve is absolutely great.
- Lewisham 11y agoYeah, I am not a Vim shortcut aficionado at all, but not having . be repeat command was such a deal breaker for me.
- slammers 11y agoRecent issue discussing this - https://github.com/Microsoft/vscode/issues/3600 https://github.com/Microsoft/vscode/issues/3600
- aggronn 11y agoThis is great. Its too bad there isn't a +1 button for comments in github issues, because some of them are just incredibly important to highlight. I just installed VSCode and was impressed overall and would absolutely use it, except I could never switch to an editor that didn't have basic things like this, which was mentioned in the issue thread. Numeric arguments (3dd, 2x, ...) support for combining commands (ci[, cW, ggVG, ...) visual commands Anyone who uses vim primarily lives by these features.
- saiki 11y agoI have been working for sometime with Visual Studio Code and with this Go extension. I used to use Sublime 3 for Go development, but with this extension I have noticed that I use more often vscode than sublime for Go development. It is also a big plus that vscode works very well with TypeScript and you can work seamlessly with TypeScript front and Go backend code. One nice thing is that you can navigate e.g. function calls easily, which places call a function or directly find correct function in question like foo.New() by pressing F12 or shift+F12. When using Sublime to navigate to foo.New() would probably reveal quite many functions that are in your workspace path. Go extension also imports automatically packages that you use in your code. Renaming types or functions also works nicely if your code compiles. There are certainly things to be improved like not being able to conveniently use directories outside your vscode project e.g. common packages across different projects. But over all developer experience is really nice.
- Manishearth 11y agoNote that YouCompleteMe supports Jump To Definition for Go. (YCM has a sublime plugin, among other editors)
- lukehoban 11y agoMaintainer of the extension here. Happy to answer any questions about VS Code or the Go support specifically.
- ngrilly 11y agoAre you employed by Microsoft? I'm asking because the repo is hosted under github.com/Microsoft.
- lukehoban 11y agoYes.
- ngrilly 11y agoOk :-)
- tejinderss 11y agoIs there a plan to release python plugin as well??
- lukehoban 11y agoThere is a Python plugin for VS Code available already [0]. I believe the PTVS folks are also working on a plugin for VS Code as well [1]. [0] https://marketplace.visualstudio.com/items?itemName=donjayamanne.python https://marketplace.visualstudio.com/items?itemName=donjayam... [1] https://news.ycombinator.com/item?id=10589451 https://news.ycombinator.com/item?id=10589451
- kennymeyers 11y agoWhat's the roadmap for the extension?
- iends 11y agoHow does it play with things like glide, gb, and godeps?
- KirinDave 11y agoEven if you don't like MS or distrust them, seriously... VS Code is a very good spiritual successor to TextMate. It has better performance characteristics for me than Atom, and I find extending it much less intimidating than Atom. I'm still more comfortable with Emacs keys, but I found it easy to add the emacs keys I miss. Its license is such that even if MS abandons it I suspect the community will keep it going. So give it a try.
- zerr 11y agoSeems like Acme got a serious competition... :)
- swalsh 11y agoWait, does the debugger work now? The last time I picked up Visual Studio code with a C# core project I couldn't' get the debugger to work with dnx web
- lukehoban 11y agoThe VS Code debugger supports a variety of languages. There is built in support for Node.js debugging which works really nicely. And there are extensions[0] providing support for: Go, PHP, Chrome, Unity and more. [0] https://marketplace.visualstudio.com/VSCode https://marketplace.visualstudio.com/VSCode
- pionar 11y agoThe debugger for C# works on Windows only (for now, since the Linux/OSX debuggers will need to use gdb or lldb). Debuggers for other languages are supported by extensions. For instance, there's a javascript and Typescript debugger built in.
- ossreality 11y agolol, no. C# debugging on Linux will use neither GDB nor LLDB. The GDB text protocol is used, but C# debugging will be done by the clrdbg. It's already been ported.
- kampsy 11y agoI like VsCode especially for js css and html5 stuff. The problem I have with it is that it starts to lag when my codebase gets larger eg above 600 lines. Thats the reason why I switch to Atom. I think Atom is the best free text editor.
- furyofantares 11y agoIs that 600 lines a typo?
- kampsy 11y agoNo its not. 600 lines of Go code.
- furyofantares 11y agoThat is an extremely tiny amount of code for an editor to start choking on :(
- jve 11y agoI'm having almost 34k lines of code for some html file, over 6mb (yes, there is a specific purpose for such a large html file for particular processing) and it works flawlessly in VS Code. I remember searching for text editor that would handle the file nicely and allow working with it. Opening that file in the first VS Code release was a pleasant surprise that performance was good. If I remember correctly I tried Atom before VSCode as I thought: well, that's a nice looking editor. But oh, it was just unusable for such a large file.
- epoch1970 11y agoHow is a 6 MB file, with only 34,000 lines, considered "large" these days? Smartphones from a couple of years ago already had multi-core, multi-GHz processors, and 2 GB or more of RAM. A 6 MB file would fit into memory well over a hundred times, even assuming lots of overhead. Any moderately reasonable text editor should be able to handle a file of that size with total ease, at least for the basic operations.
- donatj 11y agoIf you write Go and haven't tried LiteIDE I'd recommend it strongly.
- alooPotato 11y agoAnyone used Atom with the Go plugin, can you compare?
- CSDude 11y agoNot related to Go plugin, but in VsCode I hate the tabs in the left panel, feels very different and I could not even adjust it after 6 months. However, the Go plugin is really nice and works perfectly, even, the debugger works /most of the time/ . It is fast and handy. Recommended.
- sahaskatta 11y agoAs a long time Sublime user, having side-bar tabs in editors like Brackets or VS Code is definitely quite annoying. I wish they offered the option to place tabs on the top as an alternative.
- bmurphy1976 11y agoI agree. Please vote for this: https://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/7752519-implement-tabs https://visualstudio.uservoice.com/forums/293070-visual-stud... This is the sole blocker for me. With 20 years of muscle memory, tabs and tab hot-keys (i.e. command+1, command+2, etc.) are simply not optional.
- pjmlp 11y agoA bit off topic, but usually I tend to avoid browser based UIs for desktop applications, but the quality of current Rust support in Visual Studio Code made me open an exception just to use it.
- Manishearth 11y agoHuh, maybe I should try it. I'm a Sublime+Vim person, and I'm pretty comfortable with my setup (and have found browser based UIs to be too slow for usage as an editor so I avoid them).
- Maxence 11y agoI use it daily, this one is very good.
- michaelwww 11y agoVisual Studio Code is my favorite editor. I've mentioned it before but I wanted to add that I'm working on a PHP project and by using XDebug on a local server and VSCode as an editor/debugger I have a really nice lightweight debugging solution. The PHP extension to VSCode is solid.
- teh_klev 11y agoIs that all fully/smoothly integrated into VSCode? Along the lines of setting a breakpoint in PHP Storm and waiting for it to light up when it's hit? If so, that's sweet.
- michaelwww 11y agoYes, yes it is sweet. Set a breakpoint in VSCode editor, run, inspect some variables in VSCode editor debug panel, stop debugging, fix code, run with debugging again -- everything you would expect from smooth debugging experience.
- teh_klev 11y agoThanks, I'll revisit VSCode again.
- m6w6 11y agoJFC, that's how VS looks nowadays?
- tonyarkles 11y agoVSCode. Totally different product. It's more of a lightweight code editor and less of an IDE.
- touristtam 11y agointeresting to see the language support for VSC: https://code.visualstudio.com/docs/languages/overview https://code.visualstudio.com/docs/languages/overview
- SonicSoul 11y agoI've used it on a macbook for a short time for node/javascript development, but found it buggy and had to switch back to sublime. The undo (cmd+z) would occasionally get in a weird state where the undo would happen partially (not all lines or columns?) and the whole history would be screwed, or outright stop doing anything. Few times i had to close the file to get last saved version. Perhaps it's something I was doing wrong but it was enough not to use the product, which was great otherwise! Will try again when I hear of new versions coming out..
- rcarmo 11y agoThat was fixed for me with 0.10.0 on Yosemite. Can't find it from my phone, but there was an issue on GitHub I was tracking.
- anthnguyen94 11y agoVSCode's API is great for extensions. Markdown Viewer is incredibly useful in VSCode. I also really like the way VSCode does its Git integration. I've gotta say though, I'm still getting used to the non-tab layout...
- pasbesoin 11y agoYears ago, when MS was thick in the anti-trust contentions, pops and I agreed that were they to break up, it would be great to have one segment be "tools." MS has long had and offered some great programming support -- compilers, development environments, etc. However, with monolithic MS, those too often seem tied to and influenced by the larger corporation's goals. You know, world dominance, crushing the opposition, and all that. I hope that this new push by MS is genuine and does not morph into another embrace, extend, and -- purposefully or simply inevitably -- extinguish effort. I'm not in the thick of it. This is probably an outdated and way far outside observation. Nonetheless, MS support still leaves me looking for the strings attached.
- ausjke 11y agoIf it has source-navigator capability(generate call-graphs etc like what source nagivator does, or similar to ctags) that will be awesome!
- alexc05 11y agoI really love VSCODE. Like really love it. In all fairness I am aware that I can also a bit of a Microsoft 'fanboy' at times... so I held off on trumpeting around the office how truly great I think it is. Of course if it came up in passing or anything like "should I open that in sublime?" came up, I'd make a sweeping grandiose statement like "anything but VSCODE is for chumps" (and we'd all laugh then move on about our day) Anyways, a developer from another team recently saw over my shoulder and said "oh yeah, I'm really liking VSCODE... I've pretty much switched to it full time now" and that was the moment I thought maybe it's not me just being a fanboy... this particular developer was pretty much known as our resident "sublime expert" so much so that he'd given multiple lunchtime presentations and talks around the office on subjects like "how to turn it up to 11 with your sublime text editing" and "snippets for sublime - making you a bajillion times more productive" Anyways, I know how we used to have the religious holy wars about VI/M vs. EMACS vs. whatever, so people really tend to fall in love with "their" text editor and are not really quick to switch BUT VSCODE has really got something special going on.
- deleted 11y ago[deleted]
- andrewingram 11y agoI hate to be that guy, but I guess I will, because aesthetics are important to me when choosing a tool i'll be using for several hours a day. I love how Atom looks. Alongside the nicer extension system, the aesthetics of the default theme are what lured me away from Sublime Text. I sadly can't say the same for Visual Studio Code, which I hear so many great things about, but can't bring myself to use for more than a few minutes. From what i've been able to tell, the only visual customisation available is choosing the syntax colour theme.
- tmzt 11y agoThere is support for full color schemes for the entire UI not just the text colors. There is also support for loading TextMate and Sublime themes. https://code.visualstudio.com/docs/customization/themes https://code.visualstudio.com/docs/customization/themes I personally use a nice dark theme, similar to the one shown in that screenshot. There are also a large range of extensions and VS Code is really fast.
- andrewingram 11y agoWhat about changing the appearance of the fairly unpleasant left-most bar (with the code/search/version/debugging switcher), the super in-your-face status bar, etc?
- agnivade 11y agoYou are right. But when you see how much memory Atom takes and compare that to how lightweight Sublime is, you might want to reconsider.
- sakopov 11y agoI've been a .net dev for years now and it's such a joy to see stuff like this come out of MS. I'm a heavy VS user and haven't had the need to switch to VSC yet. I might check it out for angular/js apps.
- hit8run 11y agoWTF!? I already posted this exact link 4 days ago and it got almost no attention :D Sometimes HN is weird. https://news.ycombinator.com/item?id=11193028 https://news.ycombinator.com/item?id=11193028
- tuananh 11y agotry again at the most crowded time of HN. it may get better exposure.
- rshetty10 11y agoVS Code seems a bit of overkill to use as an editor for golang editing. As someone already mentioned in the comments, my mind is also corrupted with Vim awesomeness and vim with vim-go works shockingly every-time.
- thewhitetulip 11y agoI wonder why this was featured today, I have been using vscode for Go since a few months now. It is totally amazing, especially the ctrl+P option! It isn't highlighted but it is a little gem.
- nowprovision 11y agoWhat does Visual Studio Go offer that I don't get from vim-go? Does it have gofmt hooks on file save?
- spv 11y agoWould love have support like this for Python.
- bipin_nag 11y agoI code a lot in Go. I use Sublime Text mostly and this feels like an upgrade. Integration with Git, better plugins/support I am loving it.
- samuell 11y agoThis is great. I love how definitions are display on hovering over any variable or function, the go to definition feature and the split window feature, which makes it sweet and easy to keep reference code bits while coding ... I think with the definition display on hover, it even beats vim.