Skip to content

Commit

Permalink
Added this. for fully qualified method names
Browse files Browse the repository at this point in the history
  • Loading branch information
HJLebbink committed Nov 15, 2018
1 parent e0698a9 commit 1144ec6
Show file tree
Hide file tree
Showing 25 changed files with 342 additions and 342 deletions.
4 changes: 2 additions & 2 deletions VS/CSHARP/asm-dude-vsix/AsmDoc/AsmDocKeyProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ private void UpdateState(KeyEventArgs args)

public override void PreviewKeyDown(KeyEventArgs args)
{
UpdateState(args);
this.UpdateState(args);
}

public override void PreviewKeyUp(KeyEventArgs args)
{
UpdateState(args);
this.UpdateState(args);
}
}
}
36 changes: 18 additions & 18 deletions VS/CSHARP/asm-dude-vsix/AsmDoc/AsmDocMouseHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ public AsmDocMouseHandler(
{
if (this._state.Enabled)
{
TryHighlightItemUnderMouse(RelativeToView(Mouse.PrimaryDevice.GetPosition(this._view.VisualElement)));
this.TryHighlightItemUnderMouse(this.RelativeToView(Mouse.PrimaryDevice.GetPosition(this._view.VisualElement)));
}
else
{
Set_Highlight_Span(null);
this.Set_Highlight_Span(null);
}
}
};

// Some other points to clear the highlight span:
this._view.LostAggregateFocus += (sender, args) => Set_Highlight_Span(null);
this._view.VisualElement.MouseLeave += (sender, args) => Set_Highlight_Span(null);
this._view.LostAggregateFocus += (sender, args) => this.Set_Highlight_Span(null);
this._view.VisualElement.MouseLeave += (sender, args) => this.Set_Highlight_Span(null);

}

Expand All @@ -96,7 +96,7 @@ public AsmDocMouseHandler(

public override void PostprocessMouseLeftButtonDown(MouseButtonEventArgs e)
{
this._mouseDownAnchorPoint = RelativeToView(e.GetPosition(this._view.VisualElement));
this._mouseDownAnchorPoint = this.RelativeToView(e.GetPosition(this._view.VisualElement));
}

public override void PreprocessMouseMove(MouseEventArgs e)
Expand All @@ -105,16 +105,16 @@ public override void PreprocessMouseMove(MouseEventArgs e)

if (!this._mouseDownAnchorPoint.HasValue && this._state.Enabled && (e.LeftButton == MouseButtonState.Released))
{
TryHighlightItemUnderMouse(RelativeToView(e.GetPosition(this._view.VisualElement)));
this.TryHighlightItemUnderMouse(this.RelativeToView(e.GetPosition(this._view.VisualElement)));
}
else if (this._mouseDownAnchorPoint.HasValue)
{
// Check and see if this is a drag; if so, clear out the highlight.
var currentMousePosition = RelativeToView(e.GetPosition(this._view.VisualElement));
if (InDragOperation(this._mouseDownAnchorPoint.Value, currentMousePosition))
var currentMousePosition = this.RelativeToView(e.GetPosition(this._view.VisualElement));
if (this.InDragOperation(this._mouseDownAnchorPoint.Value, currentMousePosition))
{
this._mouseDownAnchorPoint = null;
Set_Highlight_Span(null);
this.Set_Highlight_Span(null);
}
}
}
Expand All @@ -139,9 +139,9 @@ public override void PreprocessMouseUp(MouseButtonEventArgs e)
{
if (this._mouseDownAnchorPoint.HasValue && this._state.Enabled)
{
var currentMousePosition = RelativeToView(e.GetPosition(this._view.VisualElement));
var currentMousePosition = this.RelativeToView(e.GetPosition(this._view.VisualElement));

if (!InDragOperation(this._mouseDownAnchorPoint.Value, currentMousePosition))
if (!this.InDragOperation(this._mouseDownAnchorPoint.Value, currentMousePosition))
{
this._state.Enabled = false;

Expand All @@ -152,7 +152,7 @@ public override void PreprocessMouseUp(MouseButtonEventArgs e)
{
this.Dispatch_Goto_Doc(keyword);
}
Set_Highlight_Span(null);
this.Set_Highlight_Span(null);
this._view.Selection.Clear();
e.Handled = true;
}
Expand All @@ -161,7 +161,7 @@ public override void PreprocessMouseUp(MouseButtonEventArgs e)
}
catch (Exception ex)
{
AsmDudeToolsStatic.Output_ERROR(string.Format("{0} PreprocessMouseUp; e={1}", ToString(), ex.ToString()));
AsmDudeToolsStatic.Output_ERROR(string.Format("{0} PreprocessMouseUp; e={1}", this.ToString(), ex.ToString()));
}
}

