Skip to content

Commit

Permalink
bugfix: register statement completions were double
Browse files Browse the repository at this point in the history
  • Loading branch information
HJLebbink committed Aug 26, 2016
1 parent 03f0c73 commit 3153a34
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
CompletionSet existingCompletions = completionSets[0];
List<Completion> allCompletionsList = new List<Completion>(intrinsicCompletions);

if (partialKeyword.Length > 2)
if (partialKeyword.Length > 2) // only add existing code completions when the partial keyword has more than 2 chars, this for speed considerations
{
foreach (Completion completion in existingCompletions.Completions)
{
Expand All @@ -98,8 +98,10 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
{
if (insertionText.StartsWith(partialKeyword))
{
allCompletionsList.Add(new Completion(completion.DisplayText, insertionText, completion.Description, completion.IconSource, completion.IconAutomationText));
//set_all.Add(completion);
if (!IntrinsicTools.isSimdRegister(insertionText)) {
allCompletionsList.Add(new Completion(completion.DisplayText, insertionText, completion.Description, completion.IconSource, completion.IconAutomationText));
//set_all.Add(completion); // adding the completion without a deep copy does not work.
}
}
}
}
Expand Down Expand Up @@ -268,6 +270,7 @@ private Completion decorate(Completion completion, string str)
string displayText = completion.DisplayText.Replace(" [", " "+str+"[");
return new Completion(displayText, completion.InsertionText, completion.Description, completion.IconSource, completion.IconAutomationText);
}

#endregion
}
}
24 changes: 24 additions & 0 deletions VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,28 @@ public static bool isSimdRegister(ParamType type)
}
}

public static bool isSimdRegister(string str) {
switch (str.ToUpper()) {
case "__M128":
case "__M128D":
case "__M128I":
case "__M256":
case "__M256D":
case "__M256I":
case "__M512":
case "__M512D":
case "__M512I":
case "__M64":
case "__MMASK16":
case "__MMASK32":
case "__MMASK64":
case "__MMASK8":
return true;
default:
return false;
}
}

/// <summary>
/// Write cpuIDs to string. If silence_DEFAULT is true, the CpuID.DEFAULT is not written.
/// </summary>
Expand Down Expand Up @@ -824,6 +846,8 @@ public static string getCpuID_Documentation(CpuID cpuID)
switch (cpuID)
{
case CpuID.NONE: return "";
case CpuID.SVML: return "";
case CpuID.IA32: return "";
case CpuID.ADX: return "Multi-Precision Add-Carry Instruction Extension";
case CpuID.AES: return "Advanced Encryption Standard Extension";
case CpuID.AVX: return "";
Expand Down

0 comments on commit 3153a34

Please sign in to comment.