找到你要的答案

Q:Which editor and debugger for typescript

Q:编辑和调试记录

I am working on a nodejs project in which all code is written in typescript. It follows a microservice pattern (and each microservice is an independent project) hence lot of projects needs to be opened and debugged at the same time.

I tried webstorm and visual studio (with NTVS) but not satisified with both of them. Webstorm ignores many build errors (very important as those will fail during CI) and not as good as visual studio in intellisense and ease of use. On the other hand, Visualstudio is not as fast as I want. Also I am tied to windows and the filename length problem in node_modules is very frequent and annoying.

Others (atom, VSCode) doesn't have typescript debug support (or am I missing something?).

Can you please share your experience? Also I was wondering which editor google developers might be using to develop angular 2 :)

我工作在一个项目中的所有代码是Nodejs写的打字稿。它遵循一个市微服模式(每市微服是一个独立的项目)因此,很多项目都需要打开和调试的同时。

我试着webstorm和Visual Studio(与NTVs)但不满意都。Webstorm忽略了许多生成错误(非常重要,那些将失败在CI)而不是在智能和易于使用的Visual Studio为好。另一方面,Visualstudio是不是我想要的那样快。我也与Windows和node_modules文件名长度问题是很频繁的,讨厌的。

人(原子、VSCode)没有记录调试支持(还是我错过了什么?)。

你能分享你的经验吗?我还想知道谷歌开发人员可能使用哪一个编辑器开发角2:)

answer1: 回答1:

I have been working on a TypeScript project for 1.5 years now and am quite happy with using Visual Studio because we used .NET for back-end stuffs. For myself I consider the speed as "Ok", it is not that good - but the other stuffs e.g. intellisense is what we really like. I also personally think that as a "son" of Microsoft, TypeScript will get the best support from its "cousin" - Visual Studio.

