How to get basic Visual Studio features for javascript (VS 2010) - javascript

I'm looking for a good way to add a couple capabilities to VS 2010's javascript intellisense that are working properly for C#. Specifically, I want to:
reliably refactor javascript code
go to the function definition (F12 for me) and
check for all uses of a function or item (Shift + F12 for me).
I'm aware of Refactor! and Visual Assist X, but I haven't found any comment on how well the features they advertise are supported in javascript. Most of the features they advertise seem to be based on languages that are much less dynamic.
So, I ask:
Any comment on the plugins mentioned above?
Are there any other good plugins that add these features (or most of them) to VS 2010?
Are there any IDE's that approach this feature set?

ReSharper 6 has great support for JavaScript.
It does include features like:
Refactoring (it's not 100% reliable since it's not possible with JavaScript, but it's really good at it)
Go to definition
Find usages
On the downside, it's a little expensive; but, as far as I'm concerned, it's worth the price.

Related

JS code obfuscation in netbean [duplicate]

Are there any known Plugins or ways to properly autoformat Javascript in Netbeans IDE?
EDIT 9/15/2012
After looking into this further, I have found that the javascript module is being rewritten already(much needed). You can finally find formatting options for javascript. It's available in the netbeans nightly builds. Good luck all.
http://bits.netbeans.org/download/trunk/nightly/
I have released a pretty simple JS formatter that uses JSBeautify and runs in Rhino.
http://plugins.netbeans.org/plugin/43263/jsbeautify
You have to use an alternate key for now. I'm working on modifying the Javascript language in Netbeans to possibly release something better, later on(either as a plugin or patch). I'm still familiarizing myself with the way things are happening in Netbeans.
There have been talks for years to add more formatting options for Javascript in Netbeans. Nothing has surfaced. I'm going to propose that the Javascript language leverage JSBeautify(running in Rhino) to provide formatting, rather then implementing new features in Java. This simplifies the formatting process, plus the JSBeautify community is very large and it's actively developed.

QuickCheck for Javascript

Is there a version of quickcheck that works for Javascript and that is well maintained? I have found several such as check.js and claire, but none of them seem to support shrinking of failing test cases, which has always struck me as the most useful part of the whole problem.
I'm creator of jsverify. I'll try constantly to make it better, bug reports and feature requests are welcomed.
There are also a list of other javascript generative testing libraries in a readme. So far I haven't found any other good alternative to the jsverify.
I recently released https://github.com/dubzzz/fast-check
I built it in order to answer several limitations I encountered in the existing quickcheck implementations in JavaScript.
It comes natively with a shrink feature which can shrink even combination of arbitraries (the frameworks I tried were failing on oneof like arbitraries).
It also can generate large objects and arrays.
By default it tends to try smaller values first in order to detect trivial edge cases while it covers all the possible inputs in next runs.
Lots of other features are on-going or already available :)
Cheers,
Nicolas
I wrote quick_check.js, which has a nice library of generators. Shrinking is not there yet, but is planned.
There seems to be a dearth of good quickcheck-like testing tools in javascript. However they are to be better supported in typed languages, and in fact you can write your tests in one of those languages if you wish.
To avoid dealing with runtime interop, I'd recommend going with a language which compiles to JS and runs on node.js (eg: Purescript with purescript-quickcheck), or a java-based language using the Nashorn engine provided in Java 8, for example ScalaCheck. You could even use ghcjs and the original flavor of the quickcheck library!

Which Tools are there for Code Comparison or Side by Side Comparing? How to Find Bugs in Javascript?

