Skip to content

Commit 94926fe

Browse files
Dev mode documentation with screenshots
1 parent 4f71451 commit 94926fe

File tree

7 files changed

+28
-0
lines changed

7 files changed

+28
-0
lines changed

Dev-Mode-in-Visual-Studio.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,34 @@ Dev Mode is a new feature for [TypeScript 1.4](https://github.com/Microsoft/Type
3333
5. Right click the `CustomTypeScriptServicesFileLocation` value and **Modify** it.
3434
6. Change the value data to the full path of your alternative services file (e.g. `C:\Users\drosen\TypeScript\built\local\typescriptServices.js`)
3535

36+
# Hot swapping
37+
38+
When the language service's script side is modified in any way (whether or not you are using a custom location for your language service file), it will be reloaded on the fly. This means you should see changes instantaneously. However, this means that when debugging, your language service threads will be purged.
39+
3640
# Debugging the language service in Visual Studio using Visual Studio
3741

3842
1. Have a running instance of Visual Studio 2013/2015 with an open TypeScript file.
43+
![A running instance with a typical TypeScript file.](./dev-mode-screenshots/001.png)
44+
2. Open a new instance of Visual Studio 2013/2015.
45+
3. Bring up the **Attach to Process** dialog by either
46+
* Using menu bar and navigating from `Debug` -> `Attach to Process`.
47+
![Navigating to the **Attach to Process** dialog with the menu bar.](./dev-mode-screenshots/002.png)
48+
* Clicking on the `Attach` button from the **Standard** toolbar if it is visible.
49+
![A shortcut to opening the 'Attach to Process' dialog.](./dev-mode-screenshots/003.png)
50+
4. In the row labeled `Attach to:`, click on the `Select...` button.
51+
![Hit the select button.](./dev-mode-screenshots/004.png)
52+
5. Click the radio button `Debug these code types` and select `Script`. Then press OK.
53+
![Select 'Script' code to be debugged.](./dev-mode-screenshots/005.png)
54+
6. Find the appropriate Visual Studio instance in your list. Visual Studio instances have the process name `devenv.exe` and you can typically narrow down your instance looking for its current file in the Title field.
55+
7. Hit the `Attach` button. In the **Solution Exporer**. you should now see four active debuggers (one for each language service thread).
56+
![Debugging view after appropriately selecting your Visual Studio instance.](./dev-mode-screenshots/006.png)
57+
58+
At this point you should be able to hit debug points and get an understanding of what's going on.
59+
60+
## Language Service Threads
61+
62+
* **Classifier_N**: This thread runs the lexical classifier - a line-oriented classifier which is primarily concerned with fast rudimentary colorization.
63+
* **CoreServices_N**: This is used to calculate the virtual project space in VS, and needs more documentation.
64+
* **LanguageService_N** and **LanguageService_N**: Unfortunately these haven't been distinctly named.
65+
* One of these is the syntactic classifier, giving accurate (semantically agnostic) classifications.
66+
* The other needs to be documented more thoroughly.

dev-mode-screenshots/001.png

64.9 KB
Loading

dev-mode-screenshots/002.png

15.5 KB
Loading

dev-mode-screenshots/003.png

6.68 KB
Loading

dev-mode-screenshots/004.png

75.9 KB
Loading

dev-mode-screenshots/005.png

7.09 KB
Loading

dev-mode-screenshots/006.png

37.5 KB
Loading

0 commit comments

Comments
 (0)