Skip to content

Commit cae4578

Browse files
authored
Delete Smart Indent Provider and Connected Functionality (#1313)
**Bug** This class was only used for the old Node language service, we now pick up this functionality from TypeScript. **Fix** Delete the smart indent provider along with some other associated classes that are now no longer referenced.
1 parent 8a8a112 commit cae4578

File tree

8 files changed

+5
-931
lines changed

8 files changed

+5
-931
lines changed

Nodejs/Product/Nodejs/Debugger/DataTips/DataTipTextManagerEvents.cs

Lines changed: 0 additions & 49 deletions
This file was deleted.

Nodejs/Product/Nodejs/Debugger/DataTips/DataTipTextViewFilter.cs

Lines changed: 0 additions & 103 deletions
This file was deleted.

Nodejs/Product/Nodejs/Nodejs.csproj

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@
226226
<Compile Include="Commands\OpenRemoteDebugProxyFolderCommand.cs" />
227227
<Compile Include="Commands\ShowDocumentationCommand.cs" />
228228
<Compile Include="Commands\SurveyNewsCommand.cs" />
229-
<Compile Include="Debugger\DataTips\DataTipTextManagerEvents.cs" />
230229
<Compile Include="Debugger\DebugEngine\AD7EvalErrorProperty.cs" />
231230
<Compile Include="Debugger\NodeDebugProvider.cs" />
232231
<Compile Include="Logging\LiveLogger.cs" />
@@ -240,7 +239,6 @@
240239
<Compile Include="Logging\INodejsToolsLogger.cs" />
241240
<Compile Include="Logging\NodejsToolsLogEvent.cs" />
242241
<Compile Include="Logging\NodejsToolsLogger.cs" />
243-
<Compile Include="Debugger\DataTips\DataTipTextViewFilter.cs" />
244242
<Compile Include="NodejsPackage.Debugger.cs" />
245243
<Compile Include="NpmUI\NpmOutputWindow.xaml.cs">
246244
<DependentUpon>NpmOutputWindow.xaml</DependentUpon>
@@ -315,15 +313,15 @@
315313
<Compile Include="Debugger\SteppingKind.cs" />
316314
<Compile Include="Project\NodejsFileNodeProperties.cs" />
317315
<Compile Include="Jade\JadeEditorFactory.cs" />
318-
</ItemGroup>
319-
<ItemGroup Condition=" '$(VisualStudioVersion)'=='14.0' Or '$(TargetVisualStudioVersion)'=='VS140' ">
316+
</ItemGroup>
317+
<ItemGroup Condition=" '$(VisualStudioVersion)'=='14.0' Or '$(TargetVisualStudioVersion)'=='VS140' ">
320318
<Compile Include="Options\NodejsFormattingDialogPage.cs">
321319
<SubType>Component</SubType>
322320
</Compile>
323321
<Compile Include="Options\NodejsFormattingBracesOptionsPage.cs">
324322
<SubType>Component</SubType>
325323
</Compile>
326-
<Compile Include="Options\NodejsFormattingSpacingOptionsPage.cs" >
324+
<Compile Include="Options\NodejsFormattingSpacingOptionsPage.cs">
327325
<SubType>Component</SubType>
328326
</Compile>
329327
<Compile Include="Options\NodejsFormattingGeneralOptionsPage.cs">
@@ -347,8 +345,8 @@
347345
<Compile Include="Options\NodejsFormattingSpacingOptionsControl.Designer.cs">
348346
<DependentUpon>NodejsFormattingSpacingOptionsControl.cs</DependentUpon>
349347
</Compile>
350-
</ItemGroup>
351-
<ItemGroup>
348+
</ItemGroup>
349+
<ItemGroup>
352350
<Compile Include="Project\ProjectResources.cs" />
353351
<Compile Include="Repl\NpmReplCommand.cs" />
354352
<Compile Include="TaggerProviderMetadata.cs" />
@@ -524,8 +522,6 @@
524522
<Compile Include="Repl\INodejsReplSite.cs" />
525523
<Compile Include="Repl\SaveReplCommand.cs" />
526524
<Compile Include="Repl\VsNodejsReplSite.cs" />
527-
<Compile Include="SmartIndent.cs" />
528-
<Compile Include="SmartIndentProvider.cs" />
529525
<Compile Include="SourceMapping\SourceMap.cs" />
530526
<Compile Include="TestFrameworks\TestFrameworkDirectories.cs" />
531527
<Compile Include="TypingsAcquisition.cs" />

Nodejs/Product/Nodejs/NodejsPackage.cs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
using System.Web.Script.Serialization;
2828
using System.Windows.Forms;
2929
using Microsoft.NodejsTools.Commands;
30-
using Microsoft.NodejsTools.Debugger.DataTips;
3130
using Microsoft.NodejsTools.Debugger.DebugEngine;
3231
using Microsoft.NodejsTools.Debugger.Remote;
3332
using Microsoft.NodejsTools.Jade;
@@ -39,11 +38,9 @@
3938
using Microsoft.NodejsTools.Telemetry;
4039
using Microsoft.VisualStudio;
4140
using Microsoft.VisualStudio.ComponentModelHost;
42-
using Microsoft.VisualStudio.OLE.Interop;
4341
using Microsoft.VisualStudio.Shell;
4442
using Microsoft.VisualStudio.Shell.Interop;
4543
using Microsoft.VisualStudio.Text;
46-
using Microsoft.VisualStudio.TextManager.Interop;
4744
using Microsoft.VisualStudio.Utilities;
4845
using Microsoft.VisualStudioTools;
4946
using 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

Comments
 (0)