Skip to content

Commit fb82f2a

Browse files
committed
Adding Update, Exclude, and Remove everywhere they currently are not.
This fixes dotnet#68, at least the ArgumentNullException part -- targets files without an Sdk attribute don't seem to work.
1 parent c59a82a commit fb82f2a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/ProjectFileTools/Completion/PackageCompletionSource.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ internal class PackageCompletionSource : ICompletionSource
2222
private static readonly IReadOnlyDictionary<string, string> AttributeToCompletionTypeMap = new Dictionary<string, string>(StringComparer.Ordinal)
2323
{
2424
{"Include", "Name" },
25+
{"Update", "Name" },
26+
{"Exclude", "Name" },
27+
{"Remove", "Name" },
2528
{"Version", "Version" }
2629
};
2730

@@ -85,7 +88,10 @@ public static bool TryGetPackageInfoFromXml(XmlInfo info, out string packageName
8588
&& info.AttributeName != null && AttributeToCompletionTypeMap.ContainsKey(info.AttributeName)
8689
&& info.TryGetElement(out XElement element))
8790
{
88-
XAttribute name = element.Attribute(XName.Get("Include"));
91+
XAttribute name = element.Attribute(XName.Get("Include"))
92+
?? element.Attribute(XName.Get("Update"))
93+
?? element.Attribute(XName.Get("Exclude"))
94+
?? element.Attribute(XName.Get("Remove"));
8995
XAttribute version = element.Attribute(XName.Get("Version"));
9096
packageName = name?.Value;
9197
packageVersion = version?.Value;

src/ProjectFileTools/GoToDefinition/GoToDefinitionController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ internal static GotoDefinitionController CreateAndRegister(IWpfTextView textview
145145
{
146146
ThreadHelper.ThrowIfNotOnUIThread();
147147

148-
if (info.AttributeName == "Include")
148+
if (info.AttributeName == "Include" || info.AttributeName == "Update" || info.AttributeName == "Exclude" || info.AttributeName == "Remove")
149149
{
150150
string relativePath = info.AttributeValue;
151151
IWorkspace workspace = workspaceManager.GetWorkspace(textDoc.FilePath);

0 commit comments

Comments
 (0)