Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Adding Update, Exclude, and Remove everywhere they currently are not. #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/ProjectFileTools/Completion/PackageCompletionSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ internal class PackageCompletionSource : ICompletionSource
private static readonly IReadOnlyDictionary<string, string> AttributeToCompletionTypeMap = new Dictionary<string, string>(StringComparer.Ordinal)
{
{"Include", "Name" },
{"Update", "Name" },
{"Exclude", "Name" },
{"Remove", "Name" },
{"Version", "Version" }
};

Expand Down Expand Up @@ -85,7 +88,10 @@ public static bool TryGetPackageInfoFromXml(XmlInfo info, out string packageName
&& info.AttributeName != null && AttributeToCompletionTypeMap.ContainsKey(info.AttributeName)
&& info.TryGetElement(out XElement element))
{
XAttribute name = element.Attribute(XName.Get("Include"));
XAttribute name = element.Attribute(XName.Get("Include"))
?? element.Attribute(XName.Get("Update"))
?? element.Attribute(XName.Get("Exclude"))
?? element.Attribute(XName.Get("Remove"));
XAttribute version = element.Attribute(XName.Get("Version"));
packageName = name?.Value;
packageVersion = version?.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ internal static GotoDefinitionController CreateAndRegister(IWpfTextView textview
{
ThreadHelper.ThrowIfNotOnUIThread();

if (info.AttributeName == "Include")
if (info.AttributeName == "Include" || info.AttributeName == "Update" || info.AttributeName == "Exclude" || info.AttributeName == "Remove")
{
string relativePath = info.AttributeValue;
IWorkspace workspace = workspaceManager.GetWorkspace(textDoc.FilePath);
Expand Down