Skip to content

Commit

Permalink
Cleanup vs ext 2
Browse files Browse the repository at this point in the history
  - remove `#region`s
  - removed include of not existing doc in comments (noise)
  - remove redundant comments (`/// this is a constructor`)
  - remove commented code
  - remove an empty file

closes #358

commit c34491923f46ecbf2984d58ba3bf4e3391205a6e
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 16 15:03:14 2015 +0200

    removed comment

commit 6daf02cf3d65c342f4aff8d4bebc1cc2fa0a3506
Author: enricosada <enrico@sada.io>
Date:   Fri Apr 10 14:56:39 2015 +0200

    remove empty file

commit 0e736d994beecbec9263808edb04f5170e99fbe0
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 23:10:38 2015 +0200

    remove commented code

commit b4422b9eef39cccb10a60a0216f313915b10a5eb
Author: enricosada <enrico@sada.io>
Date:   Fri Apr 10 11:26:29 2015 +0200

    removed redundant comments

commit f8a981dc1f88db773be00bfff7aa993424eab985
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 23:19:34 2015 +0200

    remove include external doc in comments

commit f59c84cd386ed89e5b99f950e145d33f02913e78
Author: enricosada <enrico@sada.io>
Date:   Fri Apr 10 14:56:00 2015 +0200

    remove #region
  • Loading branch information
enricosada authored and latkin committed Aug 3, 2015
1 parent 0bfd80c commit 66d4883
Show file tree
Hide file tree
Showing 101 changed files with 9 additions and 2,056 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using Microsoft.VisualStudio.FSharp.LanguageService.Resources;

