R#6.0 EAP: JS feedback
First of all - happy New Year and Christmas to everyone, and big thanks to Resharper team for their attention to javascript support in R#. I've been dreaming/waiting for it for a very long time.
Secondly, if there is a link to the js support roadmap, or some useful youtrack issue search string - please provide it for future reference.
Maybe that's a bit too early but I decided to provide some feedback on the js support.
0. Long live Ctrl - Left click - can't say that it works all the time but it works!!! Same applies to Find Usages, renames
1. code completion is extremely slow and useless - i've been waiting for VS to unfreeze for about 1-3 mins after I pressed ctrl-space (and btw - there were no R# exceptions caught). Results shown were weird. (Try adding jquery into project and typing "$." somewhere)
2. Minor things that i noticed:
- no TODO, TASK detection in js file
- no snippets for vs style annotation comments: try typing "///" on the line after function declaration - nothing happens
- Alt-Ins shows completely disabled menu
3. Features that are not there or i completely missed them:
- "references": something like VS built in "/// <reference path="../jquery-1.4.2.js" />" comment detection + wildcards. It would be really great if only files mentioned in these refernces will be used for code completion / navigation. + probably some default references/usings.
- js object navigation
- annotation support: vsdoc and/or jsdoc
- solution wide analysis
- context menu shortcuts
- quick refactorings (invert If. etc.) / refactorings (extract function, etc.) / code inspections (parseInt - should always have radix specified, etc.)
- jquery support - maybe as a plugin?
Once again please provide some link/info that will at least highlight R# 6 javascript support feature scope.
Best Regards,
Sergei
Please sign in to leave a comment.
Hi, Sergei!
Thank you for your feedback.In recent builds I've fixed some of the issues that you've described. Code completion is now much faster and TODO explorer recognizes comments in JS files.
I've also implemented a limited support for XML doc comments (highlightings and extracting method signatures information for code completion)'///' code snippet is on my list now. The same applies to Quick refactorings and simple code inspections, go to type/symbol (currently we only have 'go to file memeber')There is no published list of planned JS features. It's the first dynamic language in R# and many features need re-thinking.We don't plan to support jQuery as a language in 6.0. Probably we'll come up with support for jQuery plugins ($.extend(..), $.fn.Xxx = ...).Which solution wide inspections are you interested in? Only 'Globally unused js symbols' code to my mind...What is 'context menu shortcuts'?Thanks again, I really appreciate your contribution to JS support in R#!
Hi Sergey!
Thank you for your reply.
>In recent builds I've fixed some of the issues that you've described. Code completion is now much faster and TODO explorer recognizes comments in JS files.
For some reason latest build available at the moment(6.0.2074.27) does not recognise TODO's yet, but i suppose next one will. Code completion is fast though - thanks.
>I've also implemented a limited support for XML doc comments (highlightings and extracting method signatures information for code completion)
My main concern about XML-doc's is support for VS-studio like javascript usings:
>> "references": something like VS built in "/// <reference path="../jquery-1.4.2.js" />" comment + wildcards.
>> It would be really great if only files mentioned in these refernces will be used for code completion / navigation.
>There is no published list of planned JS features. It's the first dynamic language in R# and many features need re-thinking.
Maybe its worth having an open list?
>Which solution wide inspections are you interested in? Only 'Globally unused js symbols' code to my mind...
Currently we are using http://jslint4vs2010.codeplex.com/ to have compile-time javascript validation, and closure-compiler as a continious integration linter.
Closure compiler checks all of our javascript as one (concatenates js files and then checks) and here are some of the errors that were found with its help:
1) Globally unused js symbols
2) redefined classes / global variables - this might be really useful in case project has several js files that have global variables with conflicting names.
I.e.:
File1.js : ...; window.$ = 'string'; ...
File2.js : ...; window.$ = jQuery; ...
In case if these files will be used together on one page there will be a bug.
3) Globals used only in local scope
I.e.:
File.js : window.myFlag = 1; function Owerflow() { window.myFlag++; return window.myFlag > 10; }
(window.myFlag is never used again)
Also it would be great if there will be a separate group of js errors in all files in the "Errors in solution" window.
BTW: if i remember correctly WebStorm might have some solution-wide checks for javascript - its developers might share some ideas as well?
>What is 'context menu shortcuts'?
Right-mouse click menu options. I.e. for C# there is a Refactor submenu.
Regards, Sergei
Has been asked by one of my colleagues to add this to the wanted list:
support of "#regions" directives in javascript.
and optionally
support of "#warning" directives in javascript.
support of "#error" directives in javascript.
IMHO it makes sense for those .net developers who use them.
EDIT:
detection of redundant js includes might be useful as well:
I.e. currently it is possible to have sth like
<script type="text/javascript" src="~/Scripts/jquery.autocomplete.js"></script>
<script type="text/javascript" src="~/Scripts/jquery.autocomplete.js"></script>
without any notification that the second line is redundant. Optionally one of the script files might already be included into masterpage - probablyl it should be detected too unless masterpage is set dynamically?
Best Regards,
Sergei