Expand Down Expand Up @@ -215,7 +215,7 @@ private bool TryHighlightItemUnderMouse(Point position)
//string type = classification.ClassificationType.Classification.ToLower();
string url = this.Get_Url(keyword);
//Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "INFO: {0}:TryHighlightItemUnderMouse: keyword={1}; type={2}; url={3}", this.ToString(), keyword, type, url));
if ((url != null) && Set_Highlight_Span(classification.Span))
if ((url != null) && this.Set_Highlight_Span(classification.Span))
{
updated = true;
return true;
Expand All @@ -228,7 +228,7 @@ private bool TryHighlightItemUnderMouse(Point position)
{
if (!updated)
{
Set_Highlight_Span(null);
this.Set_Highlight_Span(null);
}
}
}
Expand Down Expand Up @@ -311,7 +311,7 @@ private int Open_File(string keyword)
var dte2 = Package.GetGlobalService(typeof(SDTE)) as DTE2;
if (dte2 == null)
{
AsmDudeToolsStatic.Output_WARNING(string.Format("{0}:openFile; dte2 is null.", ToString()));
AsmDudeToolsStatic.Output_WARNING(string.Format("{0}:openFile; dte2 is null.", this.ToString()));
return 1;
}

Expand All @@ -322,7 +322,7 @@ private int Open_File(string keyword)
{
// vsNavigateOptionsDefault 0 The Web page opens in the currently open browser window. (Default)
// vsNavigateOptionsNewWindow 1 The Web page opens in a new browser window.
AsmDudeToolsStatic.Output_INFO(string.Format("{0}:openFile; going to open url {1}.", ToString(), url));
AsmDudeToolsStatic.Output_INFO(string.Format("{0}:openFile; going to open url {1}.", this.ToString(), url));
window = dte2.ItemOperations.Navigate(url, EnvDTE.vsNavigateOptions.vsNavigateOptionsNewWindow);

var parts = url.Split('/');
Expand All @@ -346,7 +346,7 @@ private int Open_File(string keyword)
}
catch (Exception e)
{
AsmDudeToolsStatic.Output_ERROR(string.Format("{0}:openFile; exception={1}", ToString(), e));
AsmDudeToolsStatic.Output_ERROR(string.Format("{0}:openFile; exception={1}", this.ToString(), e));
return 2;
}
}
Expand Down
4 changes: 2 additions & 2 deletions VS/CSHARP/asm-dude-vsix/BraceMatching/BraceMatchingTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ internal BraceMatchingTagger(ITextView view, ITextBuffer sourceBuffer) {

private void ViewLayoutChanged(object sender, TextViewLayoutChangedEventArgs e) {
if (e.NewSnapshot != e.OldSnapshot) { //make sure that there has really been a change
UpdateAtCaretPosition(this._view.Caret.Position);
this.UpdateAtCaretPosition(this._view.Caret.Position);
}
}

private void CaretPositionChanged(object sender, CaretPositionChangedEventArgs e) {
UpdateAtCaretPosition(e.NewPosition);
this.UpdateAtCaretPosition(e.NewPosition);
}
private void UpdateAtCaretPosition(CaretPosition caretPosition) {
this._currentChar = caretPosition.Point.GetPoint(this._sourceBuffer, caretPosition.Affinity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv
//}
if (false)
{
return ExecMethod1(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
return this.ExecMethod1(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
}
else
{
return ExecMethod2(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
return this.ExecMethod2(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
}
}

Expand All @@ -74,7 +74,7 @@ private int ExecMethod1(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, I
//make sure the input is a char before getting it
if ((pguidCmdGroup == VSConstants.VSStd2K) && (nCmdID == (uint)VSConstants.VSStd2KCmdID.TYPECHAR))
{
typedChar = GetTypeChar(pvaIn);
typedChar = this.GetTypeChar(pvaIn);
}
//Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "INFO: {0}:Exec: typedChar={1}", this.ToString(), typedChar));

Expand Down Expand Up @@ -113,7 +113,7 @@ private int ExecMethod1(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, I
{
if (this._currentSession == null || this._currentSession.IsDismissed)
{ // If there is no active session, bring up completion
if (StartSession())
if (this.StartSession())
{
if (this._currentSession != null)
{
Expand Down Expand Up @@ -155,33 +155,33 @@ private int ExecMethod2(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, I
{
case VSConstants.VSStd2KCmdID.AUTOCOMPLETE:
case VSConstants.VSStd2KCmdID.COMPLETEWORD:
handledChar = StartSession();
handledChar = this.StartSession();
break;
case VSConstants.VSStd2KCmdID.RETURN:
handledChar = Complete(true);
handledChar = this.Complete(true);
break;
case VSConstants.VSStd2KCmdID.TAB:
Complete(true);
this.Complete(true);
handledChar = false;
break;
case VSConstants.VSStd2KCmdID.CANCEL:
handledChar = Cancel();
handledChar = this.Cancel();
break;
case VSConstants.VSStd2KCmdID.TYPECHAR:
typedChar = GetTypeChar(pvaIn);
typedChar = this.GetTypeChar(pvaIn);
if (char.IsWhiteSpace(typedChar))
{
Complete(true);
this.Complete(true);
handledChar = false;
}
else if (AsmTools.AsmSourceTools.IsSeparatorChar(typedChar))
{
Complete(false);
this.Complete(false);
handledChar = false;
}
else if (AsmTools.AsmSourceTools.IsRemarkChar(typedChar))
{
Complete(true);
this.Complete(true);
handledChar = false;
}
break;
Expand All @@ -199,17 +199,17 @@ private int ExecMethod2(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, I
//if (!typedChar.Equals(char.MinValue)) {
if ((this._currentSession == null) || this._currentSession.IsDismissed)
{ // If there is no active session, bring up completion
StartSession();
this.StartSession();
}
Filter();
this.Filter();
hresult = VSConstants.S_OK;
}
else if (nCmdID == (uint)VSConstants.VSStd2KCmdID.BACKSPACE //redo the filter if there is a deletion
|| nCmdID == (uint)VSConstants.VSStd2KCmdID.DELETE)
{
if ((this._currentSession != null) && !this._currentSession.IsDismissed)
{
Filter();
this.Filter();
}
hresult = VSConstants.S_OK;
}
Expand All @@ -226,7 +226,7 @@ private int ExecMethod2(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, I
case VSConstants.VSStd2KCmdID.TYPECHAR:
case VSConstants.VSStd2KCmdID.BACKSPACE:
case VSConstants.VSStd2KCmdID.DELETE:
Filter();
this.Filter();
break;
}
}
Expand Down
16 changes: 8 additions & 8 deletions VS/CSHARP/asm-dude-vsix/CodeCompletion/CodeCompletionSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public CodeCompletionSource(ITextBuffer buffer, LabelGraph labelGraph, AsmSimula
this._icons = new Dictionary<AsmTokenType, ImageSource>();
this._asmDudeTools = AsmDudeTools.Instance;
this._asmSimulator = asmSimulator;
Load_Icons();
this.Load_Icons();
}

public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
Expand Down Expand Up @@ -132,24 +132,24 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
if (previousKeyword.Equals("INVOKE")) //TODO INVOKE is a MASM keyword not a NASM one...
{
// Suggest a label
var completions = Label_Completions(useCapitals, false);
var completions = this.Label_Completions(useCapitals, false);
if (completions.Any<Completion>()) completionSets.Add(new CompletionSet("Labels", "Labels", applicableTo, completions, Enumerable.Empty<Completion>()));
}
else
{
{
ISet<AsmTokenType> selected1 = new HashSet<AsmTokenType> { AsmTokenType.Directive, AsmTokenType.Jump, AsmTokenType.Misc, AsmTokenType.Mnemonic };
var completions1 = Selected_Completions(useCapitals, selected1, true);
var completions1 = this.Selected_Completions(useCapitals, selected1, true);
if (completions1.Any<Completion>()) completionSets.Add(new CompletionSet("All", "All", applicableTo, completions1, Enumerable.Empty<Completion>()));
}
if (false) {
ISet<AsmTokenType> selected2 = new HashSet<AsmTokenType> { AsmTokenType.Jump, AsmTokenType.Mnemonic };
var completions2 = Selected_Completions(useCapitals, selected2, false);
var completions2 = this.Selected_Completions(useCapitals, selected2, false);
if (completions2.Any<Completion>()) completionSets.Add(new CompletionSet("Instr", "Instr", applicableTo, completions2, Enumerable.Empty<Completion>()));
}
if (false) {
ISet<AsmTokenType> selected3 = new HashSet<AsmTokenType> { AsmTokenType.Directive, AsmTokenType.Misc };
var completions3 = Selected_Completions(useCapitals, selected3, true);
var completions3 = this.Selected_Completions(useCapitals, selected3, true);
if (completions3.Any<Completion>()) completionSets.Add(new CompletionSet("Directive", "Directive", applicableTo, completions3, Enumerable.Empty<Completion>()));
}
}
Expand All @@ -162,14 +162,14 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
{
//AsmDudeToolsStatic.Output_INFO("CodeCompletionSource:AugmentCompletionSession; previous keyword is a jump mnemonic");
// previous keyword is jump (or call) mnemonic. Suggest "SHORT" or a label
var completions = Label_Completions(useCapitals, true);
var completions = this.Label_Completions(useCapitals, true);
if (completions.Any<Completion>()) completionSets.Add(new CompletionSet("Labels", "Labels", applicableTo, completions, Enumerable.Empty<Completion>()));

}
else if (previousKeyword.Equals("SHORT") || previousKeyword.Equals("NEAR"))
{
// Suggest a label
var completions = Label_Completions(useCapitals, false);
var completions = this.Label_Completions(useCapitals, false);
if (completions.Any<Completion>()) completionSets.Add(new CompletionSet("Labels", "Labels", applicableTo, completions, Enumerable.Empty<Completion>()));
}
else
Expand Down Expand Up @@ -199,7 +199,7 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
}
catch (Exception e)
{
AsmDudeToolsStatic.Output_ERROR(string.Format("{0}:AugmentCompletionSession; e={1}", ToString(), e.ToString()));
AsmDudeToolsStatic.Output_ERROR(string.Format("{0}:AugmentCompletionSession; e={1}", this.ToString(), e.ToString()));
}
}

Expand Down
Loading

0 comments on commit 1144ec6

Please sign in to comment.