2727using System . Web . Script . Serialization ;
2828using System . Windows . Forms ;
2929using Microsoft . NodejsTools . Commands ;
30- using Microsoft . NodejsTools . Debugger . DataTips ;
3130using Microsoft . NodejsTools . Debugger . DebugEngine ;
3231using Microsoft . NodejsTools . Debugger . Remote ;
3332using Microsoft . NodejsTools . Jade ;
3938using Microsoft . NodejsTools . Telemetry ;
4039using Microsoft . VisualStudio ;
4140using Microsoft . VisualStudio . ComponentModelHost ;
42- using Microsoft . VisualStudio . OLE . Interop ;
4341using Microsoft . VisualStudio . Shell ;
4442using Microsoft . VisualStudio . Shell . Interop ;
4543using Microsoft . VisualStudio . Text ;
46- using Microsoft . VisualStudio . TextManager . Interop ;
4744using Microsoft . VisualStudio . Utilities ;
4845using Microsoft . VisualStudioTools ;
4946using Microsoft . VisualStudioTools . Project ;
@@ -97,7 +94,6 @@ internal sealed partial class NodejsPackage : CommonPackage {
9794 private string _surveyNewsUrl ;
9895 private object _surveyNewsUrlLock = new object ( ) ;
9996 internal HashSet < ITextBuffer > ChangedBuffers = new HashSet < ITextBuffer > ( ) ;
100- private LanguagePreferences _langPrefs ;
10197 private NodejsToolsLogger _logger ;
10298 private ITelemetryLogger _telemetryLogger ;
10399 // Hold references for the subscribed events. Otherwise the callbacks will be garbage collected
@@ -208,22 +204,6 @@ protected override void Initialize() {
208204 }
209205 RegisterCommands ( commands , Guids . NodejsCmdSet ) ;
210206
211- IVsTextManager4 textMgr = ( IVsTextManager4 ) Instance . GetService ( typeof ( SVsTextManager ) ) ;
212-
213- LANGPREFERENCES3 [ ] langPrefs = GetNodejsLanguagePreferencesFromTypeScript ( textMgr ) ;
214- _langPrefs = new LanguagePreferences ( langPrefs [ 0 ] ) ;
215-
216- var textManagerEvents2Guid = typeof ( IVsTextManagerEvents4 ) . GUID ;
217- IConnectionPoint textManagerEvents2ConnectionPoint ;
218- ( ( IConnectionPointContainer ) textMgr ) . FindConnectionPoint ( ref textManagerEvents2Guid , out textManagerEvents2ConnectionPoint ) ;
219- uint cookie ;
220- textManagerEvents2ConnectionPoint . Advise ( _langPrefs , out cookie ) ;
221-
222- var textManagerEventsGuid = typeof ( IVsTextManagerEvents ) . GUID ;
223- IConnectionPoint textManagerEventsConnectionPoint ;
224- ( ( IConnectionPointContainer ) textMgr ) . FindConnectionPoint ( ref textManagerEventsGuid , out textManagerEventsConnectionPoint ) ;
225- textManagerEventsConnectionPoint . Advise ( new DataTipTextManagerEvents ( this ) , out cookie ) ;
226-
227207 MakeDebuggerContextAvailable ( ) ;
228208
229209 InitializeLogging ( ) ;
@@ -242,19 +222,6 @@ protected override void Initialize() {
242222#endif
243223 }
244224
245- public static LANGPREFERENCES3 [ ] GetNodejsLanguagePreferencesFromTypeScript ( IVsTextManager4 textMgr ) {
246- var langPrefs = new LANGPREFERENCES3 [ 1 ] ;
247- langPrefs [ 0 ] . guidLang = Guids . TypeScriptLanguageInfo ;
248- int hr = textMgr . GetUserPreferences4 ( null , langPrefs , null ) ;
249- if ( ErrorHandler . Failed ( hr ) ) {
250- MessageBox . Show ( Project . SR . GetString ( Project . SR . CouldNotGetTypeScriptLanguagePreferences ) , Project . SR . ProductName ) ;
251- ErrorHandler . ThrowOnFailure ( hr ) ;
252- }
253- langPrefs [ 0 ] . guidLang = typeof ( NodejsLanguageInfo ) . GUID ;
254- textMgr . SetUserPreferences4 ( null , langPrefs , null ) ;
255- return langPrefs ;
256- }
257-
258225 private void SubscribeToVsCommandEvents (
259226 int eventId ,
260227 EnvDTE . _dispCommandEvents_BeforeExecuteEventHandler beforeExecute = null ,
@@ -359,13 +326,6 @@ internal static bool TryGetStartupFileAndDirectory(System.IServiceProvider servi
359326 return true ;
360327 }
361328
362-
363- internal LanguagePreferences LangPrefs {
364- get {
365- return _langPrefs ;
366- }
367- }
368-
369329 private IContentType ReplContentType {
370330 get {
371331 if ( _contentType == null ) {
0 commit comments