ReSharper Essentials

Book description

Make your Microsoft Visual Studio work smarter with ReSharper

In Detail

ReSharper is one of the best tools that extends Microsoft Visual Studio. It adds a lot of features which increases a developer's productivity. It started with providing support for C# and VB.NET projects, but the current version supports developers in almost any type of applications which you can create with Visual Studio.

Written with very clear walkthroughs and step-by-step instructions, this book contains many cases that practically show you how to write better code, refactor it and quickly find problems in your code.

This book explains how to start using ReSharper and how you can configure it to suit your needs. In the beginning it focuses on introducing the most commonly used features that help you in writing code and find things in smarter, quicker ways. You will learn about code analysis which will help you to eliminate errors and code smells, and how ReSharper supports web development by providing support for writing ASP.NET (MVC) applications and JavaScript/TypeScript or HTML/CSS code.

This book introduces tools that facilitate your work with unit tests and teach you how to write a simple ReSharper plugin. The last chapters present the new features introduced in ReSharper 8, which provide support for architects and allow you to use ReSharper analysis besides Visual Studio and also support for TypeScript (8.1). Finally, it quickly reviews the best ReSharper plugins recommended by the author.

This book will show you how to use ReSharper features to be a better developer, in a practical manner.

What You Will Learn

  • Employ ReSharper in web projects with support for ASP.NET (MVC), HTML/CSS, JavaScript and TypeScript
  • Write your own ReSharper plugin
  • Utilize and configure templates
  • Find files, code references, and navigate through codes quicker
  • Eliminate errors and code smells
  • Generate your code ? not write it
  • Improve the quality of your code by using code analysis
  • Run Unit Tests and manage test sessions
  • Find your project's dependencies
  • Use ReSharper analysis beyond Visual Studio

Table of contents

  1. ReSharper Essentials
    1. Table of Contents
    2. ReSharper Essentials
    3. Credits
    4. About the Author
    5. About the Reviewers
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Errata
        2. Piracy
        3. Questions
    8. 1. Getting Started with ReSharper
      1. Introduction to ReSharper
        1. Available versions
        2. Support for various versions of Visual Studio
        3. Support for various languages
      2. Installing and configuring ReSharper
        1. Installing ReSharper
        2. Configuring ReSharper
          1. Options
            1. The General tab
            2. The Keyboard & Menus tab
            3. The Settings tab
            4. The Inspection Severity tab
            5. The C#, VB.NET, and Naming Style tab
          2. Manage options
      3. Integration with Visual Studio
      4. Summary
    9. 2. Write Smarter Code
      1. Code generation
        1. Generating code for non-existent objects
        2. Introduce variable
        3. Generating constructors
        4. Surround with
        5. Generating object members
      2. Using code editing helpers
        1. Enhanced IntelliSense
        2. Extending the code selection
        3. Safe delete
        4. Auto-importing namespaces
        5. Quick documentation
      3. Templates
        1. Templates as snippets
        2. File template
        3. Customization
        4. Multifile templates
      4. Refactoring
        1. Rename
        2. Moving to a separate file
        3. Refactor this…
      5. Summary
    10. 3. Finding What You Need Quickly
      1. Finding files
        1. Going to a proper file
        3. The last edited location
        4. Go to Everything
      2. Searching code references
        1. Go to Declaration
        2. Code usage
        3. The Navigate to feature
      3. Displaying code structure
        1. File members
        2. The File Structure window
        3. Value Origin and Destination
      4. Navigating to the library code
      5. Summary
    11. 4. Making Your Code Better
      1. Code quality analysis
        1. Background analysis
        2. Solution-wide inspections
        3. Disabling code inspections
        4. Code Issues
      2. Eliminating errors and code smells
        1. Quick fixes
        2. Fix in scope
        3. Structural Search and Replace
        4. Code Cleanup
      3. Summary
    12. 5. Extended Support for Web Developers
      1. ASP.NET Web Forms and ASP.NET MVC tools
        1. Writing ASP.NET smartly
        2. Templates
        3. Enhanced navigation
        4. ASP.NET MVC specific support
      2. Support for JavaScript
        1. Smart IntelliSense
        2. The Code Analysis and refactoring options
        3. Navigation and smart usages
        4. Structural Search and Replace (SSR)
      3. Support for TypeScript
      4. Support for HTML/CSS
        1. Writing HTML/CSS code
        2. CSS hierarchy
        3. Navigation
        4. Browser compatibility support
        5. Templates
        6. Code analysis
      5. Summary
    13. 6. Unit Testing
      1. Test runner
        1. The Unit Test Explorer window
        2. The Unit Test Sessions window
      2. Testing JavaScript
        1. Running JavaScript unit tests
        2. Integration with PhantomJS
      3. Analyzing code coverage with dotCover
      4. Summary
    14. 7. Extending ReSharper
      1. Why you should extend ReSharper
      2. The ReSharper API
        1. Platform
        2. Program Structure Interface (PSI)
        3. Features and plugins
        4. Daemons
      3. Internal mode
        1. PSI Browser
        2. PSI Module Browser
        3. PSI Viewer
        4. Enabling the Internal mode
      4. The ReSharper SDK
        1. Installing the ReSharper SDK
        2. Getting the required NuGet packages
      5. Your first plugin
        1. Creating a project
        2. Project elements
          1. Assembly info
          2. Actions
          3. Context action
          4. Other project elements
        3. Debugging a plugin
        4. Deploying a plugin
        5. Your plugin in action
      6. Sample SDK plugins
      7. Summary
    15. 8. Tools for Architects
      1. Architecture View
      2. Advanced references view
        1. The Referenced Code window
        2. The Optimize References window
      3. Global refactoring
      4. Summary
    16. 9. Code Analysis Beyond Visual Studio
      1. Finding code duplicates
      2. Running code analysis
      3. TeamCity
      4. Summary
    17. 10. Recommended Plugins
      1. The ReSharper gallery
      2. tests support
      3. Mnemonic Live Templates
      4. Support for AngularJS
      5. JSLint for ReSharper
      6. The Utility Pack
      7. Summary
    18. A. Keyboard Shortcuts
      1. Write smarter code
      2. Finding what you need quickly
      3. Extended support for web developers
      4. Unit testing
    19. Index

Product information

  • Title: ReSharper Essentials
  • Author(s):
  • Release date: February 2014
  • Publisher(s): Packt Publishing
  • ISBN: 9781849698702