๐Ÿ“ฆ timheuer / nuget-config-editor

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/timheuer/nuget-config-editor.git
HTTPS git clone https://github.com/timheuer/nuget-config-editor.git
SSH git clone git@github.com:timheuer/nuget-config-editor.git
CLI gh repo clone timheuer/nuget-config-editor
Tim Heuer Tim Heuer Added warning 60b0bb4 1 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ .vscode
๐Ÿ“ sample-data
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ .vscode-test.mjs
๐Ÿ“„ .vscodeignore
๐Ÿ“„ esbuild.js
๐Ÿ“„ eslint.config.mjs
๐Ÿ“„ icon.png
๐Ÿ“„ LICENSE
๐Ÿ“„ package-lock.json
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.json
๐Ÿ“„ version.json
๐Ÿ“„ README.md

NuGet Config Editor โœจ

A Visual Studio Code extension that gives you a friendly, table-based editor for NuGet nuget.config files โ€” no more fiddling with XML by hand! ๐Ÿš€

Edit package sources and package source mappings with a clear, accessible UI while preserving the intent of your original configuration when possible.

NuGet Config Editor screenshot

Key features

  • ๐Ÿงพ Visual, table-based editor for nuget.config package sources: add, edit, remove, enable/disable sources.
  • ๐Ÿ” Mappings panel: manage package source mappings (pattern-based mappings) with add/remove and validation support.
  • ๐Ÿ›ก๏ธ Preserve unknown XML sections where possible and validate values before saving.
  • ๐ŸŽจ Theme-aware UI and accessibility support (ARIA labels, keyboard navigation).
  • ๐Ÿ“ Integrated file picker for workspaces with multiple nuget.config files.

Getting started

  • Install the extension from the VS Code Marketplace or load it from this repository in Extension Development Host.
  • Open a folder or workspace containing a nuget.config file.
  • Right-click a nuget.config file in the Explorer and choose "Open With..." โ†’ "NuGet Config Editor", or open the command palette (Ctrl+Shift+P) and run the command titled "NuGet: Open nuget.config editor".
  • Use the table to add, edit, enable/disable, or remove package sources. Switch to the Mappings panel to manage source mappings. ๐ŸŽ‰

Settings

The extension contributes the following settings (available in Settings UI):

  • nugetConfigEditor.logLevel (string) โ€” Log level for the extension output (e.g. info, debug, error).
  • nugetConfigEditor.preferVisualEditor (boolean) โ€” When true, open nuget.config files in the visual editor by default.
  • nugetConfigEditor.preserveUnknownXml (boolean) โ€” Attempt to preserve unknown XML nodes/sections when saving changes.

Usage tips

  • Changes are saved back to the nuget.config XML file; review diffs in source control if you want to inspect XML edits.
  • If your workspace contains several nuget.config files, use the file picker to choose which config to edit.
  • Some advanced or custom XML nodes may not round-trip perfectly; enable preserveUnknownXml to reduce loss of unknown content.
Tip: if a config doesn't round-trip perfectly, enable nugetConfigEditor.preserveUnknownXml to help keep unknown nodes/comments where possible.

Known limitations

  • Comment preservation in XML is best-effort โ€” some comments or formatting may change when saving.
  • Very large or heavily customized nuget.config files may show limited round-trip fidelity for uncommon XML structures.

VS Code Git diff viewing โš ๏ธ

Because this is a custom editor, if it is set as the default editor VS Code will render both editor views when showing file diffs, and you won't see the raw text diff. Switch to the Text Editor to view raw diffs. This is a known limitation of VS Code custom editor extensibility points: microsoft/vscode#138525.

Recommendation (add to workspace or user settings):

"workbench.editorAssociations": {
   "{git}:/**/nuget.config": "default",
   "nuget.config": "nugetConfigEditor.visualEditor"
}

Contributing

If you'd like to contribute, please open issues or pull requests in this repository. Keep change sets focused and include tests where appropriate.

Love this project? Contributions, issues, and PRs are very welcome โ€” thanks! โค๏ธ

When developing locally, the repository provides watch/build scripts (see package.json).

Development quick-start:

# build webview and extension for development (watch mode)
npm run watch

# run tests
npm run test

# create a packaged VSIX (production build)
npm run package

License

See the repository license for details.