Though 99% of the code on our site is the work of 1 programmer, recently for the first time (and probably last) a programmer was hired to work on our site, he was given remote access to log in via ftp.
Background: He is located in a continent unknown to us, speaks a mothertongue that I cannot guesse from the English mails, and works in ways that are bit different than ours. It seems, this common workflow in long distant small projects where the original programmer is essential to update/customise their code.
Problem: The genius writes like a hacker, good quality but very poorly documented, some bugs occuring here or there. Now we are stuck with almost brilliant code with some bugs. Its Javascript mainly.
Question: First of all 1. What ways/utilities/websites are there to find bugs in freshly delivered JavaScript code, when its difficult to understand parts of thes code to begin with? 2. What are good code comparison programs/utilities/websites sothat one can vew in parallel side by side comparison differences between two versions of code?
Obviously both are very related so hopefully there is one great tool on this planet that aims to combine bug finding as well as shows you the differences between versions.
Any suggestions are good answers to me as I have no clue where to start from here.
I agree with the posts above, Firebug for Firefox and Google Chrome/Chromium's Web Developer tools are great for most JavaScript debugging purposes. IE8 has an o-k set of Developer Tools. I'd only recommend using them if you're having issues in IE-only, otherwise, the previously mentioned tools will perform much, much better. If you really want to run the JavaScript through the error-checking and code-quality gauntlet, take a look at Douglas Crockford's JSLint.
It's also worth mentioning community-driven JSHint as a resource for testing JavaScript code. It's not as strict as JSLint and has better support for commonly-used JavaScript libraries.
The Windows applications listed above should work great for comparing files. If you're on OS X though, Kaleidoscope is a wonderful comparison app. It costs a little money, but it integrates very nicely with most versioning systems.
I agrre with #BiAiB, about the need for a code management/versioning tool - this will save you hours of heartache.
Another excellent file comparison tool is Beyond Compare - it truly is worth every penny that it costs (which is not much)
Probably the best tool to help in the discovery of what is happening in your JavaScript code is Firebug, a plug-in to Firefox. Google Chrome and IE have similar functionality, although each solution may lack feature (or have extra features) that the others don't.
And, I agree with everybody else - you need source control in a big way.
For file comparison tools, there is also the excellent and free WinMerge
Eclipse can do compare.
JsTestDriver is a wonderful testing tool.
But you will need to write unit tests for it.
A great tool is using firebug and the Webdeveloper toolbar plugins for mozilla firefox.

JavaScript Plug In for Visual Studio?

I am working on an ASP.NET project, and it is very frustrating how poor the support for JavaScript is in VS. For example, no outlining, no f12 to find a definition, no refactoring, no code analysis, no ready support for documenting functions, horrible navigation and barely functional intelisense.
Although JavaScript is no doubt an intractable language, it is clearly possible to do these things: many PHP/Python/Java toolsets have much better support.
I was wondering if there is a decent plug in for JavaScript in VS? Does everyone just suffer in silence, or am I missing something? I find the contrast between working in the C# side, which has awesome tools, to the JavaScript side which has tools with 1990s functionality quite disconcerting.
I'm looking forward (it's not available as yet) to the JavaScript support in ReSharper 6: http://blogs.jetbrains.com/dotnet/2010/09/resharper-6-javascript-css-support-coming-up/
This one is pretty good too ..
http://code.google.com/p/js-addin

JavaScript tools for Visual Studio 2005

I need to find if there are any tools targeting both Visual Studio 2005 and JavaScript. I'm interested in plugins which will increase the quality of work done in VS2005 with JavaScript oriented development.
I think you'll be hard pressed to find anything specific for VS2005, since it is a dev environment and JS is a client technology. However, a couple of ideas you might want to consider:
jQuery. The recent availability of Intellisense for jQuery (although I think it is only for VS2008) helps your quality of work in the sense that you don't have to spend so much time looking back and forth at documentation, although I would say that is the best way to really become familiar with it anyway. There are several other good JS libraries out there, but (a) I don't think that was the point of your question, and (b) jQuery is the only one "semi-officially" supported in VS that I'm aware of.
Script#. Although I haven't used it, it looks interesting... basically you program in C#, and it gets translated to JS at runtime.
If you could afford it, I'll recommend upgrading to Visual Studio 2008. You can open .NET 2.0 application without converting them. It comes with much better Javascript Intellisense.
(source: scottgu.com)
One of the other JavaScript features in VS 2008 is the much-improved support for JavaScript debugging.
These features are enabled in both the free Visual Web Developer 2008 Express edition as well as in Visual Studio, and makes using JavaScript and building AJAX applications significantly easier.
If you are using jQuery in your applications, then you could install jQuery Intellisense in VS 2008.
Well, if you want something that will help you write better Javascript in Visual Studio then you can give JSLint a try. It's a plugin that will verify your Javascript code, spot errors, and help you debug it.
Beware, JSLint can hurt feelings.

Categories