Note: The Productivity Power Tools does not install a page in Tools->Options for enabling and disabling individual Productivity Power Tools. For Visual Studio. Productivity Power Tools. A set of extensions to Visual Studio 2012 Professional (and above) which improves developer productivity. After using it for almost 2 years, I can’t imagine myself writing code without it. It can be downloaded from this link.
25 Feb 2011CPOL
'Quick Find' - a better way using Visual Studio Productivity power tools
You might know about the Visual Studio 2010 Productivity Power Tools extension, which has several features on top of the Visual Studio's default IDE features. Recently, they released the new version which has some other benefits over the previous versions.
In this post, I am going to discuss the Quick Find feature of the new Productivity Power Tools. Read the full post to know more about it.
Download
If you didn't install the Productivity Power Tools for Visual Studio 2010 or if you want to update your existing extension, you can download the latest version from here:
If you are using Visual Studio 2010 SP1 and have the previous version already installed, first uninstall the previous version prior to update it.
Alternatively, you can download it from the Visual Studio Extension Manager.
Default Find Dialog
Let us start discussing our main topic, i.e., the 'Quick Find' feature of the new Productivity Power Tools. Before jumping into the details, let us first discuss the default Visual Studio search dialog. There are plenty of options available inside Visual Studio. Among them, the Find and Replace dialog is most popular. If you press CTRL + F, it will open up the below dialog:
You can easily type there and search for the text. Right? So, what is the problem then? If you open the find dialog, it will come up on the screen and take a huge amount of space by hiding the actual editor text where the search is going to happen. When you press 'Find Next', sometimes it becomes more annoying to drag the dialog in a different location to find the
string
.You can easily overcome this situation by pressing Escape to hide the dialog after the first search and pressing F3 to locate the next
string
.It actually blocks the UI, right? Now the new productivity power tools has a different search dialog which will overcome this issue. Let's talk about it now.
Quick Find Dialog
If you have already installed the latest version of Visual Studio Productivity Power Tools, press the key combination CTRL + F. You will find a small popup dialog at the top right corner of the editor window. Here, you can see the screenshot:
If you start typing inside the search box, you will notice that the search starts immediately in the editor window and all the
string
s matched with the entered string
will get highlighted with a yellow mark.If it finds a full match, it will show all the matching
string
s highlighted (as shown below):You can easily customize the search by clicking the arrow head just beside the search box. It will open a dropdown where you can set the search settings.
Clicking on the 'Advanced Options...' will popup the original Find dialog into the screen.
There, you can actually customize it more to search in Current Document, All Opened Document, Current Project or Entire Solution.
Issue Finding the New Quick Find?
There might be three reasons, if you don't find the 'Quick Find' dialog inside the Visual Studio IDE and those will be:
- You didn't install the Productivity Power Tools for Visual Studio 2010 IDE
- You don't have the latest version of the Extension
- The 'Quick Find' option is not enabled inside your Visual Studio 2010 IDE
For the first two reasons, download and install/upgrade the extension from the above mentioned URL. If you already installed the latest version and still facing the same issue, the option might not be enabled inside the IDE settings.
In the third case, go to Tools -> Options (as shown below):
This will open up the Options dialog. From the left pane, select the 'Productivity Power Tools' as shown in the below screenshot. In the right side, you will see a bunch of options available. Find out the 'Quick Find' option. In this case, you will see it as 'OFF', means this option is disabled.
To enable it, click on the toggle button '
OFF
', it will become 'ON
'. Click 'OK
' to continue. This will re-enable the 'Quick Find' dialog.You must need to restart the Visual Studio for the changes to take effect. After restart, try pressing CTRL + F, you will see the new Quick Find dialog in the screen.
Similarly, if you want to do Find and Replace, you can see it here too. Press CTRL + H to open up the Quick Find dialog which has the replace box too. Have a look into the below snapshot:
Hope this information will help you to do your daily find and replace operation in a new way and minimize the effort with a proper way of search. You can find all of my posts on Productivity Power Tools here.
Happy coding...
-->In this section, you'll learn how to use Visual Studio for Mac Tools for Unity's integration and productivity features, and how to use the Visual Studio for Mac debugger for Unity development.
Opening Unity scripts in Visual Studio for Mac
Once Visual Studio for Mac is set as the external script editor for Unity, opening any script from the Unity editor will automatically launch or switch to Visual Studio for Mac, with the chosen script open.
Alternatively, Visual Studio for Mac can be opened with no script open in the source editor by selecting Open C# Project from the Assets menu in Unity.
Unity documentation access
Visual Studio for Mac Tools for Unity includes a shortcut for accessing the Unity API documentation. To access Unity API documentation from Visual Studio for Mac, place the cursor over the Unity API you want to learn about and press ⌘ command + ‘.
IntelliSense for Unity messages
The Unity engine broadcasts messages to MonoBehaviour scripts, allowing developers to write code that reacts to messages such as OnMouseDown, OnTriggerEnter, etc. Because these are not virtual methods in the base MonoBehaviour class, some IDEs such as MonoDevelop lack code completion functionality for Unity messages.
However, Visual Studio for Mac Tools for Unity extends its IntelliSense functionality to Unity messages. This makes it easy to implement Unity messages in MonoBehaviour scripts, and assists with learning the Unity API. To use IntelliSense for Unity messages:
- Place the cursor on a new line inside the body of a class that derives from MonoBehaviour.
- Begin typing the name of a Unity message, such as
OnTriggerEnter
. - Once the letters 'ont' have been typed, a list of IntelliSense suggestions appears.
- The selection on the list can be changed in three ways:
- With the Up and Down arrow keys.
- By clicking with the mouse on the desired item.
- By continuing to type the name of the desired item.
- IntelliSense can insert the selected Unity message, including any necessary parameters:
- By pressing Tab.
- By pressing Return.
- By double-clicking the selected item.
Adding new Unity files and folders
While you can always add new files to a Unity project in the Unity editor, Visual Studio for Mac allows for easily creating new Unity scripts, shaders, structs, enums, and folders from within Visual Studio.
Add a new C# MonoBehaviour script
To add a new C# MonoBehaviour script, right-click on the Assets folder or one of its subdirectories in the Solution pad and select Add > New MonoBehaviour.
Add a new Unity shader
To add a new Unity shader, right-click on the Assets folder or a subdirectory in the Solution pad and select Add > New Shader.
Add a new folder
To add a new folder, right-click on the Assets folder or a subdirectory in the Solution pad and select Add > New Folder.
These additions are reflected in the Project window of the Unity editor.
To rename a file or folder
right-click on the item to rename in the Solution pad and select Rename....
Note
If you have a new Unity project with no scripts and the Assets folder does not show up in the Solution pad in Visual Studio for Mac, add an initial C# script from within the Unity editor.
Unity debugging
Unity projects can be debugged with Visual Studio for Mac.
Start debugging
To start debugging:
- Connect Visual Studio to Unity by clicking the Play button, or type Command + Return, or F5.
- Switch to Unity and click the Play button to run the game in the editor.
- When the game is running in the Unity editor while connected to Visual Studio, any breakpoints encountered will pause execution of the game and bring up the line of code where the game hit the breakpoint in Visual Studio for Mac.
Start Debugging in a Single Step
Starting debugging and playing the Unity editor can be completed in a single step directly from Visual Studio for Mac by choosing the Attach to Unity and Play configuration.
Stop debugging
To stop debugging:
- Click the Stop button in Visual Studio for Mac, or press Shift + Command + Return.
Note
If you started debugging using the Attach to Unity and Play configuration, the Stop button will also stop the Unity.
To learn more about debugging in Visual Studio for Mac, see Using the debugger.