visual-studio Visual Studio 有没有好的 javascript 插件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1627194/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a good javascript plugin for visual studio?
提问by littlechris
I think that Visual Studio's biggest let down is the Javascript editor. I have been told to use Aptana as an editor for my javascript files, but I would prefer to stick with visual studio if possible.
我认为 Visual Studio 最大的缺点是 Javascript 编辑器。有人告诉我使用 Aptana 作为我的 javascript 文件的编辑器,但如果可能的话,我更愿意坚持使用 Visual Studio。
I have read other similar plugin posts, but none focus specifically on Javascript.
我读过其他类似的插件帖子,但没有一个专门针对 Javascript。
VS2010 may offer some improvements, but will they be up to Apatana standards? I have briefly tested the beta, but I'm not overly impressed.
VS2010 可能会提供一些改进,但它们是否符合 Apatana 标准?我已经对 Beta 版进行了简短的测试,但并没有给我留下太深刻的印象。
Is there anything out there that will bring Javascript closer to c# development? Considering the wide spread use of Javascript I think there must be something....... I hope! :)
有没有什么东西可以让 Javascript 更接近 c# 开发?考虑到 Javascript 的广泛使用,我认为一定有什么东西......我希望!:)
Many thanks in advance... this is something that has always bugged me!
提前非常感谢......这是一直困扰着我的事情!
采纳答案by FinnNk
VS is a pretty good IDE (especially when coupled with Resharper) but not so hot with Javascript. The debugger is good and there's the JSLint pluginbut other than that I'm not sure. Aptana (based on Eclipse) is an excellent javascript IDE but it doesn't like it much when the javascript is embedded in aspx files (unless they updated the support recently). So far I'm not sure there's an ideal .net platform IDE for both client and server side stuff just yet.
VS 是一个相当不错的 IDE(尤其是与 Resharper 结合使用时),但与 Javascript 并没有那么热。调试器很好,还有JSLint 插件,但除此之外我不确定。Aptana(基于 Eclipse)是一个优秀的 javascript IDE,但是当 javascript 嵌入到 aspx 文件中时它不太喜欢它(除非他们最近更新了支持)。到目前为止,我不确定是否有适用于客户端和服务器端内容的理想 .net 平台 IDE。
Update: Resharper 6 added pretty good JavaScript support - so now I'd recommend that combination if you're doing a lot of debugging across client and server at the same time. If you're focussing on pure client code then I find WebStorm to be an excellent JavaScript/HTML IDE - even better than Aptana.
更新:Resharper 6 添加了非常好的 JavaScript 支持 - 所以现在如果你同时在客户端和服务器上进行大量调试,我建议你使用这种组合。如果您专注于纯客户端代码,那么我发现 WebStorm 是一个出色的 JavaScript/HTML IDE - 甚至比 Aptana 更好。
回答by Simon_Weaver
There's a couple recent plugins that may be helpful :
最近有几个插件可能会有所帮助:
From Microsoft :
来自微软:
- Brace Matching
- Outlining / Cold-folding
- Current Word Highlighting
- IntelliSense Doc-Comments Support
- 大括号匹配
- 轮廓/冷折叠
- 当前单词突出显示
- IntelliSense 文档注释支持
- Outlining and matching braces highlighting
- 大纲和匹配大括号突出显示
(I wouldn't think installing both of these is a good idea - and the Microsoft plugin has more features so try that one first)
(我不认为安装这两个是一个好主意-Microsoft 插件具有更多功能,因此请先尝试一个)
回答by Christian
I'd really like to recommend Webstorm. It does not! treat your JS as text files.
我真的很想推荐Webstorm。它不是!将您的 JS 视为文本文件。
Its a full blown JS editor and has become my favourite JS editor working in parallel with VS to handle my server side stuff.
它是一个成熟的 JS 编辑器,并且已经成为我最喜欢的 JS 编辑器,它与 VS 并行处理我的服务器端内容。
WS has actual object intellisense across JS files. That means when I press . (dot) it shows me the functions on that objects, even if its located physically in another file.
It will recognize my objects (or their type if you will) created in other JS files referred to in the file I'm working on.
I have 'Find usages' on JS functions
I have 'find all references' on JS object / function / class / variable or whatever you want to search on. In the end its all objects but Webstorm knows this.
If I change the short/cut to F12, I can press F12 on my function call and it will jump to the implementation of that JS functon. Even if its located in another file.
Ofc. you have code folding and colouring, extract method and other neat code re factoring, overview creating tools.
WS 具有跨 JS 文件的实际对象智能感知。这意味着当我按下 . (点)它向我展示了该对象的功能,即使它物理上位于另一个文件中。
它会识别我在我正在处理的文件中引用的其他 JS 文件中创建的对象(或它们的类型,如果你愿意的话)。
我在 JS 函数上有“查找用法”
我在 JS 对象/函数/类/变量或任何你想搜索的东西上“找到所有引用”。最后它的所有对象,但 Webstorm 知道这一点。
如果我将快捷方式/快捷方式更改为 F12,我可以在我的函数调用上按 F12,它会跳转到该 JS 函数的实现。即使它位于另一个文件中。
办公室 你有代码折叠和着色、提取方法和其他整洁的代码重构、概述创建工具。
Oh. And by the way. I'd like to kill off a rumour going around in the cloud on forums I come across from time to time, looking for better ways to handle JS.
哦。顺便说一下。我想在我不时遇到的论坛上消除在云中传播的谣言,寻找更好的方法来处理 JS。
reSharper DO NOT SUPPORT JAVASCRIPT! A little piece of me dies every time I read some guy repeating what he saw on the reSharper site. It may have a some poor intellisense and some low level syntax check, but that has nothing to do with support. Notepad++ supports JS better than VS in my opinion.
reSharper 不支持 JAVASCRIPT!每当我读到有人重复他在 reSharper 网站上看到的内容时,我的一小部分就会死去。它可能有一些糟糕的智能感知和一些低级别的语法检查,但这与支持无关。Notepad++ 在我看来比 VS 更好地支持 JS。
Münster
明斯特
回答by Darthg8r
Don't forget to grab Chirpy to handle minifying your scripts in VS.
不要忘记抓住 Chirpy 来处理在 VS 中缩小你的脚本。
回答by BornToCode
If you use Visual Studio, add the
如果您使用 Visual Studio,请添加
/// <reference path="myOtherJsFile.js" />
directive at top of your js files and install Web Essentialsyou get pretty decent (but not perfect) intellisense, go to definition by using F12and find all references (sort of..) by using SHIFT+F12
指令在您的 js 文件顶部并安装Web Essentials,您将获得相当不错(但不完美)的智能感知,通过使用转到定义F12并使用SHIFT+查找所有引用(有点……)F12

