Jetbrains Comfghjfghj

5
ReSharper Tips and Tricks JetBrains .NET Tools Library | Back to ReSharper Website Search / Home ReSharper / ReSharper Tips and Tricks Core functions and performance Look and feel Coding in the editor Core functions and performance Look and feel Coding in the editor Analyzing code Traversing code Transforming code Generating code Cleaning code Localizing code Unit testing ASP.NET and ASP.NET MVC Help and support To disable/enable ReSharper, go to Tools | Options | ReSharper and click Suspend/Resume. If you want to have a shortcut that quickly switches ReSharper on and off, go to Tools | Options | Environment | Keyboard and find the ReSharper_ToggleSuspended command, then press some shortcut keys and click Assign. Feel like ReSharper slows down your coding? Try increasing completion display time in ReSharper | Options | Environment | IntelliSense | Completion Behavior If you deploy ReSharper in an organization, you can use JetBrains License Server for distribution of licenses. You can change colors for everything ReSharper adds into Visual Studio. Go to Tools | Options | Environment | Fonts and Colors and find items starting with ReSharper. You can change ReSharper keyboard bindings for any action. Go to Tools | Options | Environment | Keyboard and find items starting with ReSharper. In Visual Studio 2012, you can use the Quick Launch feature to search and execute ReSharper commands. Trying to learn ReSharper shortcuts? You can see most of them in ReSharper menu, you can view all keymaps online , or download and print a PDF version of shortcuts . Do you want to surround some code with a try...catch? Use Ctrl+E,U converted by Web2PDFConvert.com

description

cghjfghj

