|
6 | 6 | using System.Diagnostics; |
7 | 7 | using System.Globalization; |
8 | 8 | using System.IO; |
9 | | -using System.Linq; |
10 | 9 | using System.Runtime.InteropServices; |
11 | 10 | using System.Windows.Forms; |
12 | 11 | using Microsoft.NodejsTools.Commands; |
13 | 12 | using Microsoft.NodejsTools.Debugger.DebugEngine; |
14 | 13 | using Microsoft.NodejsTools.Debugger.Remote; |
15 | 14 | using Microsoft.NodejsTools.Jade; |
16 | | -using Microsoft.NodejsTools.Logging; |
17 | 15 | using Microsoft.NodejsTools.Options; |
18 | 16 | using Microsoft.NodejsTools.Project; |
19 | 17 | using Microsoft.NodejsTools.ProjectWizard; |
@@ -72,7 +70,7 @@ internal sealed partial class NodejsPackage : CommonPackage |
72 | 70 |
|
73 | 71 | // Hold references for the subscribed events. Otherwise the callbacks will be garbage collected |
74 | 72 | // after the initialization |
75 | | - private List<EnvDTE.CommandEvents> _subscribedCommandEvents = new List<EnvDTE.CommandEvents>(); |
| 73 | + private readonly List<EnvDTE.CommandEvents> subscribedCommandEvents = new List<EnvDTE.CommandEvents>(); |
76 | 74 |
|
77 | 75 | /// <summary> |
78 | 76 | /// Default constructor of the package. |
@@ -125,19 +123,18 @@ protected override void Initialize() |
125 | 123 | new SendFeedbackCommand(), |
126 | 124 | new ShowDocumentationCommand() |
127 | 125 | }; |
| 126 | + |
128 | 127 | try |
129 | 128 | { |
130 | 129 | commands.Add(new AzureExplorerAttachDebuggerCommand()); |
131 | 130 | } |
132 | 131 | catch (NotSupportedException) |
133 | 132 | { |
134 | 133 | } |
135 | | - RegisterCommands(commands, Guids.NodejsCmdSet); |
136 | 134 |
|
| 135 | + RegisterCommands(commands, Guids.NodejsCmdSet); |
137 | 136 | MakeDebuggerContextAvailable(); |
138 | 137 |
|
139 | | - InitializeTelemetry(); |
140 | | - |
141 | 138 | // The variable is inherited by child processes backing Test Explorer, and is used in |
142 | 139 | // the NTVS test discoverer and test executor to connect back to VS. |
143 | 140 | Environment.SetEnvironmentVariable(NodejsConstants.NodeToolsProcessIdEnvironmentVariable, Process.GetCurrentProcess().Id.ToString()); |
@@ -172,14 +169,7 @@ private void SubscribeToVsCommandEvents( |
172 | 169 | { |
173 | 170 | targetEvent.AfterExecute += afterExecute; |
174 | 171 | } |
175 | | - this._subscribedCommandEvents.Add(targetEvent); |
176 | | - } |
177 | | - |
178 | | - private void InitializeTelemetry() |
179 | | - { |
180 | | - // Fetch the session synchronously on the UI thread; if this doesn't happen before we try using this on |
181 | | - // the background thread then the VS process will deadlock. |
182 | | - TelemetryHelper.Initialize(); |
| 172 | + this.subscribedCommandEvents.Add(targetEvent); |
183 | 173 | } |
184 | 174 |
|
185 | 175 | public new IComponentModel ComponentModel => this.GetComponentModel(); |
@@ -349,15 +339,5 @@ public string BrowseForDirectory(IntPtr owner, string initialDirectory = null) |
349 | 339 | } |
350 | 340 | } |
351 | 341 | } |
352 | | - |
353 | | - internal static void NavigateTo(string filename, int line, int col) |
354 | | - { |
355 | | - VsUtilities.NavigateTo(Instance, filename, Guid.Empty, line, col); |
356 | | - } |
357 | | - |
358 | | - internal static void NavigateTo(string filename, int pos) |
359 | | - { |
360 | | - VsUtilities.NavigateTo(Instance, filename, Guid.Empty, pos); |
361 | | - } |
362 | 342 | } |
363 | 343 | } |
0 commit comments