Skip to content

Commit

Permalink
Delete Smart Indent Provider and Connected Functionality (#1313)
Browse files Browse the repository at this point in the history
**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.
  • Loading branch information
mjbvz committed Oct 5, 2016
1 parent 8a8a112 commit cae4578
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 931 deletions.

This file was deleted.

103 changes: 0 additions & 103 deletions Nodejs/Product/Nodejs/Debugger/DataTips/DataTipTextViewFilter.cs

This file was deleted.

14 changes: 5 additions & 9 deletions Nodejs/Product/Nodejs/Nodejs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@
<Compile Include="Commands\OpenRemoteDebugProxyFolderCommand.cs" />
<Compile Include="Commands\ShowDocumentationCommand.cs" />
<Compile Include="Commands\SurveyNewsCommand.cs" />
<Compile Include="Debugger\DataTips\DataTipTextManagerEvents.cs" />
<Compile Include="Debugger\DebugEngine\AD7EvalErrorProperty.cs" />
<Compile Include="Debugger\NodeDebugProvider.cs" />
<Compile Include="Logging\LiveLogger.cs" />
Expand All @@ -240,7 +239,6 @@
<Compile Include="Logging\INodejsToolsLogger.cs" />
<Compile Include="Logging\NodejsToolsLogEvent.cs" />
<Compile Include="Logging\NodejsToolsLogger.cs" />
<Compile Include="Debugger\DataTips\DataTipTextViewFilter.cs" />
<Compile Include="NodejsPackage.Debugger.cs" />
<Compile Include="NpmUI\NpmOutputWindow.xaml.cs">
<DependentUpon>NpmOutputWindow.xaml</DependentUpon>
Expand Down Expand Up @@ -315,15 +313,15 @@
<Compile Include="Debugger\SteppingKind.cs" />
<Compile Include="Project\NodejsFileNodeProperties.cs" />
<Compile Include="Jade\JadeEditorFactory.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(VisualStudioVersion)'=='14.0' Or '$(TargetVisualStudioVersion)'=='VS140' ">
</ItemGroup>
<ItemGroup Condition=" '$(VisualStudioVersion)'=='14.0' Or '$(TargetVisualStudioVersion)'=='VS140' ">
<Compile Include="Options\NodejsFormattingDialogPage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Options\NodejsFormattingBracesOptionsPage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Options\NodejsFormattingSpacingOptionsPage.cs" >
<Compile Include="Options\NodejsFormattingSpacingOptionsPage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Options\NodejsFormattingGeneralOptionsPage.cs">
Expand All @@ -347,8 +345,8 @@
<Compile Include="Options\NodejsFormattingSpacingOptionsControl.Designer.cs">
<DependentUpon>NodejsFormattingSpacingOptionsControl.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="Project\ProjectResources.cs" />
<Compile Include="Repl\NpmReplCommand.cs" />
<Compile Include="TaggerProviderMetadata.cs" />
Expand Down Expand Up @@ -524,8 +522,6 @@
<Compile Include="Repl\INodejsReplSite.cs" />
<Compile Include="Repl\SaveReplCommand.cs" />
<Compile Include="Repl\VsNodejsReplSite.cs" />
<Compile Include="SmartIndent.cs" />
<Compile Include="SmartIndentProvider.cs" />
<Compile Include="SourceMapping\SourceMap.cs" />
<Compile Include="TestFrameworks\TestFrameworkDirectories.cs" />
<Compile Include="TypingsAcquisition.cs" />
Expand Down
40 changes: 0 additions & 40 deletions Nodejs/Product/Nodejs/NodejsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
using System.Web.Script.Serialization;
using System.Windows.Forms;
using Microsoft.NodejsTools.Commands;
using Microsoft.NodejsTools.Debugger.DataTips;
using Microsoft.NodejsTools.Debugger.DebugEngine;
using Microsoft.NodejsTools.Debugger.Remote;
using Microsoft.NodejsTools.Jade;
Expand All @@ -39,11 +38,9 @@
using Microsoft.NodejsTools.Telemetry;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.TextManager.Interop;
using Microsoft.VisualStudio.Utilities;
using Microsoft.VisualStudioTools;
using Microsoft.VisualStudioTools.Project;
Expand Down Expand Up @@ -97,7 +94,6 @@ internal sealed partial class NodejsPackage : CommonPackage {
private string _surveyNewsUrl;
private object _surveyNewsUrlLock = new object();
internal HashSet<ITextBuffer> ChangedBuffers = new HashSet<ITextBuffer>();
private LanguagePreferences _langPrefs;
private NodejsToolsLogger _logger;
private ITelemetryLogger _telemetryLogger;
// Hold references for the subscribed events. Otherwise the callbacks will be garbage collected
Expand Down Expand Up @@ -208,22 +204,6 @@ internal sealed partial class NodejsPackage : CommonPackage {
}
RegisterCommands(commands, Guids.NodejsCmdSet);

IVsTextManager4 textMgr = (IVsTextManager4)Instance.GetService(typeof(SVsTextManager));

LANGPREFERENCES3[] langPrefs = GetNodejsLanguagePreferencesFromTypeScript(textMgr);
_langPrefs = new LanguagePreferences(langPrefs[0]);

var textManagerEvents2Guid = typeof(IVsTextManagerEvents4).GUID;
IConnectionPoint textManagerEvents2ConnectionPoint;
((IConnectionPointContainer)textMgr).FindConnectionPoint(ref textManagerEvents2Guid, out textManagerEvents2ConnectionPoint);
uint cookie;
textManagerEvents2ConnectionPoint.Advise(_langPrefs, out cookie);

var textManagerEventsGuid = typeof(IVsTextManagerEvents).GUID;
IConnectionPoint textManagerEventsConnectionPoint;
((IConnectionPointContainer)textMgr).FindConnectionPoint(ref textManagerEventsGuid, out textManagerEventsConnectionPoint);
textManagerEventsConnectionPoint.Advise(new DataTipTextManagerEvents(this), out cookie);

MakeDebuggerContextAvailable();

InitializeLogging();
Expand All @@ -242,19 +222,6 @@ internal sealed partial class NodejsPackage : CommonPackage {
#endif
}

public static LANGPREFERENCES3[] GetNodejsLanguagePreferencesFromTypeScript(IVsTextManager4 textMgr) {
var langPrefs = new LANGPREFERENCES3[1];
langPrefs[0].guidLang = Guids.TypeScriptLanguageInfo;
int hr = textMgr.GetUserPreferences4(null, langPrefs, null);
if (ErrorHandler.Failed(hr)) {
MessageBox.Show(Project.SR.GetString(Project.SR.CouldNotGetTypeScriptLanguagePreferences), Project.SR.ProductName);
ErrorHandler.ThrowOnFailure(hr);
}
langPrefs[0].guidLang = typeof(NodejsLanguageInfo).GUID;
textMgr.SetUserPreferences4(null, langPrefs, null);
return langPrefs;
}

private void SubscribeToVsCommandEvents(
int eventId,
EnvDTE._dispCommandEvents_BeforeExecuteEventHandler beforeExecute = null,
Expand Down Expand Up @@ -359,13 +326,6 @@ internal sealed partial class NodejsPackage : CommonPackage {
return true;
}


internal LanguagePreferences LangPrefs {
get {
return _langPrefs;
}
}

private IContentType ReplContentType {
get {
if (_contentType == null) {
Expand Down

0 comments on commit cae4578

Please sign in to comment.