From f1f0c89b038da2c3e52977535c0f0bb5fc6bef29 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 7 Sep 2016 18:08:27 -0700 Subject: [PATCH 1/7] Remove ES5 IntelliSense Option As explained in #1254, there are few reasons for anyone to switch back to the old ES5 based intellisense. Our telemtry also shows that very very few people are switching back too. This change removes the option to switch from the VS entirely. This locks all main editors in ES6/Typescript backed mode. We'll keep around the old analysis engine code a bit longer in order to power the Interactive window, but will eventually rip it out too. Closes #1254 --- .../Nodejs/Commands/DiagnosticsCommand.cs | 3 +- .../Nodejs/Intellisense/VsProjectAnalyzer.cs | 35 - Nodejs/Product/Nodejs/Nodejs.csproj | 10 - Nodejs/Product/Nodejs/NodejsPackage.cs | 36 +- Nodejs/Product/Nodejs/NodejsProject.cs | 13 +- ...deLsIntellisenseOptionsControl.Designer.cs | 212 ----- .../NodeLsIntellisenseOptionsControl.cs | 134 --- .../NodeLsIntellisenseOptionsControl.resx | 808 ------------------ .../Options/NodejsGeneralOptionsControl.cs | 2 +- ...dejsIntellisenseOptionsControl.Designer.cs | 73 +- .../NodejsIntellisenseOptionsControl.cs | 38 +- .../NodejsIntellisenseOptionsControl.resx | 260 +----- .../Options/NodejsIntellisenseOptionsPage.cs | 61 -- .../Nodejs/Project/NodejsFolderNode.cs | 9 +- .../Nodejs/Project/NodejsProjectNode.cs | 43 +- 15 files changed, 38 insertions(+), 1699 deletions(-) delete mode 100644 Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.Designer.cs delete mode 100644 Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.cs delete mode 100644 Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.resx diff --git a/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs b/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs index 7a93fe4c7..3b16c25a2 100644 --- a/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs +++ b/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs @@ -24,6 +24,7 @@ using Microsoft.NodejsTools.Logging; using Microsoft.VisualStudioTools; using Microsoft.VisualStudioTools.Project; +using Microsoft.NodejsTools.Options; namespace Microsoft.NodejsTools.Commands { internal sealed class DiagnosticsCommand : Command { @@ -275,7 +276,7 @@ private static string GetLoadedAssemblyInfo() { private static string GetAnalysisLevelInfo() { var res = new StringBuilder(); - res.AppendLine(String.Format("Analysis Level: {0}", NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevel.ToString())); + res.AppendLine(String.Format("Analysis Level: {0}", AnalysisLevel.Preview.ToString())); res.AppendLine(); if (NodejsPackage.Instance._analyzer != null) { var jsAnalyzer = NodejsPackage.Instance._analyzer; diff --git a/Nodejs/Product/Nodejs/Intellisense/VsProjectAnalyzer.cs b/Nodejs/Product/Nodejs/Intellisense/VsProjectAnalyzer.cs index b732de90a..0519b2c9c 100644 --- a/Nodejs/Product/Nodejs/Intellisense/VsProjectAnalyzer.cs +++ b/Nodejs/Product/Nodejs/Intellisense/VsProjectAnalyzer.cs @@ -1075,41 +1075,6 @@ CollectingErrorSink errorSink ) { // There are some scenarios during ES6 Mode where a textview is still opened using NodeLS. // In these cases, we do not properly parse ES6 syntax, and therefore do not want to display errors. - if (NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevel == AnalysisLevel.Preview) { - return; - } - - // Update the warn-on-launch state for this entry - bool changed = false; - lock (_hasParseErrors) { - if (errorSink.Errors.Any() ? _hasParseErrors.Add(entry) : _hasParseErrors.Remove(entry)) { - changed = true; - } - } - if (changed) { - OnShouldWarnOnLaunchChanged(entry); - } - - var f = new TaskProviderItemFactory(snapshot); - - // Update the parser warnings/errors - if (errorSink.Warnings.Any() || errorSink.Errors.Any()) { - TaskProvider.ReplaceItems( - entry, - ParserTaskMoniker, - errorSink.Warnings - .Where(ShouldIncludeWarning) - .Select(er => f.FromParseWarning(er)) - .Concat(errorSink.Errors.Select(er => f.FromParseError(er))) - .ToList() - ); - } else { - TaskProvider.Clear(entry, ParserTaskMoniker); - } -#if FALSE - // Add a handler for the next complete analysis - _unresolvedSquiggles.ListenForNextNewAnalysis(entry as IJsProjectEntry); -#endif } private bool ShouldIncludeWarning(ErrorResult error) { diff --git a/Nodejs/Product/Nodejs/Nodejs.csproj b/Nodejs/Product/Nodejs/Nodejs.csproj index d52bbb1ff..0cfb9bde2 100644 --- a/Nodejs/Product/Nodejs/Nodejs.csproj +++ b/Nodejs/Product/Nodejs/Nodejs.csproj @@ -303,12 +303,6 @@ Component - - UserControl - - - NodeLsIntellisenseOptionsControl.cs - Component @@ -674,10 +668,6 @@ DiagnosticsForm.cs - - NodeLsIntellisenseOptionsControl.cs - Designer - NodejsNpmOptionsControl.cs diff --git a/Nodejs/Product/Nodejs/NodejsPackage.cs b/Nodejs/Product/Nodejs/NodejsPackage.cs index 516c9d297..9aba8a64f 100644 --- a/Nodejs/Product/Nodejs/NodejsPackage.cs +++ b/Nodejs/Product/Nodejs/NodejsPackage.cs @@ -241,10 +241,6 @@ protected override void Initialize() { MakeDebuggerContextAvailable(); - IntellisenseOptionsPage.AnalysisLogMaximumChanged += IntellisenseOptionsPage_AnalysisLogMaximumChanged; - IntellisenseOptionsPage.AnalysisLevelChanged += IntellisenseOptionsPageAnalysisLevelChanged; - IntellisenseOptionsPage.SaveToDiskChanged += IntellisenseOptionsPageSaveToDiskChanged; - InitializeLogging(); InitializeTelemetry(); @@ -282,19 +278,12 @@ private void SubscribeToVsCommandEvents( _subscribedCommandEvents.Add(targetEvent); } - - private void IntellisenseOptionsPage_AnalysisLogMaximumChanged(object sender, EventArgs e) { - if (_analyzer != null) { - _analyzer.MaxLogLength = IntellisenseOptionsPage.AnalysisLogMax; - } - } - private void InitializeLogging() { _logger = new NodejsToolsLogger(ComponentModel.GetExtensions().ToArray()); // log interesting stats on startup _logger.LogEvent(NodejsToolsLogEvent.SurveyNewsFrequency, GeneralOptionsPage.SurveyNewsCheck); - _logger.LogEvent(NodejsToolsLogEvent.AnalysisLevel, IntellisenseOptionsPage.AnalysisLevel); + _logger.LogEvent(NodejsToolsLogEvent.AnalysisLevel, AnalysisLevel.Preview); } private void InitializeTelemetry() { @@ -603,31 +592,12 @@ internal VsProjectAnalyzer DefaultAnalyzer { if (_analyzer == null) { _analyzer = CreateLooseVsProjectAnalyzer(); LogLooseFileAnalysisLevel(); - _analyzer.MaxLogLength = IntellisenseOptionsPage.AnalysisLogMax; + _analyzer.MaxLogLength = 100; } return _analyzer; } } - private void IntellisenseOptionsPageSaveToDiskChanged(object sender, EventArgs e) { - if (_analyzer != null) { - _analyzer.SaveToDisk = IntellisenseOptionsPage.SaveToDisk; - } - } - - private void IntellisenseOptionsPageAnalysisLevelChanged(object sender, EventArgs e) { - if (_analyzer != null) { - var analyzer = CreateLooseVsProjectAnalyzer(); - analyzer.SwitchAnalyzers(_analyzer); - if (_analyzer.RemoveUser()) { - _analyzer.Dispose(); - } - _analyzer = analyzer; - LogLooseFileAnalysisLevel(); - } - TelemetryLogger.LogAnalysisLevelChanged(IntellisenseOptionsPage.AnalysisLevel); - } - private VsProjectAnalyzer CreateLooseVsProjectAnalyzer() { // In ES6 IntelliSense mode, rather than overriding the default JS editor, // we throw to Salsa. If Salsa detects that it's not operating within the Node.js project context, @@ -639,7 +609,7 @@ private VsProjectAnalyzer CreateLooseVsProjectAnalyzer() { // we do not throw to Salsa from the REPL window. However, in order to provide a workable editing // experience within the REPL context, we initialize the loose analyzer with Quick IntelliSense // during ES6 mode. - var analysisLevel = IntellisenseOptionsPage.AnalysisLevel == AnalysisLevel.Preview ? AnalysisLevel.NodeLsMedium : IntellisenseOptionsPage.AnalysisLevel; + var analysisLevel = AnalysisLevel.NodeLsMedium; return new VsProjectAnalyzer(analysisLevel, false); } diff --git a/Nodejs/Product/Nodejs/NodejsProject.cs b/Nodejs/Product/Nodejs/NodejsProject.cs index 38dd482ce..3f3b6d9dd 100644 --- a/Nodejs/Product/Nodejs/NodejsProject.cs +++ b/Nodejs/Product/Nodejs/NodejsProject.cs @@ -544,7 +544,7 @@ private int OpenWithNodejsEditor(uint selectionItemId) { var properties = GetExtensionObject(_innerVsHierarchy, selectionItemId).Properties; try { var itemType = properties.Item("ItemType").Value; - ourEditor = (string)itemType == ProjectFileConstants.Compile && !IsES6IntellisensePreview() ? Guids.NodejsEditorFactory : Guid.Empty; + ourEditor = Guid.Empty; } catch (ArgumentException) { // no item type, file is excluded from project. ourEditor = Guids.NodejsEditorFactory; @@ -572,11 +572,6 @@ out frame return hr; } - private bool IsES6IntellisensePreview() { - // If the analysis level is set to preview then use the TypeScript language service for node.js - return NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevel == Options.AnalysisLevel.Preview; - } - #region IVsProject Members public int AddItem(uint itemidLoc, VSADDITEMOPERATION dwAddItemOperation, string pszItemName, uint cFilesToOpen, string[] rgpszFilesToOpen, IntPtr hwndDlgOwner, VSADDRESULT[] pResult) { @@ -600,7 +595,7 @@ public int AddItem(uint itemidLoc, VSADDITEMOPERATION dwAddItemOperation, string } if (!isClientCode && _innerProject3 != null && IsJavaScriptFile(pszItemName)) { - Guid ourEditor = IsES6IntellisensePreview() ? Guid.Empty : typeof(NodejsEditorFactory).GUID; + Guid ourEditor = Guid.Empty; Guid view = Guid.Empty; return _innerProject3.AddItemWithSpecific( itemidLoc, @@ -640,7 +635,7 @@ public int IsDocumentInProject(string pszMkDocument, out int pfFound, VSDOCUMENT public int OpenItem(uint itemid, ref Guid rguidLogicalView, IntPtr punkDocDataExisting, out IVsWindowFrame ppWindowFrame) { if (_innerProject3 != null && IsJavaScriptFile(GetItemName(_innerVsHierarchy, itemid))) { // force .js files opened w/o an editor type to be opened w/ our editor factory. - Guid guid = IsES6IntellisensePreview() ? Guid.Empty : typeof(NodejsEditorFactory).GUID; + Guid guid = Guid.Empty; Guid view = Guid.Empty; int hr = _innerProject3.OpenItemWithSpecific( itemid, @@ -675,7 +670,7 @@ public int ReopenItem(uint itemid, ref Guid rguidEditorType, string pszPhysicalV // force .js files opened w/o an editor type to be opened w/ our editor factory. // If the item type of this file is not compile, we don't actually want to open with Nodejs and should instead use the default. var itemType = GetExtensionObject(_innerVsHierarchy, itemid).Properties.Item("ItemType").Value; - Guid guid = (string)itemType == ProjectFileConstants.Compile && !IsES6IntellisensePreview() ? Guids.NodejsEditorFactory : Guid.Empty; + Guid guid = Guid.Empty; return _innerProject3.ReopenItem( itemid, diff --git a/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.Designer.cs b/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.Designer.cs deleted file mode 100644 index 93c76e42e..000000000 --- a/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.Designer.cs +++ /dev/null @@ -1,212 +0,0 @@ -namespace Microsoft.NodejsTools.Options { - partial class NodeLsIntellisenseOptionsControl { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) { - if (disposing && (components != null)) { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.ToolTip toolTip; - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NodeLsIntellisenseOptionsControl)); - this._saveToDiskDisabledRadioButton = new System.Windows.Forms.RadioButton(); - this._saveToDiskEnabledRadioButton = new System.Windows.Forms.RadioButton(); - this._mediumIntelliSenseRadioButton = new System.Windows.Forms.RadioButton(); - this._noIntelliSenseRadioButton = new System.Windows.Forms.RadioButton(); - this._fullIntelliSenseRadioButton = new System.Windows.Forms.RadioButton(); - this.outerLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this.statementCompletionLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this._showCompletionListAfterCharacterTyped = new System.Windows.Forms.CheckBox(); - this._onlyTabOrEnterToCommit = new System.Windows.Forms.CheckBox(); - this.statementCompletionLabel = new System.Windows.Forms.Label(); - this.saveToDiskLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this.saveToDiskLabel = new System.Windows.Forms.Label(); - this.intelliSenseLevelLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this._analysisLogMax = new System.Windows.Forms.ComboBox(); - this._analysisLogMaxLabel = new System.Windows.Forms.Label(); - this.intelliSenseLevelLabel = new System.Windows.Forms.Label(); - toolTip = new System.Windows.Forms.ToolTip(this.components); - this.outerLayoutPanel.SuspendLayout(); - this.statementCompletionLayoutPanel.SuspendLayout(); - this.saveToDiskLayoutPanel.SuspendLayout(); - this.intelliSenseLevelLayoutPanel.SuspendLayout(); - this.SuspendLayout(); - // - // _saveToDiskDisabledRadioButton - // - resources.ApplyResources(this._saveToDiskDisabledRadioButton, "_saveToDiskDisabledRadioButton"); - this._saveToDiskDisabledRadioButton.Name = "_saveToDiskDisabledRadioButton"; - this._saveToDiskDisabledRadioButton.TabStop = true; - toolTip.SetToolTip(this._saveToDiskDisabledRadioButton, resources.GetString("_saveToDiskDisabledRadioButton.ToolTip")); - this._saveToDiskDisabledRadioButton.UseVisualStyleBackColor = true; - // - // _saveToDiskEnabledRadioButton - // - resources.ApplyResources(this._saveToDiskEnabledRadioButton, "_saveToDiskEnabledRadioButton"); - this._saveToDiskEnabledRadioButton.Name = "_saveToDiskEnabledRadioButton"; - this._saveToDiskEnabledRadioButton.TabStop = true; - toolTip.SetToolTip(this._saveToDiskEnabledRadioButton, resources.GetString("_saveToDiskEnabledRadioButton.ToolTip")); - this._saveToDiskEnabledRadioButton.UseVisualStyleBackColor = true; - // - // _mediumIntelliSenseRadioButton - // - resources.ApplyResources(this._mediumIntelliSenseRadioButton, "_mediumIntelliSenseRadioButton"); - this._mediumIntelliSenseRadioButton.Name = "_mediumIntelliSenseRadioButton"; - this._mediumIntelliSenseRadioButton.TabStop = true; - toolTip.SetToolTip(this._mediumIntelliSenseRadioButton, resources.GetString("_mediumIntelliSenseRadioButton.ToolTip")); - this._mediumIntelliSenseRadioButton.UseVisualStyleBackColor = true; - // - // _noIntelliSenseRadioButton - // - resources.ApplyResources(this._noIntelliSenseRadioButton, "_noIntelliSenseRadioButton"); - this._noIntelliSenseRadioButton.Name = "_noIntelliSenseRadioButton"; - this._noIntelliSenseRadioButton.TabStop = true; - toolTip.SetToolTip(this._noIntelliSenseRadioButton, resources.GetString("_noIntelliSenseRadioButton.ToolTip")); - this._noIntelliSenseRadioButton.UseVisualStyleBackColor = true; - // - // _fullIntelliSenseRadioButton - // - resources.ApplyResources(this._fullIntelliSenseRadioButton, "_fullIntelliSenseRadioButton"); - this._fullIntelliSenseRadioButton.Name = "_fullIntelliSenseRadioButton"; - this._fullIntelliSenseRadioButton.TabStop = true; - toolTip.SetToolTip(this._fullIntelliSenseRadioButton, resources.GetString("_fullIntelliSenseRadioButton.ToolTip")); - this._fullIntelliSenseRadioButton.UseVisualStyleBackColor = true; - // - // outerLayoutPanel - // - resources.ApplyResources(this.outerLayoutPanel, "outerLayoutPanel"); - this.outerLayoutPanel.Controls.Add(this.statementCompletionLayoutPanel, 0, 5); - this.outerLayoutPanel.Controls.Add(this.statementCompletionLabel, 0, 4); - this.outerLayoutPanel.Controls.Add(this.saveToDiskLayoutPanel, 0, 3); - this.outerLayoutPanel.Controls.Add(this.saveToDiskLabel, 0, 2); - this.outerLayoutPanel.Controls.Add(this.intelliSenseLevelLayoutPanel, 0, 1); - this.outerLayoutPanel.Controls.Add(this.intelliSenseLevelLabel, 0, 0); - this.outerLayoutPanel.Name = "outerLayoutPanel"; - // - // statementCompletionLayoutPanel - // - resources.ApplyResources(this.statementCompletionLayoutPanel, "statementCompletionLayoutPanel"); - this.statementCompletionLayoutPanel.Controls.Add(this._showCompletionListAfterCharacterTyped, 0, 1); - this.statementCompletionLayoutPanel.Controls.Add(this._onlyTabOrEnterToCommit, 0, 0); - this.statementCompletionLayoutPanel.Name = "statementCompletionLayoutPanel"; - // - // _showCompletionListAfterCharacterTyped - // - resources.ApplyResources(this._showCompletionListAfterCharacterTyped, "_showCompletionListAfterCharacterTyped"); - this._showCompletionListAfterCharacterTyped.Name = "_showCompletionListAfterCharacterTyped"; - this._showCompletionListAfterCharacterTyped.UseVisualStyleBackColor = true; - // - // _onlyTabOrEnterToCommit - // - resources.ApplyResources(this._onlyTabOrEnterToCommit, "_onlyTabOrEnterToCommit"); - this._onlyTabOrEnterToCommit.Name = "_onlyTabOrEnterToCommit"; - this._onlyTabOrEnterToCommit.UseVisualStyleBackColor = true; - // - // statementCompletionLabel - // - resources.ApplyResources(this.statementCompletionLabel, "statementCompletionLabel"); - this.statementCompletionLabel.Name = "statementCompletionLabel"; - // - // saveToDiskLayoutPanel - // - resources.ApplyResources(this.saveToDiskLayoutPanel, "saveToDiskLayoutPanel"); - this.saveToDiskLayoutPanel.Controls.Add(this._saveToDiskDisabledRadioButton, 0, 1); - this.saveToDiskLayoutPanel.Controls.Add(this._saveToDiskEnabledRadioButton, 0, 0); - this.saveToDiskLayoutPanel.Name = "saveToDiskLayoutPanel"; - // - // saveToDiskLabel - // - resources.ApplyResources(this.saveToDiskLabel, "saveToDiskLabel"); - this.saveToDiskLabel.Name = "saveToDiskLabel"; - // - // intelliSenseLevelLayoutPanel - // - resources.ApplyResources(this.intelliSenseLevelLayoutPanel, "intelliSenseLevelLayoutPanel"); - this.intelliSenseLevelLayoutPanel.Controls.Add(this._mediumIntelliSenseRadioButton, 0, 2); - this.intelliSenseLevelLayoutPanel.Controls.Add(this._analysisLogMax, 1, 5); - this.intelliSenseLevelLayoutPanel.Controls.Add(this._noIntelliSenseRadioButton, 0, 3); - this.intelliSenseLevelLayoutPanel.Controls.Add(this._analysisLogMaxLabel, 0, 5); - this.intelliSenseLevelLayoutPanel.Controls.Add(this._fullIntelliSenseRadioButton, 0, 0); - this.intelliSenseLevelLayoutPanel.Name = "intelliSenseLevelLayoutPanel"; - // - // _analysisLogMax - // - resources.ApplyResources(this._analysisLogMax, "_analysisLogMax"); - this._analysisLogMax.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._analysisLogMax.FormattingEnabled = true; - this._analysisLogMax.Items.AddRange(new object[] { - resources.GetString("_analysisLogMax.Items"), - resources.GetString("_analysisLogMax.Items1"), - resources.GetString("_analysisLogMax.Items2"), - resources.GetString("_analysisLogMax.Items3"), - resources.GetString("_analysisLogMax.Items4"), - resources.GetString("_analysisLogMax.Items5"), - resources.GetString("_analysisLogMax.Items6")}); - this._analysisLogMax.Name = "_analysisLogMax"; - // - // _analysisLogMaxLabel - // - resources.ApplyResources(this._analysisLogMaxLabel, "_analysisLogMaxLabel"); - this._analysisLogMaxLabel.Name = "_analysisLogMaxLabel"; - // - // intelliSenseLevelLabel - // - resources.ApplyResources(this.intelliSenseLevelLabel, "intelliSenseLevelLabel"); - this.intelliSenseLevelLabel.Name = "intelliSenseLevelLabel"; - // - // NodeLsIntellisenseOptionsControl - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.outerLayoutPanel); - this.Name = "NodeLsIntellisenseOptionsControl"; - this.outerLayoutPanel.ResumeLayout(false); - this.outerLayoutPanel.PerformLayout(); - this.statementCompletionLayoutPanel.ResumeLayout(false); - this.statementCompletionLayoutPanel.PerformLayout(); - this.saveToDiskLayoutPanel.ResumeLayout(false); - this.saveToDiskLayoutPanel.PerformLayout(); - this.intelliSenseLevelLayoutPanel.ResumeLayout(false); - this.intelliSenseLevelLayoutPanel.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TableLayoutPanel outerLayoutPanel; - private System.Windows.Forms.TableLayoutPanel statementCompletionLayoutPanel; - private System.Windows.Forms.CheckBox _showCompletionListAfterCharacterTyped; - private System.Windows.Forms.CheckBox _onlyTabOrEnterToCommit; - private System.Windows.Forms.Label statementCompletionLabel; - private System.Windows.Forms.TableLayoutPanel saveToDiskLayoutPanel; - private System.Windows.Forms.RadioButton _saveToDiskDisabledRadioButton; - private System.Windows.Forms.RadioButton _saveToDiskEnabledRadioButton; - private System.Windows.Forms.Label saveToDiskLabel; - private System.Windows.Forms.TableLayoutPanel intelliSenseLevelLayoutPanel; - private System.Windows.Forms.RadioButton _mediumIntelliSenseRadioButton; - private System.Windows.Forms.ComboBox _analysisLogMax; - private System.Windows.Forms.RadioButton _noIntelliSenseRadioButton; - private System.Windows.Forms.Label _analysisLogMaxLabel; - private System.Windows.Forms.RadioButton _fullIntelliSenseRadioButton; - private System.Windows.Forms.Label intelliSenseLevelLabel; - } -} diff --git a/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.cs b/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.cs deleted file mode 100644 index 8febbc4d8..000000000 --- a/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.cs +++ /dev/null @@ -1,134 +0,0 @@ -//*********************************************************// -// Copyright (c) Microsoft. All rights reserved. -// -// Apache 2.0 License -// -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -// implied. See the License for the specific language governing -// permissions and limitations under the License. -// -//*********************************************************// - -using System; -using System.Diagnostics; -using System.Windows.Forms; - -namespace Microsoft.NodejsTools.Options { - public partial class NodeLsIntellisenseOptionsControl : UserControl { - public NodeLsIntellisenseOptionsControl() { - InitializeComponent(); - } - - internal bool SaveToDisk { - get { - return _saveToDiskEnabledRadioButton.Checked; - } - set { - if (value == true) { - _saveToDiskEnabledRadioButton.Checked = true; - } else { - _saveToDiskDisabledRadioButton.Checked = true; - } - } - } - - internal AnalysisLevel AnalysisLevel { - get { - if (_fullIntelliSenseRadioButton.Checked) { - return AnalysisLevel.NodeLsHigh; - } else if (_mediumIntelliSenseRadioButton.Checked) { - return AnalysisLevel.NodeLsMedium; - } else { - return AnalysisLevel.NodeLsNone; - } - } - set { - switch (value) { - case AnalysisLevel.Preview: - // Set default ES5 IntelliSense level - this setting will not take effect if ES6 Preview is enabled. - _mediumIntelliSenseRadioButton.Checked = true; - break; - case AnalysisLevel.NodeLsHigh: - _fullIntelliSenseRadioButton.Checked = true; - break; - case AnalysisLevel.NodeLsMedium: - _mediumIntelliSenseRadioButton.Checked = true; - break; - case AnalysisLevel.NodeLsNone: - _noIntelliSenseRadioButton.Checked = true; - break; - default: - Debug.Fail("Unrecognized AnalysisLevel: " + value); - break; - } - } - } - - internal int AnalysisLogMaximum { - get { - int max; - // The Max Value is described by 'Max' instead of 'Int32.MaxValue' - if (_analysisLogMax.Text == "Max") { - return Int32.MaxValue; - } - if (Int32.TryParse(_analysisLogMax.Text, out max)) { - return max; - } - return 0; - } - set { - if (value == 0) { - _analysisLogMax.SelectedIndex = 0; - return; - } - // Handle case where value is the Max. - string index = value == Int32.MaxValue ? "Max" : value.ToString(); - for (int i = 0; i < _analysisLogMax.Items.Count; i++) { - if (_analysisLogMax.Items[i].ToString() == index) { - _analysisLogMax.SelectedIndex = i; - return; - } - } - - _analysisLogMax.Text = index; - } - } - - internal bool OnlyTabOrEnterToCommit { - get { - return _onlyTabOrEnterToCommit.Checked; - } - set { - _onlyTabOrEnterToCommit.Checked = value; - } - } - - internal bool ShowCompletionListAfterCharacterTyped { - get { - return _showCompletionListAfterCharacterTyped.Checked; - } - set { - _showCompletionListAfterCharacterTyped.Checked = value; - } - } - - internal void SyncPageWithControlSettings(NodejsIntellisenseOptionsPage page) { - page.AnalysisLogMax = AnalysisLogMaximum; - page.SaveToDisk = SaveToDisk; - page.OnlyTabOrEnterToCommit = OnlyTabOrEnterToCommit; - page.ShowCompletionListAfterCharacterTyped = ShowCompletionListAfterCharacterTyped; - } - - internal void SyncControlWithPageSettings(NodejsIntellisenseOptionsPage page) { - AnalysisLogMaximum = page.AnalysisLogMax; - SaveToDisk = page.SaveToDisk; - OnlyTabOrEnterToCommit = page.OnlyTabOrEnterToCommit; - ShowCompletionListAfterCharacterTyped = page.ShowCompletionListAfterCharacterTyped; - } - } -} diff --git a/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.resx b/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.resx deleted file mode 100644 index 889ad78ec..000000000 --- a/Nodejs/Product/Nodejs/Options/NodeLsIntellisenseOptionsControl.resx +++ /dev/null @@ -1,808 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - 17, 17 - - - - True - - - - NoControl - - - - 12, 38 - - - 12, 3, 12, 3 - - - 566, 29 - - - 1 - - - Disab&led (Existing IntelliSense file is deleted from disk) - - - Does not save IntelliSense results to disk. IntelliSense results are recreated on each project load. Can result in poor IntelliSense expierence at startup and huge performance penalty. - - - - _saveToDiskDisabledRadioButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - saveToDiskLayoutPanel - - - 0 - - - True - - - Top - - - TopCenter - - - NoControl - - - 12, 3 - - - 12, 3, 12, 3 - - - 578, 29 - - - 0 - - - Ena&bled - - - Saves analysis data to disk for faster analysis - - - _saveToDiskEnabledRadioButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - saveToDiskLayoutPanel - - - 1 - - - True - - - NoControl - - - 12, 38 - - - 12, 3, 12, 3 - - - 215, 29 - - - 1 - - - &Quick IntelliSense - - - Limited completions (reduced memory/CPU usage) - - - _mediumIntelliSenseRadioButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseLevelLayoutPanel - - - 0 - - - True - - - NoControl - - - 12, 73 - - - 12, 3, 12, 3 - - - 187, 29 - - - 2 - - - &No IntelliSense - - - No completions (minimum memory/CPU usage) - - - _noIntelliSenseRadioButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseLevelLayoutPanel - - - 2 - - - True - - - NoControl - - - 12, 3 - - - 12, 3, 12, 3 - - - 195, 29 - - - 0 - - - &Full IntelliSense - - - Best completions (substantial memory/CPU usage) - - - _fullIntelliSenseRadioButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseLevelLayoutPanel - - - 4 - - - True - - - GrowAndShrink - - - 1 - - - True - - - GrowAndShrink - - - 1 - - - _showCompletionListAfterCharacterTyped - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - statementCompletionLayoutPanel - - - 0 - - - _onlyTabOrEnterToCommit - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - statementCompletionLayoutPanel - - - 1 - - - Fill - - - 6, 335 - - - 6, 8, 6, 8 - - - 2 - - - 602, 70 - - - 5 - - - statementCompletionLayoutPanel - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - outerLayoutPanel - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_showCompletionListAfterCharacterTyped" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_onlyTabOrEnterToCommit" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0" /></TableLayoutSettings> - - - True - - - NoControl - - - 0, 302 - - - 0, 0, 0, 0 - - - 223, 25 - - - 4 - - - Statement Completion - - - statementCompletionLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - outerLayoutPanel - - - 1 - - - True - - - GrowAndShrink - - - 1 - - - Fill - - - 6, 224 - - - 6, 8, 6, 8 - - - 4 - - - 602, 70 - - - 3 - - - saveToDiskLayoutPanel - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - outerLayoutPanel - - - 2 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_saveToDiskDisabledRadioButton" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_saveToDiskEnabledRadioButton" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="Percent,100,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> - - - True - - - NoControl - - - 0, 191 - - - 0, 0, 0, 0 - - - 140, 25 - - - 2 - - - Save To Disk - - - saveToDiskLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - outerLayoutPanel - - - 3 - - - True - - - GrowAndShrink - - - 2 - - - _analysisLogMax - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseLevelLayoutPanel - - - 1 - - - _analysisLogMaxLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseLevelLayoutPanel - - - 3 - - - Fill - - - 6, 33 - - - 6, 8, 6, 8 - - - 6 - - - 602, 150 - - - 1 - - - intelliSenseLevelLayoutPanel - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - outerLayoutPanel - - - 4 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_mediumIntelliSenseRadioButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_analysisLogMax" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="_noIntelliSenseRadioButton" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_analysisLogMaxLabel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_fullIntelliSenseRadioButton" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="Percent,100,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,39" /></TableLayoutSettings> - - - True - - - NoControl - - - 0, 0 - - - 0, 0, 0, 0 - - - 181, 25 - - - 0 - - - IntelliSense Level - - - intelliSenseLevelLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - outerLayoutPanel - - - 5 - - - Top - - - 0, 0 - - - 0, 0, 0, 0 - - - 6 - - - 614, 413 - - - 5 - - - outerLayoutPanel - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="statementCompletionLayoutPanel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="statementCompletionLabel" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="saveToDiskLayoutPanel" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="saveToDiskLabel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="intelliSenseLevelLayoutPanel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="intelliSenseLevelLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings> - - - True - - - NoControl - - - 12, 38 - - - 12, 3, 12, 3 - - - 484, 29 - - - 1 - - - &Show completion list after a character is typed - - - _showCompletionListAfterCharacterTyped - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - statementCompletionLayoutPanel - - - 0 - - - True - - - NoControl - - - 12, 3 - - - 12, 3, 12, 3 - - - 352, 29 - - - 0 - - - Only use &Tab or Enter to commit - - - _onlyTabOrEnterToCommit - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - statementCompletionLayoutPanel - - - 1 - - - Left - - - Off - - - 100 - - - 1000 - - - 10000 - - - 100000 - - - 1000000 - - - Max - - - 298, 111 - - - 12, 6, 12, 6 - - - 246, 33 - - - 4 - - - _analysisLogMax - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseLevelLayoutPanel - - - 1 - - - Left - - - True - - - NoControl - - - 12, 115 - - - 12, 6, 12, 6 - - - 262, 25 - - - 3 - - - IntelliSense log entry limit: - - - _analysisLogMaxLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseLevelLayoutPanel - - - 3 - - - True - - - 57 - - - 12, 25 - - - GrowAndShrink - - - 614, 414 - - - toolTip - - - System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NodeLsIntellisenseOptionsControl - - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.cs b/Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.cs index 166e4d4e7..3d5e5078c 100644 --- a/Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.cs +++ b/Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.cs @@ -69,7 +69,7 @@ internal void SyncControlWithPageSettings(NodejsGeneralOptionsPage page) { _showBrowserAndNodeLabels.Checked = page.ShowBrowserAndNodeLabels; // Disable the show "browser" and "node" labels option when the user is in ES6 IntelliSense Preview mode - _showBrowserAndNodeLabels.Enabled = NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevel != AnalysisLevel.Preview; + _showBrowserAndNodeLabels.Enabled = false; } internal void SyncPageWithControlSettings(NodejsGeneralOptionsPage page) { diff --git a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs index 17e10af4e..a8998a7f9 100644 --- a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs +++ b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs @@ -28,70 +28,30 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NodejsIntellisenseOptionsControl)); this.outerLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.advancedOptionsLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this.intelliSenseModeLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this._intelliSenseModeDropdown = new System.Windows.Forms.ComboBox(); - this.intelliSenseModeLabel = new System.Windows.Forms.Label(); - this._analysisPreviewFeedbackLinkLabel = new System.Windows.Forms.LinkLabel(); - this._es5DeprecatedWarning = new System.Windows.Forms.Label(); - this.horizontalDivider = new System.Windows.Forms.Label(); - this._nodejsES5IntelliSenseOptionsControl = new Microsoft.NodejsTools.Options.NodeLsIntellisenseOptionsControl(); this._salsaLsIntellisenseOptionsControl = new Microsoft.NodejsTools.Options.SalsaLsIntellisenseOptionsControl(); - this._es6BottomPadding = new System.Windows.Forms.Label(); + this.horizontalDivider = new System.Windows.Forms.Label(); toolTip = new System.Windows.Forms.ToolTip(this.components); this.outerLayoutPanel.SuspendLayout(); this.advancedOptionsLayoutPanel.SuspendLayout(); - this.intelliSenseModeLayoutPanel.SuspendLayout(); this.SuspendLayout(); // // outerLayoutPanel // resources.ApplyResources(this.outerLayoutPanel, "outerLayoutPanel"); this.outerLayoutPanel.Controls.Add(this.advancedOptionsLayoutPanel, 0, 2); - this.outerLayoutPanel.Controls.Add(this.intelliSenseModeLayoutPanel, 0, 0); this.outerLayoutPanel.Controls.Add(this.horizontalDivider, 0, 1); this.outerLayoutPanel.Name = "outerLayoutPanel"; // // advancedOptionsLayoutPanel // resources.ApplyResources(this.advancedOptionsLayoutPanel, "advancedOptionsLayoutPanel"); - this.advancedOptionsLayoutPanel.Controls.Add(this._nodejsES5IntelliSenseOptionsControl, 0, 1); this.advancedOptionsLayoutPanel.Controls.Add(this._salsaLsIntellisenseOptionsControl, 0, 0); this.advancedOptionsLayoutPanel.Name = "advancedOptionsLayoutPanel"; // - // intelliSenseModeLayoutPanel - // - resources.ApplyResources(this.intelliSenseModeLayoutPanel, "intelliSenseModeLayoutPanel"); - this.intelliSenseModeLayoutPanel.Controls.Add(this._intelliSenseModeDropdown, 1, 0); - this.intelliSenseModeLayoutPanel.Controls.Add(this.intelliSenseModeLabel, 0, 0); - this.intelliSenseModeLayoutPanel.Controls.Add(this._analysisPreviewFeedbackLinkLabel, 1, 2); - this.intelliSenseModeLayoutPanel.Controls.Add(this._es5DeprecatedWarning, 1, 1); - this.intelliSenseModeLayoutPanel.Controls.Add(this._es6BottomPadding, 1, 3); - this.intelliSenseModeLayoutPanel.Name = "intelliSenseModeLayoutPanel"; - // - // _intelliSenseModeDropdown - // - this._intelliSenseModeDropdown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._intelliSenseModeDropdown.FormattingEnabled = true; - resources.ApplyResources(this._intelliSenseModeDropdown, "_intelliSenseModeDropdown"); - this._intelliSenseModeDropdown.Name = "_intelliSenseModeDropdown"; - this._intelliSenseModeDropdown.SelectedValueChanged += new System.EventHandler(this._intelliSenseModeDropdown_SelectedValueChanged); - // - // intelliSenseModeLabel - // - resources.ApplyResources(this.intelliSenseModeLabel, "intelliSenseModeLabel"); - this.intelliSenseModeLabel.Name = "intelliSenseModeLabel"; - // - // _analysisPreviewFeedbackLinkLabel - // - resources.ApplyResources(this._analysisPreviewFeedbackLinkLabel, "_analysisPreviewFeedbackLinkLabel"); - this._analysisPreviewFeedbackLinkLabel.Name = "_analysisPreviewFeedbackLinkLabel"; - this._analysisPreviewFeedbackLinkLabel.TabStop = true; - this._analysisPreviewFeedbackLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this._analysisPreviewFeedbackLinkLabel_LinkClicked); - // - // _es5DeprecatedWarning + // _salsaLsIntellisenseOptionsControl // - resources.ApplyResources(this._es5DeprecatedWarning, "_es5DeprecatedWarning"); - this._es5DeprecatedWarning.Name = "_es5DeprecatedWarning"; + resources.ApplyResources(this._salsaLsIntellisenseOptionsControl, "_salsaLsIntellisenseOptionsControl"); + this._salsaLsIntellisenseOptionsControl.Name = "_salsaLsIntellisenseOptionsControl"; // // horizontalDivider // @@ -100,22 +60,6 @@ private void InitializeComponent() { this.horizontalDivider.ForeColor = System.Drawing.SystemColors.Control; this.horizontalDivider.Name = "horizontalDivider"; // - // _nodejsES5IntelliSenseOptionsControl - // - resources.ApplyResources(this._nodejsES5IntelliSenseOptionsControl, "_nodejsES5IntelliSenseOptionsControl"); - this._nodejsES5IntelliSenseOptionsControl.Name = "_nodejsES5IntelliSenseOptionsControl"; - // - // _salsaLsIntellisenseOptionsControl - // - resources.ApplyResources(this._salsaLsIntellisenseOptionsControl, "_salsaLsIntellisenseOptionsControl"); - this._salsaLsIntellisenseOptionsControl.Name = "_salsaLsIntellisenseOptionsControl"; - // - // _es6BottomPadding - // - resources.ApplyResources(this._es6BottomPadding, "_es6BottomPadding"); - this._es6BottomPadding.ForeColor = System.Drawing.SystemColors.Control; - this._es6BottomPadding.Name = "_es6BottomPadding"; - // // NodejsIntellisenseOptionsControl // resources.ApplyResources(this, "$this"); @@ -126,8 +70,6 @@ private void InitializeComponent() { this.outerLayoutPanel.PerformLayout(); this.advancedOptionsLayoutPanel.ResumeLayout(false); this.advancedOptionsLayoutPanel.PerformLayout(); - this.intelliSenseModeLayoutPanel.ResumeLayout(false); - this.intelliSenseModeLayoutPanel.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -137,14 +79,7 @@ private void InitializeComponent() { private System.Windows.Forms.TableLayoutPanel outerLayoutPanel; private System.Windows.Forms.TableLayoutPanel advancedOptionsLayoutPanel; - private NodeLsIntellisenseOptionsControl _nodejsES5IntelliSenseOptionsControl; private SalsaLsIntellisenseOptionsControl _salsaLsIntellisenseOptionsControl; - private System.Windows.Forms.TableLayoutPanel intelliSenseModeLayoutPanel; - private System.Windows.Forms.Label intelliSenseModeLabel; private System.Windows.Forms.Label horizontalDivider; - private System.Windows.Forms.ComboBox _intelliSenseModeDropdown; - private System.Windows.Forms.LinkLabel _analysisPreviewFeedbackLinkLabel; - private System.Windows.Forms.Label _es5DeprecatedWarning; - private System.Windows.Forms.Label _es6BottomPadding; } } diff --git a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.cs b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.cs index 54b7335b9..4c7987e6f 100644 --- a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.cs +++ b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.cs @@ -17,47 +17,18 @@ using System; using System.Diagnostics; using System.Windows.Forms; -using Microsoft.NodejsTools.Project; namespace Microsoft.NodejsTools.Options { public partial class NodejsIntellisenseOptionsControl : UserControl { - private static readonly object _ecmaScript5 = SR.GetString(SR.EcmaScript5); - private static readonly object _ecmaScript6 = SR.GetString(SR.EcmaScript6); - public NodejsIntellisenseOptionsControl() { InitializeComponent(); - _intelliSenseModeDropdown.Enabled = NodejsPackage.Instance.IntellisenseOptionsPage.EnableES6Preview; - _intelliSenseModeDropdown.Items.AddRange(new[] { - _ecmaScript6, - _ecmaScript5 - }); - } - - internal AnalysisLevel AnalysisLevel { - get { - if (_intelliSenseModeDropdown.SelectedItem == _ecmaScript6) { - return AnalysisLevel.Preview; - } else { - return _nodejsES5IntelliSenseOptionsControl.AnalysisLevel; - } - } - set { - _intelliSenseModeDropdown.SelectedItem = - value == AnalysisLevel.Preview ? _ecmaScript6 : _ecmaScript5; - - _nodejsES5IntelliSenseOptionsControl.AnalysisLevel = value; - } } internal void SyncPageWithControlSettings(NodejsIntellisenseOptionsPage page) { - page.AnalysisLevel = AnalysisLevel; - _nodejsES5IntelliSenseOptionsControl.SyncPageWithControlSettings(page); _salsaLsIntellisenseOptionsControl.SyncPageWithControlSettings(page); } internal void SyncControlWithPageSettings(NodejsIntellisenseOptionsPage page) { - AnalysisLevel = page.AnalysisLevel; - _nodejsES5IntelliSenseOptionsControl.SyncControlWithPageSettings(page); _salsaLsIntellisenseOptionsControl.SyncControlWithPageSettings(page); } @@ -66,16 +37,9 @@ private void _analysisPreviewFeedbackLinkLabel_LinkClicked(object sender, LinkLa } private void _intelliSenseModeDropdown_SelectedValueChanged(object sender, EventArgs e) { - bool isES6PreviewIntelliSense = _intelliSenseModeDropdown.SelectedItem == _ecmaScript6; - _nodejsES5IntelliSenseOptionsControl.Visible = !isES6PreviewIntelliSense; - _es5DeprecatedWarning.Visible = !isES6PreviewIntelliSense; - - // Enables us to auto-size the IntelliSense selection area without reflowing the entire page - _es6BottomPadding.Visible = isES6PreviewIntelliSense; - // IntelliSense Options are controlled by the built-in language service in DEV15+ #if DEV14 - _salsaLsIntellisenseOptionsControl.Visible = isES6PreviewIntelliSense; + _salsaLsIntellisenseOptionsControl.Visible = true; #else _salsaLsIntellisenseOptionsControl.Visible = false; #endif diff --git a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.resx b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.resx index ba67c3d57..ac12f3b92 100644 --- a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.resx +++ b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.resx @@ -143,43 +143,6 @@ 1 - - True - - - GrowAndShrink - - - Fill - - - - 0, 171 - - - 0, 0, 0, 0 - - - 614, 434 - - - 711, 434 - - - 1 - - - _nodejsES5IntelliSenseOptionsControl - - - Microsoft.NodejsTools.Options.NodeLsIntellisenseOptionsControl, Microsoft.NodejsTools, Version=1.0.2015.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - advancedOptionsLayoutPanel - - - 0 - True @@ -189,6 +152,7 @@ Fill + 0, 0 @@ -196,7 +160,7 @@ 0, 0, 0, 0 - 711, 171 + 356, 97 0 @@ -205,28 +169,28 @@ _salsaLsIntellisenseOptionsControl - Microsoft.NodejsTools.Options.SalsaLsIntellisenseOptionsControl, Microsoft.NodejsTools, Version=1.0.2015.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.NodejsTools.Options.SalsaLsIntellisenseOptionsControl, Microsoft.NodejsTools, Version=1.0.0.2015, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a advancedOptionsLayoutPanel - 1 + 0 Top - 12, 140 + 6, 7 - 12, 12, 12, 0 + 6, 6, 6, 0 2 - 711, 605 + 356, 97 2 @@ -244,193 +208,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_nodejsES5IntelliSenseOptionsControl" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_salsaLsIntellisenseOptionsControl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0" /></TableLayoutSettings> - - - True - - - GrowAndShrink - - - 2 - - - 192, 3 - - - 246, 33 - - - 1 - - - _intelliSenseModeDropdown - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseModeLayoutPanel - - - 0 - - - Left - - - True - - - NoControl - - - 0, 7 - - - 0, 0, 0, 0 - - - 189, 25 - - - 0 - - - IntelliSense Mode: - - - intelliSenseModeLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseModeLayoutPanel - - - 1 - - - True - - - NoControl - - - 189, 64 - - - 0, 0, 0, 0 - - - 310, 25 - - - 3 - - - Learn more and send feedback - - - _analysisPreviewFeedbackLinkLabel - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseModeLayoutPanel - - - 2 - - - True - - - NoControl - - - 192, 39 - - - 341, 25 - - - 2 - - - ⚠ ECMAScript 5 Mode deprecated - - - _es5DeprecatedWarning - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseModeLayoutPanel - - - 3 - - - True - - - 192, 89 - - - 0, 25 - - - 4 - - - _es6BottomPadding - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - intelliSenseModeLayoutPanel - - - 4 - - - Fill - - - 12, 0 - - - 12, 0, 12, 12 - - - 4 - - - 711, 114 - - - 0 - - - intelliSenseModeLayoutPanel - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - outerLayoutPanel - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_intelliSenseModeDropdown" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="intelliSenseModeLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_analysisPreviewFeedbackLinkLabel" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="_es5DeprecatedWarning" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="_es6BottomPadding" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_salsaLsIntellisenseOptionsControl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0" /></TableLayoutSettings> Top @@ -439,13 +217,13 @@ NoControl - 12, 126 + 6, 0 - 12, 0, 12, 0 + 6, 0, 6, 0 - 711, 2 + 356, 1 0 @@ -463,7 +241,7 @@ outerLayoutPanel - 2 + 1 Fill @@ -472,16 +250,16 @@ 0, 0 - 6, 8, 0, 8 + 3, 4, 0, 4 - 671, 500 + 336, 260 3 - 735, 745 + 368, 260 0 @@ -499,7 +277,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="advancedOptionsLayoutPanel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="intelliSenseModeLayoutPanel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="horizontalDivider" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="advancedOptionsLayoutPanel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="horizontalDivider" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> True @@ -508,7 +286,7 @@ 57 - 12, 25 + 6, 13 True @@ -520,10 +298,10 @@ GrowAndShrink - 6, 6, 0, 6 + 3, 3, 0, 3 - 735, 745 + 368, 260 toolTip diff --git a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs index cadf7c36f..a85dd1597 100644 --- a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs +++ b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs @@ -28,9 +28,6 @@ public class NodejsIntellisenseOptionsPage : NodejsDialogPage { private static readonly Version _typeScriptMinVersionForES6Preview = new Version("1.6"); private NodejsIntellisenseOptionsControl _window; - private AnalysisLevel _level; - private int _analysisLogMax; - private bool _saveToDisk; private readonly Lazy _enableES6Preview = new Lazy(() => { Version version; @@ -59,49 +56,6 @@ internal bool EnableES6Preview { get { return _enableES6Preview.Value; } } - internal bool SaveToDisk { - get { return _saveToDisk; } - set { - var oldState = _saveToDisk; - _saveToDisk = value; - if (oldState != _saveToDisk) { - SaveToDiskChanged?.Invoke(this, EventArgs.Empty); - } - } - } - - internal AnalysisLevel AnalysisLevel { - get { - return _level; - } - set { - var oldLevel = _level; - _level = value; - - // Fallback to quick intellisense (medium) if the ES6 intellisense preview isn't enabled - if (_level == AnalysisLevel.Preview && !EnableES6Preview) { - _level = AnalysisLevel.NodeLsMedium; - } - - if (oldLevel != _level) { - AnalysisLevelChanged?.Invoke(this, EventArgs.Empty); - } - } - } - - internal int AnalysisLogMax { - get { - return _analysisLogMax; - } - set { - var oldMax = _analysisLogMax; - _analysisLogMax = value; - if (oldMax != _analysisLogMax) { - AnalysisLogMaximumChanged?.Invoke(this, EventArgs.Empty); - } - } - } - internal bool OnlyTabOrEnterToCommit { get; set; } internal bool ShowCompletionListAfterCharacterTyped { get; set; } @@ -112,23 +66,14 @@ internal int AnalysisLogMax { internal bool SaveChangesToConfigFile { get; set; } - public event EventHandler AnalysisLevelChanged; - public event EventHandler AnalysisLogMaximumChanged; - public event EventHandler SaveToDiskChanged; - /// /// Resets settings back to their defaults. This should be followed by /// a call to to commit the new /// values. /// public override void ResetSettings() { - AnalysisLevel = AnalysisLevel.Preview; - AnalysisLogMax = 100; } - private const string AnalysisLevelSetting = "AnalysisLevel"; - private const string AnalysisLogMaximumSetting = "AnalysisLogMaximum"; - private const string SaveToDiskSetting = "SaveToDisk"; private const string OnlyTabOrEnterToCommitSetting = "OnlyTabOrEnterToCommit"; private const string ShowCompletionListAfterCharacterTypedSetting = "ShowCompletionListAfterCharacterTyped"; private const string EnableAutomaticTypingsAcquisitionSetting = "EnableAutomaticTypingsAcquisition"; @@ -137,9 +82,6 @@ public override void ResetSettings() { public override void LoadSettingsFromStorage() { // Load settings from storage. - AnalysisLevel = LoadEnum(AnalysisLevelSetting) ?? AnalysisLevel.Preview; - AnalysisLogMax = LoadInt(AnalysisLogMaximumSetting) ?? 100; - SaveToDisk = LoadBool(SaveToDiskSetting) ?? true; OnlyTabOrEnterToCommit = LoadBool(OnlyTabOrEnterToCommitSetting) ?? true; ShowCompletionListAfterCharacterTyped = LoadBool(ShowCompletionListAfterCharacterTypedSetting) ?? true; EnableAutomaticTypingsAcquisition = LoadBool(EnableAutomaticTypingsAcquisitionSetting) ?? true; @@ -165,9 +107,6 @@ public override void SaveSettingsToStorage() { } // Save settings. - SaveEnum(AnalysisLevelSetting, AnalysisLevel); - SaveInt(AnalysisLogMaximumSetting, AnalysisLogMax); - SaveBool(SaveToDiskSetting, SaveToDisk); SaveBool(OnlyTabOrEnterToCommitSetting, OnlyTabOrEnterToCommit); SaveBool(ShowCompletionListAfterCharacterTypedSetting, ShowCompletionListAfterCharacterTyped); SaveBool(EnableAutomaticTypingsAcquisitionSetting, EnableAutomaticTypingsAcquisition); diff --git a/Nodejs/Product/Nodejs/Project/NodejsFolderNode.cs b/Nodejs/Product/Nodejs/Project/NodejsFolderNode.cs index c4a1b54cb..5ff4a5f0a 100644 --- a/Nodejs/Product/Nodejs/Project/NodejsFolderNode.cs +++ b/Nodejs/Product/Nodejs/Project/NodejsFolderNode.cs @@ -100,14 +100,7 @@ public void UpdateContentType() { public override string Caption { get { - var res = base.Caption; - - if (NodejsPackage.Instance.GeneralOptionsPage.ShowBrowserAndNodeLabels && - NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevel != AnalysisLevel.Preview && - _containsNodeOrBrowserFiles) { - res = AppendLabel(res, ContentType); - } - return res; + return base.Caption; } } diff --git a/Nodejs/Product/Nodejs/Project/NodejsProjectNode.cs b/Nodejs/Product/Nodejs/Project/NodejsProjectNode.cs index a786c56ec..b5a922c01 100644 --- a/Nodejs/Product/Nodejs/Project/NodejsProjectNode.cs +++ b/Nodejs/Product/Nodejs/Project/NodejsProjectNode.cs @@ -111,8 +111,7 @@ private void OnIdleNodeModules(object state) { internal bool ShouldAcquireTypingsAutomatically { get { #if DEV14 - if (NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevel != AnalysisLevel.Preview || - !NodejsPackage.Instance.IntellisenseOptionsPage.EnableAutomaticTypingsAcquisition) { + if (!NodejsPackage.Instance.IntellisenseOptionsPage.EnableAutomaticTypingsAcquisition) { return false; } @@ -530,9 +529,6 @@ public override bool IsCodeFile(string fileName) { } public override int InitializeForOuter(string filename, string location, string name, uint flags, ref Guid iid, out IntPtr projectPointer, out int canceled) { - NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevelChanged += IntellisenseOptionsPageAnalysisLevelChanged; - NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLogMaximumChanged += AnalysisLogMaximumChanged; - NodejsPackage.Instance.IntellisenseOptionsPage.SaveToDiskChanged += IntellisenseOptionsPageSaveToDiskChanged; NodejsPackage.Instance.GeneralOptionsPage.ShowBrowserAndNodeLabelsChanged += ShowBrowserAndNodeLabelsChanged; return base.InitializeForOuter(filename, location, name, flags, ref iid, out projectPointer, out canceled); @@ -568,8 +564,8 @@ protected override void Reload() { } private VsProjectAnalyzer CreateNewAnalyser() { - var analyzer = new VsProjectAnalyzer(NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevel, NodejsPackage.Instance.IntellisenseOptionsPage.SaveToDisk, ProjectFolder); - analyzer.MaxLogLength = NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLogMax; + var analyzer = new VsProjectAnalyzer(AnalysisLevel.Preview, false, ProjectFolder); + analyzer.MaxLogLength = 100; LogAnalysisLevel(analyzer); return analyzer; } @@ -614,36 +610,6 @@ private void LogAnalysisLevel(VsProjectAnalyzer analyzer) { } } - private void IntellisenseOptionsPageAnalysisLevelChanged(object sender, EventArgs e) { - var oldAnalyzer = _analyzer; - _analyzer = null; - - var analyzer = CreateNewAnalyser(); - Reanalyze(this, analyzer); - if (oldAnalyzer != null) { - analyzer.SwitchAnalyzers(oldAnalyzer); - if (oldAnalyzer.RemoveUser()) { - oldAnalyzer.Dispose(); - } - } - _analyzer = analyzer; -#if DEV14 - TryToAcquireCurrentTypings(); -#endif - } - - private void AnalysisLogMaximumChanged(object sender, EventArgs e) { - if (_analyzer != null) { - _analyzer.MaxLogLength = NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLogMax; - } - } - - private void IntellisenseOptionsPageSaveToDiskChanged(object sender, EventArgs e) { - if (_analyzer != null) { - _analyzer.SaveToDisk = NodejsPackage.Instance.IntellisenseOptionsPage.SaveToDisk; - } - } - private void ShowBrowserAndNodeLabelsChanged(object sender, EventArgs e) { var nodejsFolderNodes = this.AllDescendants.Where(item => (item as NodejsFolderNode) != null).Select(item => (NodejsFolderNode)item); foreach (var node in nodejsFolderNodes) { @@ -1066,9 +1032,6 @@ protected override void Dispose(bool disposing) { _idleNodeModulesTimer = null; } - NodejsPackage.Instance.IntellisenseOptionsPage.SaveToDiskChanged -= IntellisenseOptionsPageSaveToDiskChanged; - NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLevelChanged -= IntellisenseOptionsPageAnalysisLevelChanged; - NodejsPackage.Instance.IntellisenseOptionsPage.AnalysisLogMaximumChanged -= AnalysisLogMaximumChanged; NodejsPackage.Instance.GeneralOptionsPage.ShowBrowserAndNodeLabelsChanged -= ShowBrowserAndNodeLabelsChanged; OnDispose?.Invoke(this, EventArgs.Empty); From 7aadd85768ca44dbff8b1304a6f6ad8a4ae5c0e3 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 8 Sep 2016 17:36:13 -0700 Subject: [PATCH 2/7] Remove unused intellisense level changed logging call --- .../Product/Nodejs/Telemetry/NodejsTelemetryExtensions.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Nodejs/Product/Nodejs/Telemetry/NodejsTelemetryExtensions.cs b/Nodejs/Product/Nodejs/Telemetry/NodejsTelemetryExtensions.cs index 9667324f4..e35cd03e6 100644 --- a/Nodejs/Product/Nodejs/Telemetry/NodejsTelemetryExtensions.cs +++ b/Nodejs/Product/Nodejs/Telemetry/NodejsTelemetryExtensions.cs @@ -29,13 +29,6 @@ public static void LogAnalysisActivatedForProject(this ITelemetryLogger logger, new DataPoint(TelemetryProperties.AnalysisLevel, newAnalysisLevel.ToString()))); } - public static void LogAnalysisLevelChanged(this ITelemetryLogger logger, Options.AnalysisLevel newAnalysisLevel) { - logger.ReportEvent( - TelemetryEvents.AnalysisLevelChanged, - TelemetryProperties.AnalysisLevel, - newAnalysisLevel.ToString()); - } - public static void LogProjectImported(this ITelemetryLogger logger, Guid projectGuid) { logger.ReportEvent( TelemetryEvents.ProjectImported, From fe5700b1f4df7d171f42a3e883779c2aef60c760 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 8 Sep 2016 17:43:17 -0700 Subject: [PATCH 3/7] Remove two more unused options and disable intellisense page on vs15 --- .../Nodejs/Commands/DiagnosticsCommand.cs | 2 -- .../Intellisense/IntellisenseController.cs | 11 +++----- Nodejs/Product/Nodejs/NodejsPackage.cs | 2 ++ .../Options/NodejsIntellisenseOptionsPage.cs | 25 ------------------- 4 files changed, 5 insertions(+), 35 deletions(-) diff --git a/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs b/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs index 3b16c25a2..f18c49d96 100644 --- a/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs +++ b/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs @@ -286,8 +286,6 @@ private static string GetAnalysisLevelInfo() { jsAnalyzer.DumpLog(writer); } } - - res.AppendLine(string.Format("IntelliSense Completion Only Tab or Enter to Commit: {0}", NodejsPackage.Instance.IntellisenseOptionsPage.OnlyTabOrEnterToCommit)); return res.ToString(); } diff --git a/Nodejs/Product/Nodejs/Intellisense/IntellisenseController.cs b/Nodejs/Product/Nodejs/Intellisense/IntellisenseController.cs index 66d47dd92..8848361ea 100644 --- a/Nodejs/Product/Nodejs/Intellisense/IntellisenseController.cs +++ b/Nodejs/Product/Nodejs/Intellisense/IntellisenseController.cs @@ -195,9 +195,7 @@ private void HandleChar(char ch) { } break; default: - if (IsIdentifierFirstChar(ch) && _activeSession == null - && NodejsPackage.Instance.LangPrefs.AutoListMembers - && NodejsPackage.Instance.IntellisenseOptionsPage.ShowCompletionListAfterCharacterTyped) { + if (IsIdentifierFirstChar(ch) && _activeSession == null && NodejsPackage.Instance.LangPrefs.AutoListMembers) { TriggerCompletionSession(false); } break; @@ -503,9 +501,7 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv committedBy = "\""; } } else { - committedBy = NodejsPackage.Instance != null && NodejsPackage.Instance.IntellisenseOptionsPage.OnlyTabOrEnterToCommit ? - string.Empty : - NodejsConstants.DefaultIntellisenseCompletionCommittedBy; + committedBy = NodejsConstants.DefaultIntellisenseCompletionCommittedBy; } if (committedBy.IndexOf(ch) != -1) { @@ -648,8 +644,7 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv case VSConstants.VSStd2KCmdID.COMPLETEWORD: ForceCompletions = true; try { - TriggerCompletionSession((VSConstants.VSStd2KCmdID)nCmdID == VSConstants.VSStd2KCmdID.COMPLETEWORD - && !NodejsPackage.Instance.IntellisenseOptionsPage.OnlyTabOrEnterToCommit); + TriggerCompletionSession(false); } finally { ForceCompletions = false; } diff --git a/Nodejs/Product/Nodejs/NodejsPackage.cs b/Nodejs/Product/Nodejs/NodejsPackage.cs index 9aba8a64f..40a75e3c5 100644 --- a/Nodejs/Product/Nodejs/NodejsPackage.cs +++ b/Nodejs/Product/Nodejs/NodejsPackage.cs @@ -93,7 +93,9 @@ namespace Microsoft.NodejsTools { [ProvideLanguageEditorOptionPage(typeof(NodejsFormattingSpacingOptionsPage), NodejsConstants.Nodejs, "Formatting", "Spacing", "3042")] [ProvideLanguageEditorOptionPage(typeof(NodejsFormattingBracesOptionsPage), NodejsConstants.Nodejs, "Formatting", "Braces", "3043")] [ProvideLanguageEditorOptionPage(typeof(NodejsFormattingGeneralOptionsPage), NodejsConstants.Nodejs, "Formatting", "General", "3044")] +#if DEV14 [ProvideLanguageEditorOptionPage(typeof(NodejsIntellisenseOptionsPage), NodejsConstants.Nodejs, "IntelliSense", "", "3048")] +#endif [ProvideLanguageEditorOptionPage(typeof(NodejsAdvancedEditorOptionsPage), NodejsConstants.Nodejs, "Advanced", "", "3050")] [ProvideCodeExpansions(Guids.NodejsLanguageInfoString, false, 106, "Nodejs", @"Snippets\%LCID%\SnippetsIndex.xml", @"Snippets\%LCID%\Nodejs\")] [ProvideCodeExpansionPath("Nodejs", "Test", @"Snippets\%LCID%\Test\")] diff --git a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs index a85dd1597..b375379b4 100644 --- a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs +++ b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs @@ -25,18 +25,8 @@ namespace Microsoft.NodejsTools.Options { [ComVisible(true)] public class NodejsIntellisenseOptionsPage : NodejsDialogPage { - private static readonly Version _typeScriptMinVersionForES6Preview = new Version("1.6"); - private NodejsIntellisenseOptionsControl _window; - private readonly Lazy _enableES6Preview = new Lazy(() => { - Version version; - var versionString = GetTypeScriptToolsVersion(); - return !string.IsNullOrEmpty(versionString) - && Version.TryParse(versionString, out version) - && version.CompareTo(_typeScriptMinVersionForES6Preview) > -1; - }); - public NodejsIntellisenseOptionsPage() : base("IntelliSense") { } @@ -52,14 +42,6 @@ protected override System.Windows.Forms.IWin32Window Window { } } - internal bool EnableES6Preview { - get { return _enableES6Preview.Value; } - } - - internal bool OnlyTabOrEnterToCommit { get; set; } - - internal bool ShowCompletionListAfterCharacterTyped { get; set; } - internal bool EnableAutomaticTypingsAcquisition { get; set; } internal bool ShowTypingsInfoBar { get; set; } @@ -74,21 +56,16 @@ internal bool EnableES6Preview { public override void ResetSettings() { } - private const string OnlyTabOrEnterToCommitSetting = "OnlyTabOrEnterToCommit"; - private const string ShowCompletionListAfterCharacterTypedSetting = "ShowCompletionListAfterCharacterTyped"; private const string EnableAutomaticTypingsAcquisitionSetting = "EnableAutomaticTypingsAcquisition"; private const string ShowTypingsInfoBarSetting = "ShowTypingsInfoBar"; private const string SaveChangesToConfigFileSetting = "SaveChangesToConfigFile"; public override void LoadSettingsFromStorage() { // Load settings from storage. - OnlyTabOrEnterToCommit = LoadBool(OnlyTabOrEnterToCommitSetting) ?? true; - ShowCompletionListAfterCharacterTyped = LoadBool(ShowCompletionListAfterCharacterTypedSetting) ?? true; EnableAutomaticTypingsAcquisition = LoadBool(EnableAutomaticTypingsAcquisitionSetting) ?? true; ShowTypingsInfoBar = LoadBool(ShowTypingsInfoBarSetting) ?? true; SaveChangesToConfigFile = LoadBool(SaveChangesToConfigFileSetting) ?? false; - // Synchronize UI with backing properties. if (_window != null) { _window.SyncControlWithPageSettings(this); @@ -107,8 +84,6 @@ public override void SaveSettingsToStorage() { } // Save settings. - SaveBool(OnlyTabOrEnterToCommitSetting, OnlyTabOrEnterToCommit); - SaveBool(ShowCompletionListAfterCharacterTypedSetting, ShowCompletionListAfterCharacterTyped); SaveBool(EnableAutomaticTypingsAcquisitionSetting, EnableAutomaticTypingsAcquisition); SaveBool(ShowTypingsInfoBarSetting, ShowTypingsInfoBar); SaveBool(SaveChangesToConfigFileSetting, SaveChangesToConfigFile); From e4c20e3869bd7e4f45639d675bf824886f8823c2 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 8 Sep 2016 17:46:54 -0700 Subject: [PATCH 4/7] Remove horizontal divider from options page --- .../NodejsIntellisenseOptionsControl.Designer.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs index a8998a7f9..850ce41a9 100644 --- a/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs +++ b/Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs @@ -29,7 +29,6 @@ private void InitializeComponent() { this.outerLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.advancedOptionsLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this._salsaLsIntellisenseOptionsControl = new Microsoft.NodejsTools.Options.SalsaLsIntellisenseOptionsControl(); - this.horizontalDivider = new System.Windows.Forms.Label(); toolTip = new System.Windows.Forms.ToolTip(this.components); this.outerLayoutPanel.SuspendLayout(); this.advancedOptionsLayoutPanel.SuspendLayout(); @@ -39,7 +38,6 @@ private void InitializeComponent() { // resources.ApplyResources(this.outerLayoutPanel, "outerLayoutPanel"); this.outerLayoutPanel.Controls.Add(this.advancedOptionsLayoutPanel, 0, 2); - this.outerLayoutPanel.Controls.Add(this.horizontalDivider, 0, 1); this.outerLayoutPanel.Name = "outerLayoutPanel"; // // advancedOptionsLayoutPanel @@ -53,13 +51,6 @@ private void InitializeComponent() { resources.ApplyResources(this._salsaLsIntellisenseOptionsControl, "_salsaLsIntellisenseOptionsControl"); this._salsaLsIntellisenseOptionsControl.Name = "_salsaLsIntellisenseOptionsControl"; // - // horizontalDivider - // - this.horizontalDivider.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - resources.ApplyResources(this.horizontalDivider, "horizontalDivider"); - this.horizontalDivider.ForeColor = System.Drawing.SystemColors.Control; - this.horizontalDivider.Name = "horizontalDivider"; - // // NodejsIntellisenseOptionsControl // resources.ApplyResources(this, "$this"); @@ -80,6 +71,5 @@ private void InitializeComponent() { private System.Windows.Forms.TableLayoutPanel outerLayoutPanel; private System.Windows.Forms.TableLayoutPanel advancedOptionsLayoutPanel; private SalsaLsIntellisenseOptionsControl _salsaLsIntellisenseOptionsControl; - private System.Windows.Forms.Label horizontalDivider; } } From 116f216441d8f1cd77efd84b3e5dc627f9022448 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 9 Sep 2016 11:51:51 -0700 Subject: [PATCH 5/7] Small cleanup for diagnosticscommand --- .../Nodejs/Commands/DiagnosticsCommand.cs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs b/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs index f18c49d96..b825c3288 100644 --- a/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs +++ b/Nodejs/Product/Nodejs/Commands/DiagnosticsCommand.cs @@ -22,9 +22,9 @@ using System.Text; using System.Threading; using Microsoft.NodejsTools.Logging; +using Microsoft.NodejsTools.Options; using Microsoft.VisualStudioTools; using Microsoft.VisualStudioTools.Project; -using Microsoft.NodejsTools.Options; namespace Microsoft.NodejsTools.Commands { internal sealed class DiagnosticsCommand : Command { @@ -75,7 +75,6 @@ private string GetData() { res.AppendLine(GetSolutionInfo()); res.AppendLine(GetEventsAndStatsInfo()); res.AppendLine(GetLoadedAssemblyInfo()); - res.AppendLine(GetAnalysisLevelInfo()); return res.ToString(); } @@ -274,21 +273,6 @@ private static string GetLoadedAssemblyInfo() { return res.ToString(); } - private static string GetAnalysisLevelInfo() { - var res = new StringBuilder(); - res.AppendLine(String.Format("Analysis Level: {0}", AnalysisLevel.Preview.ToString())); - res.AppendLine(); - if (NodejsPackage.Instance._analyzer != null) { - var jsAnalyzer = NodejsPackage.Instance._analyzer; - res.AppendLine("Default Analysis Log: "); - - using (var writer = new StringWriter(res)) { - jsAnalyzer.DumpLog(writer); - } - } - return res.ToString(); - } - private static string Indent(int count, string text) { var indent = new string(' ', count * 4); var lines = text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); From e3bf5aec1bda2e948b542fb07e7885e138dbf186 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 9 Sep 2016 12:05:54 -0700 Subject: [PATCH 6/7] Remove unused TelemtryEvent name --- Nodejs/Common/Telemetry/TelemetryEvents.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Nodejs/Common/Telemetry/TelemetryEvents.cs b/Nodejs/Common/Telemetry/TelemetryEvents.cs index b7b8ad7aa..12dafbe03 100644 --- a/Nodejs/Common/Telemetry/TelemetryEvents.cs +++ b/Nodejs/Common/Telemetry/TelemetryEvents.cs @@ -21,6 +21,5 @@ namespace Microsoft.NodejsTools.Telemetry { internal static class TelemetryEvents { public const string ProjectImported = "ProjectImported"; public const string AnalysisActivatedForProject = "AnalysisActivatedForProject"; - public const string AnalysisLevelChanged = "AnalysisLevelChanged"; } } From bc5800d723f380deb8b195918b59797a1145f75b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 9 Sep 2016 13:19:21 -0700 Subject: [PATCH 7/7] Remove Update contentType function --- .../Product/Nodejs/Project/NodejsFileNode.cs | 11 ---- .../Nodejs/Project/NodejsFolderNode.cs | 63 ------------------- 2 files changed, 74 deletions(-) diff --git a/Nodejs/Product/Nodejs/Project/NodejsFileNode.cs b/Nodejs/Product/Nodejs/Project/NodejsFileNode.cs index 94c1aedc0..5a845563a 100644 --- a/Nodejs/Product/Nodejs/Project/NodejsFileNode.cs +++ b/Nodejs/Product/Nodejs/Project/NodejsFileNode.cs @@ -99,7 +99,6 @@ internal override int IncludeInProject(bool includeChildren) { ProjectMgr.Analyzer.AnalyzeFile(Url, ShouldAnalyze); - UpdateParentContentType(); ItemNode.ItemTypeChanged += ItemNode_ItemTypeChanged; if (ProjectMgr.ShouldAcquireTypingsAutomatically) { @@ -117,7 +116,6 @@ internal override int ExcludeFromProject() { ProjectMgr.Analyzer.AnalyzeFile(Url, false); var excludeFromProject = base.ExcludeFromProject(); - UpdateParentContentType(); ItemNode.ItemTypeChanged -= ItemNode_ItemTypeChanged; return excludeFromProject; @@ -151,15 +149,6 @@ private void ItemNode_ItemTypeChanged(object sender, EventArgs e) { // item type node was changed... // if we have changed the type from compile to anything else, we should scrub ProjectMgr.Analyzer.AnalyzeFile(Url, ShouldAnalyze); - - UpdateParentContentType(); - } - - private void UpdateParentContentType() { - var parent = this.Parent as NodejsFolderNode; - if (parent != null) { - parent.UpdateContentType(); - } } public new NodejsProjectNode ProjectMgr { diff --git a/Nodejs/Product/Nodejs/Project/NodejsFolderNode.cs b/Nodejs/Product/Nodejs/Project/NodejsFolderNode.cs index 5ff4a5f0a..cf260c4a0 100644 --- a/Nodejs/Product/Nodejs/Project/NodejsFolderNode.cs +++ b/Nodejs/Product/Nodejs/Project/NodejsFolderNode.cs @@ -34,70 +34,10 @@ public NodejsFolderNode(CommonProjectNode root, ProjectElement element) : base(r public FolderContentType ContentType { get { - if (_contentType == FolderContentType.NotAssigned) { - UpdateContentType(); - } - return _contentType; } } - public void UpdateContentType() { - var oldContentType = _contentType; - _contentType = FolderContentType.None; - var parent = Parent as NodejsFolderNode; - _containsNodeOrBrowserFiles = false; - - if (ItemNode.IsExcluded || ItemNode.Url.Contains(NodejsConstants.NodeModulesFolder)) { - _contentType = FolderContentType.None; - } else { - // Iterate through all of the javascript files in a directory to determine whether - // the build actions are Content, Compile, or a mix of the two. - var nodejsFileNodes = EnumNodesOfType(); - FolderContentType contentType = FolderContentType.None; - foreach (var fileNode in nodejsFileNodes) { - if (!fileNode.Url.EndsWith(".js", StringComparison.OrdinalIgnoreCase)) { - continue; - } - - var properties = fileNode.NodeProperties as IncludedFileNodeProperties; - if (properties != null) { - _containsNodeOrBrowserFiles = true; - switch (properties.BuildAction) { - case prjBuildAction.prjBuildActionContent: - contentType |= FolderContentType.Browser; - break; - case prjBuildAction.prjBuildActionCompile: - contentType |= FolderContentType.Node; - break; - } - - if (contentType == FolderContentType.Mixed) { - break; - } - } - } - - // If there are no relevant javascript files in the folder, then fall back to - // the parent type. This enables us to provide good defaults in the event that - // an item is added to the directory later. - if (contentType == FolderContentType.None) { - // Set as parent content type - if (parent != null) { - contentType = parent.ContentType; - } - } - - _contentType = contentType; - ProjectMgr.ReDrawNode(this, UIHierarchyElement.Caption); - } - - // Update the caption of the parent folder accordingly - if (parent != null && _contentType != oldContentType) { - parent.UpdateContentType(); - } - } - public override string Caption { get { return base.Caption; @@ -106,7 +46,6 @@ public override string Caption { public override void RemoveChild(HierarchyNode node) { base.RemoveChild(node); - UpdateContentType(); } public override void AddChild(HierarchyNode node) { @@ -128,8 +67,6 @@ public override void AddChild(HierarchyNode node) { } } } - - UpdateContentType(); } ///