Skip to content

Commit

Permalink
Style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
HJLebbink committed Jan 2, 2017
1 parent 13287ce commit 66f3f14
Show file tree
Hide file tree
Showing 36 changed files with 529 additions and 522 deletions.
2 changes: 1 addition & 1 deletion VS/CSHARP/intrinsics-dude-vsix/IntrinsicsDudePackage.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2016 Henk-Jan Lebbink
// Copyright (c) 2017 Henk-Jan Lebbink
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion VS/CSHARP/intrinsics-dude-vsix/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Henk-Jan Lebbink
Copyright (c) 2017 Henk-Jan Lebbink

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VS/CSHARP/intrinsics-dude-vsix/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2016 Henk-Jan Lebbink
// Copyright (c) 2017 Henk-Jan Lebbink
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2016 Henk-Jan Lebbink
// Copyright (c) 2017 Henk-Jan Lebbink
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -67,7 +67,7 @@ public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qui
{
DateTime time1 = DateTime.Now;

ITextSnapshot snapshot = _sourceBuffer.CurrentSnapshot;
ITextSnapshot snapshot = this._sourceBuffer.CurrentSnapshot;
var triggerPoint = (SnapshotPoint)session.GetTriggerPoint(snapshot);
if (triggerPoint == null)
{
Expand All @@ -82,19 +82,19 @@ public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qui
if (enumerator.Count() > 0)
{
IMappingTagSpan<IntrinsicTokenTag> tokenTag = enumerator.First();
switch (tokenTag.Tag.type)
switch (tokenTag.Tag.Type)
{
case IntrinsicTokenType.Intrinsic:
{
SnapshotSpan tagSpan = tokenTag.Span.GetSpans(_sourceBuffer).First();
SnapshotSpan tagSpan = tokenTag.Span.GetSpans(this._sourceBuffer).First();
string keyword = tagSpan.GetText();
applicableToSpan = snapshot.CreateTrackingSpan(tagSpan, SpanTrackingMode.EdgeExclusive);

//IntrinsicsDudeToolsStatic.Output("INFO: IntrinsicsQuickInfoSource: AugmentQuickInfoSession: keyword=" + keyword);
Intrinsic intrinsic = IntrinsicTools.parseIntrinsic(keyword, false);
Intrinsic intrinsic = IntrinsicTools.GarseIntrinsic(keyword, false);
if (intrinsic != Intrinsic.NONE)
{
IList<IntrinsicDataElement> dataElements = this._intrinsicDudeTools.intrinsicStore.get(intrinsic);
IList<IntrinsicDataElement> dataElements = this._intrinsicDudeTools.IntrinsicStore.Get(intrinsic);
if (dataElements.Count > 0)
{
//IntrinsicsDudeToolsStatic.Output("INFO: IntrinsicsQuickInfoSource: AugmentQuickInfoSession: intrinsic=" + intrinsic);
Expand All @@ -103,22 +103,22 @@ public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qui
//IntrinsicsDudeToolsStatic.Output("INFO: IntrinsicsQuickInfoSource: AugmentQuickInfoSession: removing existing content: intrinsic=" + intrinsic + "; " + quickInfoContent[0].ToString());
quickInfoContent.Clear(); // throw the existing quickinfo away
}
quickInfoContent.Add(dataElements[0].documentationTextBlock); //only show the description of the first intrinsic data element
quickInfoContent.Add(dataElements[0].DocumentationTextBlock); //only show the description of the first intrinsic data element
}
}
}
break;
case IntrinsicTokenType.RegType:
{
SnapshotSpan tagSpan = tokenTag.Span.GetSpans(_sourceBuffer).First();
SnapshotSpan tagSpan = tokenTag.Span.GetSpans(this._sourceBuffer).First();
string keyword = tagSpan.GetText();
applicableToSpan = snapshot.CreateTrackingSpan(tagSpan, SpanTrackingMode.EdgeExclusive);

SimdRegisterType reg = IntrinsicTools.parseSimdRegisterType(keyword, true);
SimdRegisterType reg = IntrinsicTools.ParseSimdRegisterType(keyword, true);
if (reg != SimdRegisterType.NONE)
{
//IntrinsicsDudeToolsStatic.Output("INFO: IntrinsicsQuickInfoSource: AugmentQuickInfoSession: reg=" + reg);
TextBlock description = this.makeRegisterDescription(reg);
TextBlock description = this.MakeRegisterDescription(reg);
if (description != null)
{
quickInfoContent.Add(description);
Expand All @@ -129,7 +129,7 @@ public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qui
default: break;
}
}
IntrinsicsDudeToolsStatic.printSpeedWarning(time1, "QuickInfo");
IntrinsicsDudeToolsStatic.PrintSpeedWarning(time1, "QuickInfo");
}
catch (Exception e)
{
Expand All @@ -144,25 +144,29 @@ public void Dispose()

#region Private Methods

private TextBlock makeRegisterDescription(SimdRegisterType reg)
private TextBlock MakeRegisterDescription(SimdRegisterType reg)
{
TextBlock description = new TextBlock();
description.Inlines.Add(makeRunBold(reg.ToString()));
description.Inlines.Add(MakeRunBold(reg.ToString()));
return description;
}

private static Run makeRunBold(string str)
private static Run MakeRunBold(string str)
{
Run r1 = new Run(str);
r1.FontWeight = FontWeights.Bold;
Run r1 = new Run(str)
{
FontWeight = FontWeights.Bold
};
return r1;
}

private static Run makeRun2(string str, System.Drawing.Color color)
private static Run MakeRun2(string str, System.Drawing.Color color)
{
Run r1 = new Run(str);
r1.FontWeight = FontWeights.Bold;
r1.Foreground = new SolidColorBrush(IntrinsicsDudeToolsStatic.convertColor(color));
Run r1 = new Run(str)
{
FontWeight = FontWeights.Bold,
Foreground = new SolidColorBrush(IntrinsicsDudeToolsStatic.ConvertColor(color))
};
return r1;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2016 Henk-Jan Lebbink
// Copyright (c) 2017 Henk-Jan Lebbink
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -43,11 +43,12 @@ internal sealed class IntrinsicsQuickInfoSourceProvider : IQuickInfoSourceProvid
[Import]
private IBufferTagAggregatorFactoryService _aggregatorFactory = null;


public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer buffer)
{
Func<IntrinsicsQuickInfoSource> sc = delegate ()
{
ITagAggregator<IntrinsicTokenTag> aggregator = IntrinsicsDudeToolsStatic.getAggregator(buffer, _aggregatorFactory);
ITagAggregator<IntrinsicTokenTag> aggregator = IntrinsicsDudeToolsStatic.GetAggregator(buffer, this._aggregatorFactory);
return new IntrinsicsQuickInfoSource(buffer, aggregator);
};
//IntrinsicsDudeToolsStatic.Output("INFO: IntrinsicsQuickInfoSourceProvider: TryCreateQuickInfoSource");
Expand Down
12 changes: 6 additions & 6 deletions VS/CSHARP/intrinsics-dude-vsix/SignHelp/IntrParam.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2016 Henk-Jan Lebbink
// Copyright (c) 2017 Henk-Jan Lebbink
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -29,11 +29,11 @@ internal class IntrParam : IParameter
{
public IntrParam(string documentation, Span locus, string name, ISignature signature)
{
Documentation = documentation;
Locus = locus;
Name = name;
Signature = signature;
PrettyPrintedLocus = locus;
this.Documentation = documentation;
this.Locus = locus;
this.Name = name;
this.Signature = signature;
this.PrettyPrintedLocus = locus;
}
public string Documentation { get; private set; }
public Span Locus { get; private set; }
Expand Down
35 changes: 15 additions & 20 deletions VS/CSHARP/intrinsics-dude-vsix/SignHelp/IntrSign.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2016 Henk-Jan Lebbink
// Copyright (c) 2017 Henk-Jan Lebbink
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -52,14 +52,14 @@ internal IntrSign(ITextBuffer subjectBuffer, string content, string doc, ReadOnl
public event EventHandler<CurrentParameterChangedEventArgs> CurrentParameterChanged;

public IParameter CurrentParameter {
get { return m_currentParameter; }
get { return this.m_currentParameter; }
internal set {
if (m_currentParameter != value)
if (this.m_currentParameter != value)
{
IParameter prevCurrentParameter = m_currentParameter;
m_currentParameter = value;
IParameter prevCurrentParameter = this.m_currentParameter;
this.m_currentParameter = value;
//IntrinsicsDudeToolsStatic.Output("INFO: IntrSign: CurrentParameter: going to RaiseCurrentParameterChanged.");
this.RaiseCurrentParameterChanged(prevCurrentParameter, m_currentParameter);
this.RaiseCurrentParameterChanged(prevCurrentParameter, this.m_currentParameter);
}
}
}
Expand All @@ -76,23 +76,23 @@ public void SetCurrentParameter(int paramIndex)
}

public string Content {
get { return (m_content); }
internal set { m_content = value; }
get { return (this.m_content); }
internal set { this.m_content = value; }
}

public string Documentation {
get { return (m_documentation); }
internal set { m_documentation = value; }
get { return (this.m_documentation); }
internal set { this.m_documentation = value; }
}

public ReadOnlyCollection<IParameter> Parameters {
get { return (m_parameters); }
internal set { m_parameters = value; }
get { return (this.m_parameters); }
internal set { this.m_parameters = value; }
}

public string PrettyPrintedContent {
get { return (m_printContent); }
internal set { m_printContent = value; }
get { return (this.m_printContent); }
internal set { this.m_printContent = value; }
}

#endregion
Expand All @@ -102,12 +102,7 @@ public string PrettyPrintedContent {
void RaiseCurrentParameterChanged(IParameter prevCurrentParameter, IParameter newCurrentParameter)
{
//IntrinsicsDudeToolsStatic.Output("INFO: IntrSign: RaiseCurrentParameterChanged");

EventHandler<CurrentParameterChangedEventArgs> tempHandler = this.CurrentParameterChanged;
if (tempHandler != null)
{
tempHandler(this, new CurrentParameterChangedEventArgs(prevCurrentParameter, newCurrentParameter));
}
this.CurrentParameterChanged?.Invoke(this, new CurrentParameterChangedEventArgs(prevCurrentParameter, newCurrentParameter));
}
#endregion

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2016 Henk-Jan Lebbink
// Copyright (c) 2017 Henk-Jan Lebbink
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -67,9 +67,9 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv

if (typedChar.Equals('('))
{
SnapshotPoint point = _textView.Caret.Position.BufferPosition - 1; //move the point back so it's in the preceding word
string word = _navigator.GetExtentOfWord(point).Span.GetText();
Intrinsic intrinsic = IntrinsicTools.parseIntrinsic(word, false);
SnapshotPoint point = this._textView.Caret.Position.BufferPosition - 1; //move the point back so it's in the preceding word
string word = this._navigator.GetExtentOfWord(point).Span.GetText();
Intrinsic intrinsic = IntrinsicTools.ParseIntrinsic(word, false);
//IntrinsicsDudeToolsStatic.Output("INFO: IntrSignHelpCommandHandler: Exec: after '(', word=\"" + word + "\"; intrinsic=" + intrinsic);
if (intrinsic != Intrinsic.NONE)
{
Expand All @@ -79,15 +79,15 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv
this._session.Dismiss();
}
this._session = this._broker.CreateSignatureHelpSession(this._textView, this._textView.TextSnapshot.CreateTrackingPoint(point + 1, PointTrackingMode.Positive), true);
this._session.Dismissed += (sender, args) => _session = null;
this._session.Dismissed += (sender, args) => this._session = null;
this._session.Start();
//IntrinsicsDudeToolsStatic.Output("INFO: IntrSignHelpCommandHandler: Exec: started a new session(" + m_session.GetTriggerPoint(m_textView.TextBuffer)+")");
}
}
if (typedChar.Equals(','))
{
SnapshotPoint point = this._textView.Caret.Position.BufferPosition - 1; //move the point back so it's in the preceding word
Tuple<Intrinsic, int> tup = IntrinsicTools.getIntrinsicAndParamIndex(point, this._navigator);
Tuple<Intrinsic, int> tup = IntrinsicTools.GetIntrinsicAndParamIndex(point, this._navigator);
Intrinsic intrinsic = tup.Item1;
//IntrinsicsDudeToolsStatic.Output("INFO: IntrSignHelpCommandHandler: Exec: after ',', intrinsic=" + intrinsic);
if (intrinsic != Intrinsic.NONE)
Expand All @@ -98,12 +98,12 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv
this._session.Dismiss();
}
this._session = this._broker.CreateSignatureHelpSession(this._textView, this._textView.TextSnapshot.CreateTrackingPoint(point + 1, PointTrackingMode.Positive), true);
this._session.Dismissed += (sender, args) => _session = null;
this._session.Dismissed += (sender, args) => this._session = null;
this._session.Start();
//IntrinsicsDudeToolsStatic.Output("INFO: IntrSignHelpCommandHandler: Exec: started a new session(" + m_session.GetTriggerPoint(m_textView.TextBuffer) + ")");
}
}
else if ((typedChar.Equals(')') || typedChar.Equals(';') || typedChar.Equals('=')) && (_session != null))
else if ((typedChar.Equals(')') || typedChar.Equals(';') || typedChar.Equals('=')) && (this._session != null))
{
//IntrinsicsDudeToolsStatic.Output("INFO: IntrSignHelpCommandHandler: Exec: going to close the session(" + m_session.GetTriggerPoint(m_textView.TextBuffer) + ")");
this._session.Dismiss();
Expand All @@ -122,7 +122,7 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv

public int QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
{
return _nextCommandHandler.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText);
return this._nextCommandHandler.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText);
}

#region Private Stuff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2016 Henk-Jan Lebbink
// Copyright (c) 2017 Henk-Jan Lebbink
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -47,11 +47,11 @@ internal sealed class IntrSignHelpCommandProvider : IVsTextViewCreationListener

public void VsTextViewCreated(IVsTextView textViewAdapter)
{
ITextView textView = _adapterService.GetWpfTextView(textViewAdapter);
ITextView textView = this._adapterService.GetWpfTextView(textViewAdapter);
if (textView != null)
{
textView.Properties.GetOrCreateSingletonProperty(
() => new IntrSignHelpCommandHandler(textViewAdapter, textView, _navigatorService.GetTextStructureNavigator(textView.TextBuffer), _signatureHelpBroker)
() => new IntrSignHelpCommandHandler(textViewAdapter, textView, this._navigatorService.GetTextStructureNavigator(textView.TextBuffer), this._signatureHelpBroker)
);
}
}
Expand Down
Loading

0 comments on commit 66f3f14

Please sign in to comment.