Transcript of Jetbrains Comfghjfghj

  • ReSharper Tips and Tricks

    JetBrains .NET Tools Library | Back to ReSharper WebsiteSearch / Home ReSharper / ReSharper Tips and Tricks

    Core functions and performance

    Look and feel

    Coding in the editor

    Core functions and performanceLook and feelCoding in the editorAnalyzing codeTraversing codeTransforming codeGenerating codeCleaning codeLocalizing codeUnit testingASP.NET and ASP.NET MVCHelp and support

    To disable/enable ReSharper, go to Tools | Options | ReSharper andclick Suspend/Resume. If you want to have a shortcut that quicklyswitches ReSharper on and off, go to Tools | Options | Environment |Keyboard and find the ReSharper_ToggleSuspended command, thenpress some shortcut keys and click Assign.Feel like ReSharper slows down your coding? Try increasing completiondisplay time in ReSharper | Options | Environment | IntelliSense |Completion BehaviorIf you deploy ReSharper in an organization, you can use JetBrainsLicense Server for distribution of licenses.

    You can change colors for everything ReSharper adds into VisualStudio. Go to Tools | Options | Environment | Fonts and Colors andfind items starting with ReSharper. You can change ReSharper keyboard bindings for any action. Go toTools | Options | Environment | Keyboard and find items startingwith ReSharper. In Visual Studio 2012, you can use the Quick Launch feature to searchand execute ReSharper commands.Trying to learn ReSharper shortcuts? You can see most of them inReSharper menu, you can view all keymaps online, or download andprint a PDF version of shortcuts.

    Do you want to surround some code with a try...catch? Use Ctrl+E,U

    converted by Web2PDFConvert.com

  • Analyzing code

    Traversing code

    (Ctrl+Alt+J in IntelliJ IDEA scheme). Learn to use other code templatesavailable with this shortcut.You can select a block of code and use Ctrl+Alt+Shift+ Arrow keys tomove this block around.You can view recent clipboard entries with Ctrl+Shift+V (ReSharper |Edit | Paste) and select the one you want to paste If you open parameter info (Ctrl+Shift+Space in the Visual Studiokeymap or Ctrl+P in the IntelliJ IDEA keymap), you can usetab/Shift+Tab to jump to next/previous argument.Enums Completion in ReSharper is CamelHump Powered, MiddleMatching and Case Insensitive. Try typing StringComparison c = oicEnum IntelliSense in ReSharper will automatically insert the Enumtype as the prefix. No need to spell it out!With String.Format, you can now add a placeholder where thecursor is. Just hit Alt+Enter in positionIf a string literal is too long, hit Enter and ReSharper will automaticallyput the part of it to the next line and insert a + sign. Delete the + andthe string parts will be concatenated.Moving a property up 3 lines using cut/paste? There is a simpler way todo it: place your cursor on the property, press Ctrl+Shift+Alt and usethe up arrow key.Want to move a string literal to a resource file? Press Ctrl+Shift+Ranywhere on the string and select Move To Resource.

    Using [NotNull] and [CanBeNull] attributes can help you findNullReferenceException before even compilingRight-click on a file, project, solution folder or entire solution inSolution Explorer and select Inspect Code to see warnings andsuggestions for the selected item.Don't need a particular inspection? Press Alt+Enter while you at thecorresponding code and select Inspection Options, then you canchoose to suppress it with comment or change its severity level to Donot show.Starting from ReSharper 8.0, you can disable all inspections with asingle comment instead of defining separate inspections to suppress,you can now mark code with // ReSharper disable all andReSharper will not complain about anything until it meets acorresponding // ReSharper restore all.ReSharper's solution-wide analysis resolves visibility issues: you'll see ifan internal member is used outside of its assembly and you'll nevermiss a single unused non-private memberYou can exclude files by masks from code analysis (such as generatedcode) in ReSharper | Options | Code Inspections | Generated Code.You can go to the next error by pressing Shift+Alt+PgDn in VisualStudio keymap or Alt+F12 in IntelliJ IDEA keymap.

    converted by Web2PDFConvert.com

  • Transforming code

    Place your caret on the 'using' (or import if you work with VB.NET)keyword of the using directive. Right-click and choose Find Usages.ReSharper will show where exactly this namespace is used.Forgot where you were editing just now? Go to last edit location withCtrl+Shift+BackSpaceWant to locate a method or symbol real fast? Use Alt+{} in VisualStudio keymap or Ctrl+F12 in IntelliJ IDEA keymapGo to containing declaration (Ctrl-[) can be used with Shift to select thewhole declarationYou can press Ctrl+T in Visual Studio keymap or Ctrl+N in IntelliJ IDEAkeymap to quickly locate a type. Shift+Ctrl+T (Shift+Ctrl+N) forlocating filesWhen locating CustomerServicesTest using Go To Type, you don'tneed to type the whole thing. Just use CamelCase and type cst.Alt+Home in Visual Studio keymap or Ctrl+U in IntelliJ IDEAkeymap takes you to the base class and Alt+End in Visual Studiokeymap or Ctrl+Alt+B in IntelliJ IDEA keymap takes you to inheritorsSearch for anything (usages, implementations, code external to scopeetc.) that fetches to Find Results window. Use it then to navigatebetween search results (solution-wide) with Ctrl+Alt+Up/DownIn source code, Shift+Alt+L selects the current file in the SolutionExplorer; in decompiled sources, it opens the Object Browser focused onthe current typeTo explore the stack trace, press Ctrl+E, T in the Visual Studio keymapor Ctrl+Shift+E in the IntelliJ IDEA keymap.Start typing in tree views or Go To menus, and content will narrowdown to matching items. CamelHumps matching works there as wellUse Go to File to locate specific project in the Solution Explorer - justselect a .csproj file.When locating a type with Ctrl+T in the Visual Studio keymap orCtrl+N in the IntelliJ IDEA keymap, you can use wildcards. Want allViewModels? Type *ViewModel

    You can define what Context Actions you want available via ReSharper| Options | (C# or VB.NET) | Context ActionsDo you have multiple classes in the same file? Fix it fast. Right-click onthe file in the Solution Explorer and choose Refactor | Move TypesInto Matching FilesRename anything, anytime, anywhere with Ctrl+R,R in Visual Studiokeymap and F2 or Shift+F6 in IntelliJ IDEA keymap. You can do it evenin fewer steps - just type in a new name and hit Alt+Enter.You can extract a method from a section of code using Ctrl+R,M inVisual Studio keymap or Ctrl+Alt+M in IntelliJ IDEA keymap.Type in new method signature (change the number or type ofparameters, change the return type) and while the signature ishighlighted with a grey frame, hit Alt+Enter to apply the ChangeSignature refactoring.

    converted by Web2PDFConvert.com

  • Generating code

    Cleaning code

    Localizing code

    Unit testing

    Your C#/VB.NET11 iterator should not be lazy? Press Ctrl+Shift+R toinvoke the Convert Iterator to Method refactoring.Do you want to move to the next member in a class? Alt+Down will takeyou there; Alt+Up will bring you back.Want to wrap some code in an if or try .. catch block? UseCtrl+E,U in Visual Studio keymap or Ctrl+Alt+J in IntelliJ IDEA keymapto apply any of surround templates.Placing your cursor on a property, you can press Alt+Enter to change itfrom auto-property to a property with a backing field and vice-versa.Press Ctrl+R,S in Visual Studio keymap or Ctrl+F6 in IntelliJ IDEAkeymap to change the signature of a method and see a preview beforeapplying it. ReSharper will do the rest!

    You can add copyright header to all files via ReSharper | Options |File header text and then run Code clean-up for the whole solutionAlt+Ins in the Solution Explorer can create files from your FileTemplates .. and folders too.Type class and hit TAB. Want it public instead of internal by default?Change it via live templates.You can bind any command from generate popup menu to its ownshortcut. Go to Tools | Options | Environment | Keyboard and lookfor commands starting with ReSharper_Generate.Create event subscriptions in XAML/ASP.NET WebForms/VB.NET usingAlt+Ins and choosing Generate event subscriptionsIf you place your caret on a parameter in the constructor and hitAlt+Enter, ReSharper will create a field and initialize it for you.Type foreach and hit TAB. ReSharper will start a live template forsmart loop generation with type and name suggestions.Generate data class in seconds using Generate feature (Alt-Insert).Declaring a parameter in a constructor? Hit Alt+Enter to haveReSharper automatically create a field for it and initialize it.

    Think your code needs a good wash? Use Ctrl+E,C in the Visual Studiokeymap or Ctrl+Alt+F in the IntelliJ IDEA keymap and run the FullCleanup profile.

    To find all localizable strings in your solution, set Localizable=Yes andLocalizable Inspection=Pessimistic for the relevant projects, thenfind any such sting, which be highlighted with curly underline. PressAlt+Enter on it and choose Options for Inspection | Find all 'Elementis Localizable' issues.

    Use Ctrl+U, L in the Visual Studio keymap or Ctrl+T,L in the IntelliJ

    converted by Web2PDFConvert.com

  • ASP.NET and ASP.NET MVC

    Help and support

    IDEA keymap to run all unit tests in the solution.Want to run some particular tests? Select them in editor, right-click andchoose Run Unit Tests.Bind ReSharper_UnitTest_ContextRun command to a shortcut andrun any test with a single key combo.Start typing in the Unit Test Explorer and filter your tests by name.Filter to failed tests while running them in the Unit TestSessions window to see them pleasantly disappearing as they pass.

    In ASP.NET MVC applications, type return View(" and pressCtrl+Space. IntelliSense will list all available viewsASP.NET MVC Devs: type rta and press TAB. Fill in Controller, thenAccount. Now it should be in correct order with IntelliSense! Want to check for missing Views in ASP.NET MVC? Turn on solution-wide analysis. View("Login") will show as red if the Login.aspx notthereYou can use the Go To File Member in ASPX/Config files also. Press Alt+{} in Visual Studio keymap or Ctrl+F12 in IntelliJ IDEA keymap andlook it up!In ASPX pages, navigate to related files (CSS, JavaScipt, User Controls,etc.) with Ctrl+Alt+F7 in Visual Studio keymap or Ctrl+Shift+Alt+G inntelliJ IDEA keymap

    You can browse ReSharper help locally by choosing ReSharper | Help| Local HelpReSharper support team is always there to help you. Use the ReSharpersupport web site to explore FAQ and knowledge base, or submit yoursupport inquiry.If you want a new feature to be implemented in ReSharper, feel free topost a feature request in ReSharper issue tracker.

    20002014 JetBrains. All rights reserved.

    converted by Web2PDFConvert.com