ãã®ç¹ã§ã ReSharper 9ã®ã¢ãŒãªãŒã¢ã¯ã»ã¹ããã°ã©ã ã«åå ããããã«å šå¡ãæåŸ ããŸãããã®æçš¿ã§ã¯ãæ°ããããŒãžã§ã³ã®äž»ãªæ©èœã«ã€ããŠèª¬æããŸãã
TL; ReSharper 9ã®DRã¯VS "14"ãCïŒ6ããã³æ£èŠè¡šçŸã®ãµããŒããè¿œå ããJS / TSããã³ã°ããŒãã«å€æŽïŒãã«ã¯ä¿®æ£ïŒã®ãµããŒããæ¹åããã³ãŒããšæ°ããããã²ãŒã·ã§ã³æ©èœããã©ãŒãããããããã®æ°ãããšãã£ã¿ãŒãããã³ãã¹ãŠã®.NET補åãè¿œå ããŸããæ°ããå ±éãã©ãããã©ãŒã ãžã®ç§»è¡ã
CïŒ6ãµããŒã
CïŒ6ãµããŒãã«é¢ããã¬ãã¥ãŒããã°æçš¿ãæ¢ã«å ¬éããŠããã®ã§ãReSharper 9ãçŸåšãµããŒãããŠãããã®ã®ãªã¹ãã瀺ããŸãïŒCïŒ6ã¯ãŸã ãªãªãŒã¹ãããŠããããæçµçãªæ©èœã»ããã¯ä»ã®ãšããæšæž¬ããã®ãé£ããããšãèŠããŠããŸãïŒïŒ
- æ¡ä»¶ä»ãã¢ã¯ã»ã¹æŒç®åïŒïŒãïŒã®ãµããŒãã«ããããã§ãŒã³nullãã§ãã¯ïŒMaybeã¢ãããšãåŒã°ããŸãïŒãèšè¿°ã§ããŸãã ReSharperã¯ãã®æ°ããèšèšã«ç²ŸéããŠããã ãã§ãªããäžèŠãªãã§ãã¯ã
null
眮ãæãããåé€ãããããããšã§ãã³ãŒããç°¡åã«æŽæ°ããã®ã«ã圹ç«ã¡ãŸãã
- åŒã䜿çšããŠèšè¿°ãããã¯ã©ã¹ã¡ã³ãïŒåŒã®å®äœãæã€ã¡ã³ãïŒã®ãµããŒãã«ãã ãåçŽãªåäžè¡ã®åŒã«åºã¥ããŠèŠçŽ ãäœæããããã»ã¹ãç°¡çŽ åãããŸãã Resharperã¯ããã®æ°ããã³ã³ã¹ãã©ã¯ãã䜿çšããæ©äŒãæäŸãããã®æ°ãããã©ãã€ã ã«ç
§ãããŠããã§ã«èšè¿°ãããã³ãŒãã®å€§ããªãã£ã³ã¯ã®å€æã«ã圹ç«ã¡ãŸãã
- èªåããããã£ã¯ãåæåã®æ°ããæ©äŒãšããã©ã€ããŒãã»ãã¿ãŒãèªåçã«åé€ããæ©èœãåãåããããã«ãã£ãŠæ¬åœã«äžå®å®ãªèªåããããã£ãåãåããŸãã
- s
using
ããéç ïŒMath.Sin
代ããã«æçµçã«Sin
ãèšè¿°ã§ããŸãïŒã äŸå€ã®ãã£ã«ã¿ãŒãããã³ãã®ä»ã®æ°ããCïŒ6æ§é ã®ãµããŒãã
ã°ããŒãã«ã¢ã¯ã·ã§ã³ãšã¹ã³ãŒãå ã®ä¿®æ£
ReSharper 9ã¯ã°ããŒãã«ãªå€æŽïŒ ã¹ã³ãŒãå ã®ä¿®æ£ ïŒã®ã¡ã«ããºã ãæ¡åŒµããŠããããã倧éã®ã³ãŒãã«å¯Ÿããå€§å¹ ãªå€æŽããŸããŸãç°¡åã«ãªããŸãã æ¹åç¹ã¯æ¬¡ã®ãšããã§ãã
- ãã«ã¯ã€ã³ããŒãïŒãã«ã¯ã€ã³ããŒãã¡ã«ããºã ïŒã¯ãReSharperãã³ãŒãã®å€§ããªéšåãã€ã³ããŒãããããšã«ãããæ¿å
¥ãããã³ãŒãã調ã¹ãæ¡åŒµã¡ãœãããå«ããã¹ãŠã®ã¿ã€ããšèŠçŽ ã«å¿
èŠãªã€ã³ããŒããã£ã¬ã¯ãã£ããè¿œå ããããšãä¿èšŒããŸãã
- åé·ã³ãŒãã®åé€ã¯å¥ã®ãªãã·ã§ã³ãšããŠååšãããããã«ãŒãœã«ãäœåãª
this.
修食åã«çœ®ããå Žåthis.
ããã®å Žæãããã®ä¿®é£Ÿåãåé€ã§ããŸãthis.
ã°ããŒãã«ã«ïŒãã¡ã€ã«/ãã©ã«ããŒ/ãããžã§ã¯ã/ãœãªã¥ãŒã·ã§ã³å ã§ïŒãåæ§ã®ç¯å²ã®ã¢ããªã±ãŒã·ã§ã³ã§ãã¹ãŠã®äžèŠãªèŠçŽ ïŒããã ãã§ãªãthis.
äžèŠãªusing
ãã£ã¬ã¯ãã£ããªã©ïŒãåé€ããŸãã
- ååã®ã°ããŒãã«ãªå€æŽã«ãããä»ã®äººã®ã³ãŒãããã°ããã€ã³ããŒãããã¡ãœããããã£ãŒã«ããªã©ã®åœåã¹ã¿ã€ã«ã倧å¹
ã«å€æŽã§ããŸãã ããªãã®å¥œã¿ã«ã
- ãã¡ã€ã«/ããŒã ã¹ããŒã¹ãžã®ç§»åïŒã³ãŒããå¥ã®ãã¡ã€ã«ãŸãã¯ããŒã ã¹ããŒã¹ã«ç§»åããã¡ã«ããºã ïŒã«ãããè€æ°ã®ã¯ã©ã¹å®£èšãå«ããã¡ã€ã«ã®æ£ããåŠçãä¿èšŒãããããã«ãªããŸããã
- ãªãŒãžã§ã³ã®åé€ã¯ããã¡ã€ã«ããããžã§ã¯ãããŸãã¯ãœãªã¥ãŒã·ã§ã³ã䜿çšããŠãã¹ãŠã®ãªãŒãžã§ã³ãåé€ã§ããããã«ãããã1ã€ã®ã°ããŒãã«ã¢ã¯ã·ã§ã³ã§ãã
ããã²ãŒã·ã§ã³ã®æ¹å
ããã²ãŒã·ã§ã³ã®å€æŽã¯æ¬¡ã®ãšããã§ãã
- Universal Go to Action-ã·ã§ãŒãã«ããAlt + Enterã«ãããäžè¬çãªã¢ã¯ã·ã§ã³ã®ãªã¹ããšããã¹ãŠã®ã¢ã¯ã·ã§ã³ãæ€çŽ¢ããæ©èœãæäŸãããããã«ãªããŸããã
- Exposing API-ç¹å®ã®ã¿ã€ããè¿ãããšãã§ãããã¹ãŠã®ã¡ãœãããæ€çŽ¢ã§ããæ°ããããã²ãŒã·ã§ã³ãªãã·ã§ã³ã«ç§»åããŸãã
- Assembly Explorer㯠ãResharperãšããã«å¯æ¥ã«çµ±åãããŸããã 圌ã¯ã ããã²ãŒãå ã¡ãã¥ãŒãšã¹ã¿ãžãªã®ãœãªã¥ãŒã·ã§ã³ãšã¯ã¹ãããŒã©ãŒã§ç¬èªã®ããã²ãŒã·ã§ã³æ©èœãååŸããŸããã
- Go to Typeã¡ã«ããºã ã¯ããžã§ããªãã¯ãããã²ãŒããããšãã«åœ¹ç«ã€ããã«ãªã£ãããã
List<Foo>
åã®å€æ°ã«ç«ã£ãŠããå Žåã¯ãList<T>
ãŸãã¯Foo
ã«ç§»åããããã«æ±ããããŸãã - Find Usagesã«ã¯ãã¹ã¿ãžãªã¿ãã®ã¿ãïŒãã¬ãã¥ãŒã¿ãïŒã䜿çšããããã®èšå®ããããé·ãæ€çŽ¢äžã«UIããããã¯ããªããªããŸããã
- [ çµæã®æ€çŽ¢]ãŠã£ã³ããŠã§ã¯ãåãã¢ã€ãã ãæ€çŽ¢ãããšãã«ã¿ãã衚瀺ãããªããªããŸãããæåŸã«ãçµæãªã¹ãã§ã¢ã€ãã ããã£ã«ã¿ãŒã§ããŸãã
ã³ãŒãã¹ã¿ã€ã«èšå®
次ã®èšå®ã9keã«ç»å ŽããŸããã
- varã䜿çšããããã®èšå® -3ã€ãããŸãïŒçµã¿èŸŒã¿åãåçŽåãããã³ãã®ä»ãã¹ãŠïŒã ããã«ããã
var
é¢é£ã®ããã³ãããšä¿®æ£ãªãã·ã§ã³ã衚瀺ããæ¹æ³ãšå Žæãããæ£ç¢ºã«å¶åŸ¡ã§ããŸãã - ã€ã³ã¹ã¿ã³ã¹ã¡ã³ããŒã®è³æ Œ -èšå®ã¯ãã¯ã©ã¹ã®ã©ã®ã¡ã³ããŒã
this.
修食åãé©çšããããæ åœããŸãthis.
- éçã¡ã³ããŒã®è³æ Œã¯ãã¯ã©ã¹ã®éçã¡ã³ããŒãžã®ã¢ã¯ã»ã¹æ¹æ³ãå¶åŸ¡ããŸããèŠçŽ ã宣èšãããŠããã¯ã©ã¹åãŸãã¯çŸåšã®ã¯ã©ã¹ã®ããããã§ãã
- 以åã®3ã€ã®èšå®ã¯ãã¹ãŠãã³ãŒãã¯ãªãŒã³ã¢ãããšã³ãžã³ã®ãããã¡ã€ã«èšå®ãšããŠäœ¿çšã§ããŸãã
- æåŸã«ããã¡ã€ã«å ã®èŠçŽ ã®ã¬ã€ã¢ãŠããå¶åŸ¡ããããã«ãå€ãXMLãšãã£ã¿ãŒãå®å šã«æžãçŽãã代ããã«æ°ããããžã¥ã¢ã«ã€ã³ã¿ãŒãã§ã€ã¹ãçµã¿èŸŒã¿ãŸããã
æ£èŠè¡šçŸã®ãµããŒã
ReSharperã¯æ£èŠè¡šçŸã䜿çšããããšãåŠç¿ããããããµãŒãããŒãã£ã®ããã°ã©ã ã¯äžèŠã«ãªããŸããã 圌ãã§ããããšã¯æ¬¡ã®ãšããã§ãã
- æ§æã®åŒ·èª¿è¡šç€ºã¯ããšã©ãŒã瀺ãéšåçãªè¡ã®åŒ·èª¿è¡šç€ºãªã©ãæ£èŠè¡šçŸã§äœ¿çšã§ããŸãã
- ã³ãŒãè£å®ã«ãããç°ãªãé åãéžæããããã»ã¹ãç°¡çŽ åãããŸãã ååä»ãã°ã«ãŒãã®èªåè£å®ãç»å ŽããŸããïŒ
- Quick-Fixã®ãšã¹ã±ãŒãã«ãããã¯ã€ã«ãã«ãŒãã«äœ¿çšããã
\
æåããéèªçãªè¡ïŒ@
å§ãŸãè¡ïŒã䜿çšããŠCïŒã®æå¹ãªæåã«ãã°ãã眮ãæããããšãã§ããŸãã
- å¥ã®æ€èšŒãŠãŒãã£ãªãã£ã䜿çšãããšãæ£èŠè¡šçŸãžã®æºæ ã«ã€ããŠãã¹ãå
¥åãªãã·ã§ã³ããã°ãã確èªããããããäžèŽããã³ã°ã«ãŒãã«è§£æã§ããŸãã
- ããªã³ã³ãã€ã«ãããåŒã«å€æãããšãæ£èŠè¡šçŸã
Regex
éçã€ã³ã¹ã¿ã³ã¹ã«è»¢éããããšã§ããã©ãŒãã³ã¹ãæ¹åã§ããŸãã
TypeScriptããã³JavaScriptã®æ©èœåŒ·å
TypeScriptãµããŒãã®ããã€ãã®æ¹åç¹ã¯æ¬¡ã®ãšããã§ãã
- æ°ããæ€æ»ããã³ä¿®æ£ãªãã·ã§ã³ã¯ã270ãè¶
ããããŸããŸãªãšã©ãŒãã«ããŒããŸã ã
- æ°ãããªãã¡ã¯ã¿ãªã³ã°ã«ã¯ã ãã£ãŒã«ãã®å°å
¥ ã ã¿ã€ãã®ã³ã㌠ã ãªãã¡ã¯ã¿ãªã³ã°ã®ç§»åïŒã¢ãžã¥ãŒã«/ãã¡ã€ã«ãžã®ã³ãŒãã®ç§»åãé©åãªãã¡ã€ã«ãžã®ç§»åããã©ã«ããžã®ç§»åïŒã ãã¡ã€ã«åã®å€æŽ ãããã³æ¿å
¥ãããã³ãŒãã®ã¿ã€ãã€ã³ããŒãã¡ã«ããºã ãå«ãŸããŸãã
- TypeScriptã®ã³ãŒãçæã¯ãã³ã³ã¹ãã©ã¯ã¿ãŒã®çæãšèŠçŽ ã®ãªãŒããŒã©ã€ãã ãã§ãªããã€ã³ã¿ãŒãã§ãŒã¹ã®èªåå®è£
/æ¬ èœèŠçŽ ã®çæããµããŒãããŸãã
- ã©ã€ããã³ãã¬ãŒããšã³ãžã³ã¯ãã¢ãžã¥ãŒã«ã¡ã³ããŒãšã¿ã€ãã¡ã³ããŒã®2ã€ã®æ°ããã¹ã³ãŒããšãªã¢ããµããŒãããŸãã ReSharperã¯ãã¯ã©ã¹ã
enum
ãã€ã³ã¿ãŒãã§ã€ã¹ãããã³ã¢ãžã¥ãŒã«ãçæããããã®TypeScriptãã³ãã¬ãŒããããã€ãæäŸããŠããŸãã
- TypeScriptã®ãã©ã¡ãŒã¿ãŒæ
å ±ã¯ãé¢æ°ã®åŒæ°ã ãã§ãªããåã®åŒæ°ããµããŒãããããã«ãªããŸããã
- ç¹æ®ãªçœ²åã®ãµããŒããç»å ŽããŸããã
ããã«ãReSharperã¯ã ã³ãŒããJavaScriptããTypeScriptã«èªåçã«å€æããã¡ã«ããºã ãšãASP.NET vNextã®æ©æãµããŒããæäŸããŸãã
çµ±åã€ã³ã¹ããŒã©ãŒ
ãã¹ãŠã®.NET補åïŒReSharperãdotTraceãdotMemoryãdotCoverãããã³dotPeekïŒã«å¯ŸããŠ1ã€ã®çµ±åã€ã³ã¹ããŒã©ãŒããŠãŒã¶ãŒã«æäŸããäºå®ã§ãã ã€ã³ã¹ããŒã«ããã»ã¹äžã«ãã€ã³ã¹ããŒã«ããå 容ãéžæã§ããŸãã ãŸãããã¹ãŠã®è£œåãåãå ±éãã©ãããã©ãŒã ã䜿çšããããã«ãªããŸãããããã«ãããè€æ°ã®ã¢ããªã±ãŒã·ã§ã³ãåæã«åäœãããšãã«ã³ã³ãã¥ãŒã¿ãŒãªãœãŒã¹ãç¯çŽãããŸãã
ãããŸã§ã«æçš¿ããæåã®EAPã¢ã»ã³ããªã«ãããReSharperèªäœã®ã¿ãã€ã³ã¹ããŒã«ã§ããããšã«æ³šæããŠãã ããã ãŸãã以åã®ããŒãžã§ã³ã®ReSharperããã³ãã®ä»ã®.NETããŒã«ãåé€ãããŸãã VS 2005ãš2008ããŸã ãµããŒããããŠããŸããïŒãã ããåŸã»ã©ç¢ºå®ã«ãµããŒãããŸãïŒã
ããã«ããã€ãã®æ¹å
以äžã«ãæ°æ©èœãŸãã¯æ¹åãããæ©èœãããã€ã瀺ããŸãã
- VS 14ã®ãµããŒã
- ReSharperãµãã·ã¹ãã ãéšåçã«ç¡å¹ã«ããæ©èœ -ããŸããŸãªRïŒæ©èœã®ãµããŒããç¡å¹ã«ããæ¹ãç°¡åã«ãªããŸããã ç¡å¹ã«ã§ããæ©èœã«ã¯ãåäœãã¹ããMsBuild / NAntãCSSãJavaScriptãTypeScriptãããã³åœéåã®ãµããŒãããããŸãã
- éã³ã³ãã€ã«ãããã³ãŒãã®ãããã°ãReSharperã§å©çšå¯èœã«ãªããŸããã ãã¡ããããããã®ç®çã«ã¯ãç¡æã®dotPeekãã³ã³ãã€ã©ãŒã䜿çšã§ããŸãã
- ReSharperã®ã¢ãŒããã¯ãã£ããŒã«ãããã¯ã ã¿ã€ãéã®äŸåé¢ä¿å³ãçæããæ©èœããµããŒãããããã«ãªããŸããã ãã®åœ¢åŒã®èŠèŠåã«ãããç¹å®ã®ã¿ã€ãã«äŸåããã³ãŒããšããã®ã¿ã€ããäŸåããã³ãŒããç解ã§ããŸãã ãã®ãã£ãŒãã¯ãä»ã®RïŒããŒã«ãšçµ±åãããŠããŸãã
ãã®æçš¿ã§ã¯ãæåã®EAPã¢ã»ã³ããªã§å©çšå¯èœãªäž»ãªæè¡é©æ°ã«ã€ããŠèª¬æããŸããããã¡ãããæ°ããæ©èœãå©çšå¯èœã«ãªã£ããè¿œå ããŸãã ãããŸã§ã®éããã¹ãŠã®äººã«EAPãããŠã³ããŒãã㊠ãæ°ããæ©èœãèªåã§è©äŸ¡ããŠããããŸãã
ç§ãã¡ã¯ããªãã®æèŠã«èå³ããããŸãã®ã§ãããªãã®èŠ³å¯ã«ã€ããŠç§ãã¡ã«æžãããšãwriteããªãã§ãã ããïŒããããŸãã¯ãã°ãã©ãã«ãŒ ïŒã ãããããé¡ãããŸãïŒ â