News for hackers. Stuff that matters.
Re:Announcing TypeScript 2.2 by ng12 on Wednesday February 22, 2017 @01:29PM (#13707805)
Speaking of tooling -- has anyone had a good experience with Typescript in IntelliJ/Webstorm? It does a fantastic job figuring out ES6 code but seems to totally choke on Typescript. I'd like to avoid switching to Visual Studio.
Re:Announcing TypeScript 2.2 by jameslk on Wednesday February 22, 2017 @01:42PM (#13707955)
Make sure you turn on the native TypeScript Language Service feature, otherwise you'll be getting your IDE's parser, which is always behind the standard and doesn't work very well:

> Select the Use TypeScript Service check box to get native support from the TypeScript Language Service according to the up-to-date specifications. In this case syntax and error highlighting is performed based on the annotations retrieved from the TypeScript Language Service while code completion lists contain both suggestions from the TypeScript Language Service and suggestions calculated by IntelliJ IDEA itself.

https://www.jetbrains.com/help/idea/2016.2/typescript-suppor...

Re:Announcing TypeScript 2.2 by ng12 on Wednesday February 22, 2017 @02:01PM (#13708177)
Well that solved some problems (e.g. importing from react-router/lib/*) but autocomplete for TSX is non-functional. Still pretty frustrating considering ES6 works out of the box.
Re:Announcing TypeScript 2.2 by Rapzid on Wednesday February 22, 2017 @02:29PM (#13708416)
I've been working VS Code with TypeScript regularly for over a year now. It sounds like you want to stay in Intellij, but the language services experience in VS Code is top notch for TypeScript.
Re:Announcing TypeScript 2.2 by chaostheory on Wednesday February 22, 2017 @02:26PM (#13708393)
I could be doing things wrong but in my exp, Webstorm's autocomplete is non-existent for anything that you import
Re:Announcing TypeScript 2.2 by pierrehenrit on Thursday February 23, 2017 @03:13PM (#13717331)
I have the same issue for some of the libraries. I'm just starting with TS so it can be user error. However, I found that you can download the typings in the IDE in Settings/Javascripts/Libraries and download... This is tedious to have to do this though. Note: doing this works with normal JS as well which is pretty cool.
Re:Announcing TypeScript 2.2 by jsight on Thursday February 23, 2017 @01:29AM (#13712073)
Strange, it seems to work fine for me. Find usages on the other hand is a totally random mess.
Re:Announcing TypeScript 2.2 by XaspR8d on Wednesday February 22, 2017 @02:13PM (#13708285)
For passersby who were confused like I was: IntelliJ Community Edition has absolutely no support for Javascript or Typescript, which is not noted clearly in the help docs. You apparently need Ultimate Edition to get it.

I was real excited that I could finally use the same IDE for front-end and back-end too... :/

Re:Announcing TypeScript 2.2 by rtpg on Wednesday February 22, 2017 @07:14PM (#13710507)
It's a bit of an investment if you're still a student, but if you're working full time as a programmer, the JetBrains IDEs are the highest bang for your buck.

Beyond the basic functionality working, the paid versions have a lot of cross-langauge support (PyCharm gets a huge chunk of the JetStorm functionality) which means that autocomplete "just works".

Like when I'm writing Angular templates, it looks up my custom directives and provides autocomplete on that. It is able to give autocomplete inside Angular expressions (down to looking up the controller and providing type information if you're using Typescript) inside my Django templates.

It's a lot of fuzzy searching but they have very good heuristics.

I think it would be near-impossible to get this cross-language support in Atom/Emacs, if only because it requires the I in IDE. Totally worth it.

Re:Announcing TypeScript 2.2 by yareally on Wednesday February 22, 2017 @07:40PM (#13710662)
> It's a bit of an investment if you're still a student

They have free licenses for students that includes all their products and a discount when you graduate. If you're making money off it, the license cost for intellij or just webstorm is pretty cheap.

https://www.jetbrains.com/student/

Re:Announcing TypeScript 2.2 by kakarot on Wednesday February 22, 2017 @02:37PM (#13708485)
The price gets lower each year for the first few years you renew your license.

My company pays for my license but I think it's hella worth it and I'd pay it on my own if I had to.

I avoid VS like the plague and I've never really felt at home in an IDE until I started using IntelliJ.

It's the only thing that was able to get me off of Notepad++

Re:Announcing TypeScript 2.2 by SquareWheel on Wednesday February 22, 2017 @03:13PM (#13708769)
I also avoid VS, but VSCode is nothing at all like its big brother. It's actually very quick and lean.

If you're interested in TypeScript at all, the two were made for each other. I'd suggest giving it a try.

Just note it's closer to a text editor with IDE functionality, rather than a full-blown IDE itself.

Re:Announcing TypeScript 2.2 by dotancohen on Thursday March 02, 2017 @03:55AM (#13772678)
> I also avoid VS, but VSCode is nothing at all like its big brother. It's actually very quick and lean.

VSCode is an Electron app, that means that it is written in Javascript and HTML5. Electron apps are notoriously resource intensive even though their UI is typically responsive. Watch your CPU usage spike and battery life plummet as you use Electron apps.

Even the Slack messaging client (another Electron app) can spike a CPU under certain circumstances. And that is a simple messaging client that doesn't have to parse and markup code like an IDE does.

Re:Announcing TypeScript 2.2 by kakarot on Wednesday February 22, 2017 @11:37PM (#13711675)
I can pretty much get that and more with Notepad++ or Sublime, though. I've moved back to vim for simple text editing, N++ for casual writing and organizing my thoughts. Is there any specific feature that makes it better than other editors in your book?
Re:Announcing TypeScript 2.2 by kwood on Thursday February 23, 2017 @03:30AM (#13712495)
Apart from Intellisense completion, a full featured integrated debugger, version control integration wich supports line wise staging, a diff viewer, a fast integrated terminal that even gets link detection in the next release, proper variable renaming and a working "Go to Definition" that is even implemented in most of the third party language plugins?

No. Pretty much the same as Notepad++.

Re:Announcing TypeScript 2.2 by kakarot on Thursday February 23, 2017 @10:01AM (#13714342)
IntelliJ has all of those things. I'm not sure you understood my question. I use Webstorm daily, I'm using it this very moment. I was asking about VSCode and where it falls between IntelliJ and N++.
Re:Announcing TypeScript 2.2 by kwood on Thursday February 23, 2017 @02:26PM (#13716894)
I understood the question – and that IntelliJ has all of those things is exactly the point I was trying to make.

You get most of the features from a heavyweight IDE, but they managed to get the architecture incredibly lightweight so you can use it as a "daily driver" editor as well.

It is snappy enough to quickly edit some configuration or Markdown files (with live preview and clickable links), it has text based configuration files, its easy to write plugins with a couple of lines of code – and all sorts of other things that previously could only be found on the "editor-side" of the spectrum (export VISUAL="code -w", anyone?).

Unique selling points are quite hard to find, most things where invented somewhere else. Its more the combination of things and walking the thin line between the text editor and IDE worlds.

Re:Announcing TypeScript 2.2 by kakarot on Thursday February 23, 2017 @03:36PM (#13717517)
Oh ok, I just didn't understand your answer. My apologies!
Re:Announcing TypeScript 2.2 by lenkite on Thursday February 23, 2017 @10:34AM (#13714673)
I also use WebStorm. But VScode is lightweight, starts up in two seconds and typescript support is always up2date with the latest typescript release. Changing user/language preferences in VSCode is a breeze as you simple open and edit the settings files with rich language support and intellisense. WebStorm requires you to open that horrible application modal Settings dialog. VSCode is also highly responsive compared to WebStorm which tends to lag a bit. I also like the quick info and peek features of visual studio code. However, there are folks who find this distracting.

WebStorm beats VSCode hands down in refactoring though.

Re:Announcing TypeScript 2.2 by kakarot on Thursday February 23, 2017 @03:41PM (#13717576)
Yeah Webstorm's got a killer refactoring engine.

When I first began using it the lag made it unusable. I'm talking up to 2000ms delay for visual feedback on my typing. Somehow that resolved itself over time though, and with my newer rig it's actually pretty damn snappy. It only takes about 15-20 seconds to spin up a virtual machine and launch Webstorm. I can't imagine how quick VSCode might be for me. I'll have to try it out tonight, everyone here has convinced me it's worth checking out.

Re:Announcing TypeScript 2.2 by rubber_duck on Thursday February 23, 2017 @08:20AM (#13713573)
VSCode is a lightweight IDE, despite them branding it as an editor, it understands project structure, has integrated debugging, task runners, GIT integration.

Honestly if I could get TFS integration on the level of GIT (for work, although ideally we would migrate to GIT) I would dump VS - it's bloated, when stuff fails you have no clue why or hope of fixing it, VSCode mostly wraps CLI tools so if the default integration fails you can work your way through it, unlike fucking TFS magic VS integrated tracking failing or whatever.

VS is still the only choice for .NET proper, but for .NET Core VSCode is usable enough and improving.

TS integration is the best I've seen, they are the first to support new TS features

Re:Announcing TypeScript 2.2 by jogjayr on Wednesday February 22, 2017 @08:32PM (#13710881)
Like other replies said, VS Code is nothing like VS.

I've been a dedicated Sublime Text user for years (wary of IDEs like you) but VS code kicks ST2/3's butt for Typescript development.

Re:Announcing TypeScript 2.2 by kakarot on Thursday February 23, 2017 @10:02AM (#13714353)
Thanks, I'll have to give it a shot!
Re:Announcing TypeScript 2.2 by radicalbyte on Wednesday February 22, 2017 @04:16PM (#13709235)
VS Code is like Sublime Text. Nothing like VS or Eclipse.
Re:Announcing TypeScript 2.2 by dotancohen on Thursday February 23, 2017 @02:46AM (#13712348)
>I was real excited that I could finally use the same IDE for front-end and back-end too... :/

And that editor has the absolute best VIM keybinding implementation of any popular IDE outside real VIM / NeoVIM. If you haven't looked yet, this is what finally got me out of the terminal for coding: https://plugins.jetbrains.com/idea/plugin/164-ideavim

Re:Announcing TypeScript 2.2 by Derander on Wednesday February 22, 2017 @01:34PM (#13707862)
That's odd. I work in a 100% typescript shop and about half the devs use intellij and webstorm full time without much trouble.

Jump to definition/auto import/implement interface/etc all work.

Re:Announcing TypeScript 2.2 by ken47 on Wednesday February 22, 2017 @01:36PM (#13707888)
I'll second that. I use an IDE from the Intellij family and things work fine.
Re:Announcing TypeScript 2.2 by lukaszjb on Wednesday February 22, 2017 @03:40PM (#13708952)
My proposition is out of the box but maybe get a chance to VSCode?
Re:Announcing TypeScript 2.2 by ng12 on Thursday February 23, 2017 @01:20AM (#13712038)
Moving a team of ~20 engineers from IJ to VSCode for a single technology is a nonstarter. IJ is still the preferred IDE for the backend and works perfect for everything we've used that's not Typescript.
Re:Announcing TypeScript 2.2 by pmoleri on Wednesday February 22, 2017 @09:00PM (#13711030)
In my team we used to be splitted between sublime/webstorm/atom, now we all are pretty happy with VS Code for typescript and javascript.
Re:Announcing TypeScript 2.2 by realharo on Wednesday February 22, 2017 @02:02PM (#13708190)
The inspections, autocomplete, and auto-import suggestions work great for me, but it doesn't seem to have that "show type on hover" functionality (not even Ctrl+hover, or quick documentation show it), that VSCode and even the online Monaco editor on http://www.typescriptlang.org/play/ have.
Re:Announcing TypeScript 2.2 by Qerub on Wednesday February 22, 2017 @03:53PM (#13709035)
Pressing the keyboard shortcut for the "expression type" command is not that cumbersome though (default: ctrl + shift + p).
Re:Announcing TypeScript 2.2 by realharo on Wednesday February 22, 2017 @04:36PM (#13709382)
That doesn't seem to show the same information as VSCode though. If you go to https://goo.gl/zteCbj and hover over the `x`, it will show type A. If you hover over `y` it will show either AB or B|null, depending on whether you have strictNullChecks enabled. IntelliJ also doesn't show any information for type aliases.
Re:Announcing TypeScript 2.2 by DCoder on Wednesday February 22, 2017 @01:43PM (#13707975)
IntelliJ Ultimate user here, writing and refactoring TS works quite well. There are some minor issues (e.g. sometimes it doesn't show the usual "this method is overridden in a child class" indicator), and refactoring likes to randomly modify somearray['foo'] when renaming a someclass.foo property, but I can live with that.
Re:Announcing TypeScript 2.2 by faceyspacey on Wednesday February 22, 2017 @04:35PM (#13709377)
How is Flow looking in webstorm? As good as their typescript support?
Re:Announcing TypeScript 2.2 by aurbano on Thursday February 23, 2017 @08:10AM (#13713520)
I've used both extensively in IntelliJ IDEA Ultimate. It's slightly harder to setup than TS, and it feels less mature - but it's very hard to explain why with concrete examples.

I did have to turn off code completion based on flow, because it slowed down the IDE noticeable (they do warn of this next to the setting...), but I hope that support will improve in the next versions, as flow gets more mature.

Re:Announcing TypeScript 2.2 by DCoder on Wednesday February 22, 2017 @11:48PM (#13711731)
I haven't tried Flow, so I can't say.
Re:Announcing TypeScript 2.2 by skrowl on Wednesday February 22, 2017 @06:03PM (#13710097)
Why do you want turn avoid Visual Studio out of curiosity? It's pretty great now.
Re:Announcing TypeScript 2.2 by neuronexmachina on Wednesday February 22, 2017 @06:07PM (#13710126)
I was about to say "Visual Studio doesn't work in Linux," but apparently it (or at least Visual Studio Code) actually does now. Living in the future is weird.
Re:Announcing TypeScript 2.2 by positr0n on Wednesday February 22, 2017 @09:15PM (#13711093)
FYI VSCode has always been an electron app, and thus always worked on all platforms.

Visual Studio on the other hand is a gigantic IDE that only runs on Windows.

Re:Announcing TypeScript 2.2 by philliphaydon on Wednesday February 22, 2017 @08:11PM (#13710800)
When did VSCode not work for linux???? I'm confused...
Re:Announcing TypeScript 2.2 by ng12 on Wednesday February 22, 2017 @08:39PM (#13710916)
Team's standardized on IntelliJ so everyone already has Ultimate. It works great for everything not-Typescript.