However if you are a Eclipse person, you may be interested in this TypEcs (http://typecsdev.com/). There was also a post by Steve Fenton talking about TypeScript IDEs you may be interested (https://www.stevefenton.co.uk/Content/Blog/Date/201409/Blog/Which-TypeScript-IDE/), he listed a few of the popular ones with a few sentences of comments, including Atom and the atom-typescript extension.

我一直在打字项目工作1.5年了,我很高兴因为我们使用Visual Studio .NET后端的东西。我为自己考虑的速度为“OK”,它不是很好,但其他东西如智能感知是我们真正喜欢的。我个人认为作为一个“儿子”的微软,TypeScript将得到最好的支持,从“表哥”视觉工作室。

但是如果你是一个Eclipse的人,你可能在这个TypEcs的兴趣(HTTP:/ / typecsdev .com /)。也有由Steve Fenton谈论TypeScript IDEs你可能感兴趣的文章(https://www.stevefenton网站/内容/博客/日期/ 201409 /博客/打字IDE /),他列出了一些用几句话评论流行的,包括原子和原子能延伸。

answer2: 回答2:

Not a recommendation, but I suggest you do not buy JetBrains' products (IntelliJ/WebStorm/ReSharper) for TypeScript editing unless you have evaluated them properly.

They reused a lot of their own logic for other languages instead of taking full benefit of the TypeScript language service, which means they behave more like a fancy JavaScript editor that can make some clever guesses as opposed to a robust IDE for a statically typed langauge. (Their type inference is different from the compiler and may fool you into believing an untyped expression (implicit any) is well-typed. Also, all the refactoring are the same as the JS ones, so they do not use or preserve any type information. No type-information-based refactoring (like safe renaming and moving) are available either.)

As for debugging, you may have more milage debugging the generated JS. Not only is it well supported, it also reveals problems that occur in compiler-inserted code. The latter would be otherwise difficult to understand if you're only looking at the TypeScript source. Also, in the generated code, you can actually set break points in single line lambda function bodies.

不推荐,但是我建议你不要买JetBrains的产品(IntelliJ / webstorm / ReSharper)为打字稿编辑除非你有适当的评价。

他们用了很多自己的逻辑,而不是以其他语言的打字稿语言服务充分受益,这意味着他们的行为更像是一个幻想的JavaScript编辑器,可以让一些聪明的猜测而不是一个强大的IDE为静态类型语言。(他们的类型推断是不同的编译器可能愚弄你认为非类型化的表达(隐有)是类型。另外,所有的重构是JS一样,所以他们不使用或保存任何类型信息。没有类型信息的重构(如安全重命名和移动)可供选择。)

对于调试,你可能有更多的里程调试生成JS。它不仅得到了良好的支持,还揭示了编译器插入代码中出现的问题。后者,否则将难以理解,如果你只看打印稿源。同时,在生成的代码中,你可以在单线lambda函数体中设置断点。

answer3: 回答3:

VSCode can debug in Node. No browser debugging yet.

vscode可以调试节点。没有浏览器调试。

answer4: 回答4:

A bit late to the conversation.

I recently tried VisualStudio 2015, VisualStudio Code 0.9, Atom (with Atom-Typescript package). And quite comfortable with Atom.

Atom-TypeScript uses the latest version of TypeScript so you can use all new features like async/await, string interpolation etc. The package created by community so we don't need to wait for major IDE release to use new TypeScript features.

For debugging couldn't find one. But love to use node-inspector for its light weight. The problem is you need to debug it in javascript version not in typescript version. Not so sure but maybe if you can provide map file you can debug the typescript version? like we have on Google Chrome Inspector.

谈话有点晚了。

我最近试了Visual Studio 2015,Visual Studio代码0.9,原子(Atom Typescript包)。和原子相当舒服。

Atom TypeScript用打字稿的最新版本,你可以使用所有的新功能,如异步/等待,字符串插值等包创建社区,我们不需要等待主要IDE发布使用新的打字稿的特点。

调试找不到一个。但爱使用节点督察其重量轻。问题是你需要调试JavaScript的版本不在打字版。不太确定但也许可以提供地图文件可以调试文件的版本吗?像我们在谷歌浏览器督察。

answer5: 回答5:

I too use Visual Studio. I haven't had any problem with its speed; I find everything is as immediate as I expect it too.

However, I haven't been using "TypeScript" projects. I have been using generic "Web" projects with TypeScript files. Plus, I don't use Visual Studio's own building and compilation facilities; I use my own Gulp tasks for my project (including rebuilding, watching for saves, minification, testing, etc), and Task Runner Explorer to manage/run them from inside Visual Studio. I think it's the best of both worlds: the snappiness and features of Visual Studio, and the flexibility of running my own custom tasks independent of platform.

I have to admit I don't do any deep debugging (e.g. breakpoints, stepping) from the IDE. Does VS do that with TypeScript? If I catch an error during execution (in the browser), I always have my source maps indicating where the error is, so I go back to the code, attempt to fix it, save, and reload in the browser.

我也使用Visual Studio。我对它的速度没有任何问题,我发现一切都和我预料的一样快。

然而,我还没有使用“记录”项目。我一直在使用通用的“网络”项目,记录文件。另外,我不使用Visual Studio的自身建设和编制设施;我用我自己的吞咽任务我的项目(包括改建、看节约,缩小,测试,等等),和任务管理器来管理/转轮运行它在Visual Studio。我认为这是两全其美的:和Visual Studio的特点和运行自己的自定义任务独立于平台的灵活性。

我不得不承认,我没有做任何深入的调试(如断点,步进)从IDE。并对做的,TypeScript?如果在执行过程中(在浏览器中)出现错误,我总是有我的源代码图,指示错误在哪里,所以我回到代码,试图修复它,保存并在浏览器中重新加载。

answer6: 回答6:

I am using VSCode to actively debug an angular/node/typescript application. It does work, but you will need to do some setup/configuration. You must tell VSCode how to debug your applications. For instance I have multiple options in my launch.json configuration to debug my gulp scripts, my node server.js file, and the angular/typescript application via chrome using the "Debugger for Chrome" extension installed in VSCode. It is all possible with some configuration. Finally, depending on your exact situation you may need to have and correctly configure the map files for your project from javascript to typescript.

I also had the problem of file paths too long in the node_modules folder in visual studio when opening a project with npm. This is due to Visual Studio trying to download all your packages - incorrectly so I might add. The only way to avoid this for my project was to mark the node_modules folder as a hidden folder in windows (top level only).

我用的是VSCode积极调试角/节点/打字稿中的应用。它确实工作,但你需要做一些设置/配置。你必须告诉vscode如何调试你的应用程序。例如,我在我的launch.json配置多个选项来调试我大口的脚本,我结server.js文件,和角/打字的应用程序通过使用“调试器Chrome”安装在VSCode推广Chrome。这是所有可能的一些配置。最后,根据您的具体情况,你可能需要和你的项目从JavaScript文件的正确配置映射文件。

我也曾在Visual Studio中打开项目时与故宫太长的node_modules文件夹文件路径的问题。这是由于Visual Studio试图下载所有的包-不正确的,所以我可能会添加。为了避免这种对我的项目的唯一方式是为了纪念node_modules文件夹在Windows隐藏文件夹(最高水平)。

debugging  ide  typescript