namespace Microsoft.VisualStudio.FSharp.LanguageService {
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager"]/*' />
/// <summary>
/// CodeWindowManager provides a default implementation of the VSIP interface IVsCodeWindowManager
/// and manages the LanguageService, Source, ViewFilter, and DocumentProperties objects associated
Expand Down Expand Up @@ -42,7 +41,6 @@ public class CodeWindowManager : IVsCodeWindowManager {
DocumentProperties properties;
#endif

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.CodeWindowManager"]/*' />
/// <summary>
/// The CodeWindowManager is constructed by the base LanguageService class when VS calls
/// the IVsLanguageInfo.GetCodeWindowManager method. You can override CreateCodeWindowManager
Expand All @@ -58,14 +56,12 @@ public class CodeWindowManager : IVsCodeWindowManager {
#endif
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.Finalize"]/*' />
~CodeWindowManager() {
#if LANGTRACE
Trace.WriteLine("~CodeWindowManager");
#endif
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.Close"]/*' />
/// <summary>Closes all view filters, and the document properties window</summary>
internal void Close() {
#if LANGTRACE
Expand Down Expand Up @@ -93,17 +89,14 @@ public class CodeWindowManager : IVsCodeWindowManager {
}
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.LanguageService;"]/*' />
/// <summary>Returns the LanguageService object that created this code window manager</summary>
internal LanguageService LanguageService {
get { return this.service; }
}
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.Source;"]/*' />
/// <summary>returns the Source object associated with the IVsTextLines buffer for this code window</summary>
internal ISource Source {
get { return this.source; }
}
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.GetFilter;"]/*' />
/// <summary>
/// Returns the ViewFilter for the given view or null if no matching filter is found.
/// </summary>
Expand All @@ -118,7 +111,6 @@ public class CodeWindowManager : IVsCodeWindowManager {
}

#if DOCUMENT_PROPERTIES
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.Properties;"]/*' />
/// <summary>Returns the DocumentProperties, if any. You can update this property if you want to
/// change the document properties on the fly.</summary>
internal DocumentProperties Properties {
Expand All @@ -132,19 +124,15 @@ public class CodeWindowManager : IVsCodeWindowManager {
}
}
#endif
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.DropDownHelper"]/*' />
/// <summary>Return the optional TypeAndMemberDropdownBars object for the drop down combos</summary>
internal TypeAndMemberDropdownBars DropDownHelper {
get { return this.dropDownHelper; }
}
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.CodeWindow"]/*' />
/// <summary>Return the IVsCodeWindow associated with this code window manager.</summary>
internal IVsCodeWindow CodeWindow {
get { return this.codeWindow; }
}

#region IVsCodeWindowManager methods
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.AddAdornments"]/*' />
/// <summary>Install the optional TypeAndMemberDropdownBars, and primary and secondary view filters</summary>
public virtual int AddAdornments() {
#if LANGTRACE
Expand Down Expand Up @@ -182,7 +170,6 @@ public class CodeWindowManager : IVsCodeWindowManager {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.RemoveAdornments"]/*' />
/// <summary>Remove drop down combos, view filters, and notify the LanguageService that the Source and
/// CodeWindowManager is now closed</summary>
public virtual int RemoveAdornments() {
Expand Down Expand Up @@ -212,7 +199,6 @@ public class CodeWindowManager : IVsCodeWindowManager {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.OnNewView"]/*' />
/// <summary>Install a new view filter for the given view. This method calls your
/// CreateViewFilter method.</summary>
public virtual int OnNewView(IVsTextView newView) {
Expand All @@ -224,11 +210,9 @@ public class CodeWindowManager : IVsCodeWindowManager {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.OnKillFocus"]/*' />
public virtual void OnKillFocus(IVsTextView textView) {
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.OnSetFocus"]/*' />
/// <summary>Refresh the document properties</summary>
public virtual void OnSetFocus(IVsTextView textView) {
#if DOCUMENT_PROPERTIES
Expand All @@ -237,13 +221,11 @@ public class CodeWindowManager : IVsCodeWindowManager {
}
#endif
}
#endregion

}



/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars"]/*' />
/// <summary>
/// Represents the two drop down bars on the top of a text editor window that allow
/// types and type members to be selected by name.
Expand Down Expand Up @@ -274,14 +256,12 @@ internal abstract class TypeAndMemberDropdownBars : IVsDropdownBarClient {
const int DropClasses = 0;
const int DropMethods = 1;

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.TypeAndMemberDropdownBars"]/*' />
protected TypeAndMemberDropdownBars(LanguageService languageService) {
this.languageService = languageService;
this.dropDownTypes = new ArrayList();
this.dropDownMembers = new ArrayList();
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.Done"]/*' />
public void Done() { //TODO: use IDisposable pattern
if (this.imageList != null) {
imageList.Dispose();
Expand All @@ -301,7 +281,6 @@ internal abstract class TypeAndMemberDropdownBars : IVsDropdownBarClient {



/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnSynchronizeDropdowns"]/*' />
/// <summary>
/// This method is called to update the drop down bars to match the current contents of the text editor window.
/// It is called during OnIdle when the caret position changes. You can provide new drop down members here.
Expand All @@ -320,7 +299,6 @@ internal abstract class TypeAndMemberDropdownBars : IVsDropdownBarClient {


// IVsDropdownBarClient methods
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetComboAttributes"]/*' />
public virtual int GetComboAttributes(int combo, out uint entries, out uint entryType, out IntPtr iList) {
entries = 0;
entryType = 0;
Expand All @@ -341,7 +319,6 @@ private enum DropDownItemType {
HasImage = 4
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetComboTipText"]/*' />
public virtual int GetComboTipText(int combo, out string text) {
if (combo == TypeAndMemberDropdownBars.DropClasses)
text = SR.GetString(SR.ComboTypesTip);
Expand All @@ -350,7 +327,6 @@ private enum DropDownItemType {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryAttributes"]/*' />
public virtual int GetEntryAttributes(int combo, int entry, out uint fontAttrs) {
fontAttrs = (uint)DROPDOWNFONTATTR.FONTATTR_PLAIN;
DropDownMember member = GetMember(combo, entry);
Expand All @@ -360,7 +336,6 @@ private enum DropDownItemType {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryImage"]/*' />
public virtual int GetEntryImage(int combo, int entry, out int imgIndex) {
// this happens during drawing and has to be fast
imgIndex = -1;
Expand All @@ -371,7 +346,6 @@ private enum DropDownItemType {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryText"]/*' />
public virtual int GetEntryText(int combo, int entry, out string text) {
text = null;
DropDownMember member = GetMember(combo, entry);
Expand All @@ -381,12 +355,10 @@ private enum DropDownItemType {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnComboGetFocus"]/*' />
public virtual int OnComboGetFocus(int combo) {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetMember"]/*' />
public DropDownMember GetMember(int combo, int entry) {
if (combo == TypeAndMemberDropdownBars.DropClasses) {
if (this.dropDownTypes != null && entry >= 0 && entry < this.dropDownTypes.Count)
Expand All @@ -398,7 +370,6 @@ private enum DropDownItemType {
return null;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnItemChosen"]/*' />
public virtual int OnItemChosen(int combo, int entry) {
DropDownMember member = GetMember(combo, entry);
if (!Object.ReferenceEquals(member,null)) {
Expand All @@ -417,11 +388,9 @@ private enum DropDownItemType {
return NativeMethods.S_OK;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.SetFocus"]/*' />
[DllImport("user32.dll")]
static extern void SetFocus(IntPtr hwnd);

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnItemSelected"]/*' />
public int OnItemSelected(int combo, int index) {
//nop
return NativeMethods.S_OK;
Expand All @@ -433,15 +402,13 @@ private enum DropDownItemType {
}
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember"]/*' />
internal class DropDownMember : IComparable {

private string label;
private TextSpan span;
private int glyph;
private DROPDOWNFONTATTR fontAttr;

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.Label;"]/*' />
public string Label {
get {
return this.label;
Expand All @@ -451,7 +418,6 @@ internal class DropDownMember : IComparable {
}
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.Span;"]/*' />
public TextSpan Span {
get {
return this.span;
Expand All @@ -460,7 +426,6 @@ internal class DropDownMember : IComparable {
this.span = value;
}
}
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.Glyph;"]/*' />
public int Glyph {
get {
return this.glyph;
Expand All @@ -469,7 +434,6 @@ internal class DropDownMember : IComparable {
this.glyph = value;
}
}
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.FontAttr;"]/*' />
public DROPDOWNFONTATTR FontAttr {
get {
return this.fontAttr;
Expand All @@ -479,7 +443,6 @@ internal class DropDownMember : IComparable {
}
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.DropDownMember"]/*' />
public DropDownMember(string label, TextSpan span, int glyph, DROPDOWNFONTATTR fontAttribute) {
if (label == null) {
throw new ArgumentNullException("label");
Expand All @@ -490,14 +453,12 @@ internal class DropDownMember : IComparable {
this.FontAttr = fontAttribute;
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.CompareTo"]/*' />
public int CompareTo(object obj) {
// if this overload is used then it assumes a case-sensitive current culture comparison
// which allows for case-senstive languages to work
return CompareTo(obj, StringComparison.CurrentCulture);
}

/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.CompareTo"]/*' />
public int CompareTo(object obj, StringComparison stringComparison)
{
if (obj is DropDownMember)
Expand All @@ -508,15 +469,13 @@ public int CompareTo(object obj, StringComparison stringComparison)
}

// Omitting Equals violates FxCop rule: IComparableImplementationsOverrideEquals.
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.Equals"]/*' />
public override bool Equals(Object obj) {
if (!(obj is DropDownMember))
return false;
return (this.CompareTo(obj, StringComparison.CurrentCulture) == 0);
}

// Omitting getHashCode violates FxCop rule: EqualsOverridesRequireGetHashCodeOverride.
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="DropDownMember.GetHashCode"]/*' />
public override int GetHashCode() {
return this.Label.GetHashCode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public virtual void Resume()
}

#if COLORABLE_ITEM
/// <include file='doc\Colorizer.uex' path='docs/doc[@for="ColorableItem"]/*' />
[CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
public class ColorableItem : IVsColorableItem, IVsHiColorItem, IVsMergeableUIItem {
Expand All @@ -55,7 +54,6 @@ public class ColorableItem : IVsColorableItem, IVsHiColorItem, IVsMergeableUIIte
Color hiForeColor, hiBackColor;
FONTFLAGS fontFlags;

/// <include file='doc\Colorizer.uex' path='docs/doc[@for="ColorableItem.ColorableItem"]/*' />
internal ColorableItem(string name, string displayName, COLORINDEX foreColor, COLORINDEX backColor, Color hiForeColor, Color hiBackColor, FONTFLAGS fontFlags) {
this.name = name;
this.displayName = displayName;
Expand All @@ -66,27 +64,20 @@ public class ColorableItem : IVsColorableItem, IVsHiColorItem, IVsMergeableUIIte
this.hiBackColor = hiBackColor;
}

#region IVsColorableItem methods
/// <include file='doc\Colorizer.uex' path='docs/doc[@for="ColorableItem.GetDefaultColors"]/*' />
public virtual int GetDefaultColors(COLORINDEX[] foreColor, COLORINDEX[] backColor) {
if (foreColor != null) foreColor[0] = this.foreColor;
if (backColor != null) backColor[0] = this.backColor;
return NativeMethods.S_OK;
}
/// <include file='doc\Colorizer.uex' path='docs/doc[@for="ColorableItem.GetDefaultFontFlags"]/*' />
public virtual int GetDefaultFontFlags(out uint fontFlags) {
fontFlags = (uint)this.fontFlags;
return NativeMethods.S_OK;
}
/// <include file='doc\Colorizer.uex' path='docs/doc[@for="ColorableItem.GetDisplayName"]/*' />
public virtual int GetDisplayName(out string name) {
name = this.displayName;
return NativeMethods.S_OK;
}
#endregion

#region IVsHiColorItem methods
/// <include file='doc\Colorizer.uex' path='docs/doc[@for="Colorizer.GetColorData"]/*' />
public virtual int GetColorData(int cdElement, out uint crColor)
{
crColor = 0;
Expand Down Expand Up @@ -126,32 +117,25 @@ private uint ColorToRgb(Color color)

return (uint)(red | (green << 8) | (blue << 16));
}
#endregion


#region IVsMergeableUIItem Members

/// <include file='doc\Colorizer.uex' path='docs/doc[@for="ColorableItem.GetCanonicalName"]/*' />
public virtual int GetCanonicalName(out string name) {
name = this.name;
return NativeMethods.S_OK;
}

/// <include file='doc\Colorizer.uex' path='docs/doc[@for="ColorableItem.GetDescription"]/*' />
public virtual int GetDescription(out string desc) {
// The reason this is not implemented is because the core text editor
// doesn't use it.
desc = null;
return NativeMethods.E_NOTIMPL;
}

/// <include file='doc\Colorizer.uex' path='docs/doc[@for="ColorableItem.GetMergingPriority"]/*' />
public virtual int GetMergingPriority(out int priority) {
priority = -1;
return NativeMethods.E_NOTIMPL;
}

#endregion
}
#endif

Expand Down
Loading

0 comments on commit 66d4883

Please sign in to comment.