You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Dev-Mode-in-Visual-Studio.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,34 @@ Dev Mode is a new feature for [TypeScript 1.4](https://github.com/Microsoft/Type
33
33
5. Right click the `CustomTypeScriptServicesFileLocation` value and **Modify** it.
34
34
6. Change the value data to the full path of your alternative services file (e.g. `C:\Users\drosen\TypeScript\built\local\typescriptServices.js`)
35
35
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
+
36
40
# Debugging the language service in Visual Studio using Visual Studio
37
41
38
42
1. Have a running instance of Visual Studio 2013/2015 with an open TypeScript file.
43
+

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
+

48
+
* Clicking on the `Attach` button from the **Standard** toolbar if it is visible.
49
+

50
+
4. In the row labeled `Attach to:`, click on the `Select...` button.
51
+

52
+
5. Click the radio button `Debug these code types` and select `Script`. Then press OK.
53
+

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
+

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.
0 commit comments