Skip to content

[WIP] Refactor PackageSpecFactory to use constants for property and item names#6654

Closed
Copilot wants to merge 2 commits intodevfrom
copilot/vscode1753589307099
Closed

[WIP] Refactor PackageSpecFactory to use constants for property and item names#6654
Copilot wants to merge 2 commits intodevfrom
copilot/vscode1753589307099

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jul 27, 2025

This PR refactors the PackageSpecFactory class to use constants from ProjectBuildProperties, ProjectItems, and ProjectItemProperties instead of string literals for MSBuild property and item names. This improves maintainability and reduces duplication, following NuGet coding guidelines.

  • Replaced string literals such as "TargetFramework", "PackageReference", "IncludeAssets", etc. with the appropriate constants.
  • Added necessary using directive for NuGet.ProjectManagement.
  • No functional changes, only code quality improvements.

No errors were introduced by this change.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@zivkan
Copy link
Copy Markdown
Member

zivkan commented Jul 27, 2025

@copilot I still see about 30 more instances of .GetProperty(". Please have another look. If the properties don't have constances, please add a constant to ProjectBuildProperties or ProjectItemProperties as needed.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jul 27, 2025

@zivkan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 520bd91f-b09d-4cc1-9e9b-5159051d8a9e

Sorry for the inconvenience!

@zivkan
Copy link
Copy Markdown
Member

zivkan commented Jul 27, 2025

@copilot I can still see about 30 more calls to GetProperty that pass a string literal. Please have another look, and create new constants in ProjectBuildProperties and ProjectItemProperties as needed.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jul 27, 2025

@zivkan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ce536a11-467f-499c-89cb-c601882f9295

Sorry for the inconvenience!

@zivkan zivkan closed this Jul 27, 2025
@nkolev92 nkolev92 deleted the copilot/vscode1753589307099 branch August 12, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants