Skip to content

Import EditorConfig templates from dotnet/templates - #85157

Merged
JoeRobich merged 131 commits into
dotnet:mainfrom
JoeRobich:merge/templates-editorconfig-into-roslyn
Sep 4, 2026
Merged

Import EditorConfig templates from dotnet/templates#85157
JoeRobich merged 131 commits into
dotnet:mainfrom
JoeRobich:merge/templates-editorconfig-into-roslyn

Conversation

@JoeRobich

@JoeRobich JoeRobich commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • import the EditorConfig template, wizard, command, and setup projects from dotnet/templates
  • retain the filtered source history and relocate the projects under src/VisualStudio/EditorConfig
  • integrate the projects with Roslyn project references, central package versions, solution filters, pkgdef generation, and Visual Studio 18 packaging
  • preserve the existing VSIX and SWIX component identities while adapting package, menu, and codebase registration to Roslyn's custom pkgdef targets

Source repository: https://github.com/dotnet/templates
Source ref: main at 454eb94c94bb02887843101928ad2f172b9f2aca

Validation

  • built all five imported projects with analyzers enabled
  • verified package, menu, and wizard codebase declarations against Roslyn's GeneratePkgDef.targets contract
  • verified representative git log --follow history through the source renames and Roslyn relocation
  • verified the final diff with git diff --check
  • performed independent pre-PR reviews and addressed the identified VSIX, pkgdef, and dependency issues
  • Ide.slnf validation was attempted, but the complete filter requires Windows/.NET Framework targeting packs unavailable on macOS; CI will provide the Windows packaging and full IDE validation

Test Insertion shows EditorConfigTemplates are properly inserted with no regressions.

Microsoft Reviewers: Open in CodeFlow

jmarolf and others added 30 commits April 18, 2018 14:24
…master

Merges/dev15.8 preview2 to master
…-preview2

Merges/dev15.7.x to dev15.8 preview2
Register packages through Roslyn pkgdef inputs, avoid duplicate Roslyn dependencies in the imported VSIXes, update VS 18 prerequisites, and preserve generated template setup paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cadde354-c3ae-424c-b0c3-11f3e3662848
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cadde354-c3ae-424c-b0c3-11f3e3662848
Copilot AI lite review requested due to automatic review settings September 3, 2026 22:50
@JoeRobich
JoeRobich requested review from a team as code owners September 3, 2026 22:50
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The imported wizard/command code has at least one user-visible correctness issue (possible null content passed to File.WriteAllText) plus a likely background-thread type-initialization failure risk in VSHelpers that should be fixed before merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 3 Medium severity · 2 Low severity

New issues introduced by this change (5)
Severity Finding
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​EditorConfigFileGenerator.csGetEditorconfigFileContents(...) can return null (e.g., Roslyn generator service…
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​RoslynEditorConfigFileGenerator.csServiceProvider.GlobalProvider.GetService(...) is cast with a direct cast to IComponentModel,…
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Utilities/​VSHelpers.cs — The static DTE property is initialized by calling GetService(...), which enforces UI-thread…
Low severity src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​TelemetrySessionAggregator.cs — Typo in the DEBUG-only helper parameter name descrption -> description. Keeping these debug…
Low severity src/​VisualStudio/​EditorConfig/​Wizard/​WizardResource.resx — User-facing English resource string has a grammatical error: “already exist” should be “already…
What changed in this PR

This PR imports the Visual Studio EditorConfig item template + wizard + context-menu command + setup/packaging projects into Roslyn under src/VisualStudio/EditorConfig/, wiring them into Roslyn’s solution structure and centralized package/version management.

Changes:

  • Adds new EditorConfig template, wizard, command, and setup projects (VSIX/SWR/pkgdef resources and localization assets).
  • Integrates the new projects into Roslyn.slnx and Ide.slnf.
  • Extends central package versions and repo docs to reflect the new VisualStudio/EditorConfig subtree.
File Description
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.zh-Hant.xlf Added localized VS package strings (zh-Hant).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.zh-Hans.xlf Added localized VS package strings (zh-Hans).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.tr.xlf Added localized VS package strings (tr).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.ru.xlf Added localized VS package strings (ru).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.pt-BR.xlf Added localized VS package strings (pt-BR).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.pl.xlf Added localized VS package strings (pl).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.ko.xlf Added localized VS package strings (ko).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.ja.xlf Added localized VS package strings (ja).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.it.xlf Added localized VS package strings (it).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.fr.xlf Added localized VS package strings (fr).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.es.xlf Added localized VS package strings (es).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.de.xlf Added localized VS package strings (de).
src/​VisualStudio/​EditorConfig/​WizardSetup/​xlf/​VSPackage.cs.xlf Added localized VS package strings (cs).
src/​VisualStudio/​EditorConfig/​WizardSetup/​VSPackage.resx Added English resource strings for WizardSetup package.
src/​VisualStudio/​EditorConfig/​WizardSetup/​source.extension.vsixmanifest Adds VSIX manifest for WizardSetup package.
src/​VisualStudio/​EditorConfig/​WizardSetup/​ResourcePackage.cs Adds AsyncPackage used for resource registration.
src/​VisualStudio/​EditorConfig/​WizardSetup/​Microsoft.VisualStudio.Templates.Editorconfig.Wizard.Setup.csproj New VSIX/setup project for wizard resource package.
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.zh-Hant.xlf Added localized wizard strings (zh-Hant).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.zh-Hans.xlf Added localized wizard strings (zh-Hans).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.tr.xlf Added localized wizard strings (tr).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.ru.xlf Added localized wizard strings (ru).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.pt-BR.xlf Added localized wizard strings (pt-BR).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.pl.xlf Added localized wizard strings (pl).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.ko.xlf Added localized wizard strings (ko).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.ja.xlf Added localized wizard strings (ja).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.it.xlf Added localized wizard strings (it).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.fr.xlf Added localized wizard strings (fr).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.es.xlf Added localized wizard strings (es).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.de.xlf Added localized wizard strings (de).
src/​VisualStudio/​EditorConfig/​Wizard/​xlf/​WizardResource.cs.xlf Added localized wizard strings (cs).
src/​VisualStudio/​EditorConfig/​Wizard/​WizardResource.resx Adds English resources used by the wizard UI/messages.
src/​VisualStudio/​EditorConfig/​Wizard/​WizardResource.Designer.cs Generated strongly-typed resource accessor for wizard resources.
src/​VisualStudio/​EditorConfig/​Wizard/​Utilities/​VSHelpers.cs Adds VS/DTE helper utilities used by wizard/commands.
src/​VisualStudio/​EditorConfig/​Wizard/​Utilities/​TemplateConstants.cs Adds embedded template .editorconfig content variants.
src/​VisualStudio/​EditorConfig/​Wizard/​Utilities/​ProjectTypes.cs Adds project kind GUID constants.
src/​VisualStudio/​EditorConfig/​Wizard/​Microsoft.VisualStudio.Templates.Editorconfig.Wizard.csproj New wizard project with Roslyn references and VS SDK packages.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​TelemetrySessionAggregator.cs Adds telemetry aggregation + DEBUG output-window tracing.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​TemplateInfo.cs Telemetry message model for template invocation.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​SingleLogMessage.cs Simple telemetry message wrapper.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​MessageData.cs Telemetry message data representation.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​ILogMessageData.cs Telemetry message data interface.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​ILogMessage.cs Telemetry message interface.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​EmptyLogMessage.cs Empty telemetry message implementation.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​LoggerHelpers.cs Telemetry naming + property-setting helpers.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Logger.UserTaskDisposable.cs Disposable wrapper for user-task telemetry scopes.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Logger.OperationDisposable.cs Disposable wrapper for operation telemetry scopes.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Logger.EmptyDisposable.cs No-op disposable used when opted out.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Logger.cs Logger facade for events/operations/faults.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Kinds/​UserTask.cs Telemetry enum for user tasks.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Kinds/​OperationId.cs Telemetry enum for operations.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Kinds/​EventId.cs Telemetry enum for events.
src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Kinds/​EnumExtensions.cs Enum-to-int helpers for telemetry naming.
src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​RoslynEditorConfigFileGenerator.cs Wraps Roslyn editorconfig generator service for content generation.
src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​EditorConfigFileGenerator.cs Implements creation/writing of .editorconfig files and VS hierarchy add.
src/​VisualStudio/​EditorConfig/​Wizard/​EditorconfigTemplateWizard.cs Implements VS template wizard entry point.
src/​VisualStudio/​EditorConfig/​Templates/​source.extension.vsixmanifest VSIX manifest for template assets.
src/​VisualStudio/​EditorConfig/​Templates/​Microsoft.VisualStudio.Templates.Editorconfig.csproj Template packaging project (rewrites .vstemplate assembly version).
src/​VisualStudio/​EditorConfig/​Templates/​EditorconfigDotnet.vstemplate Adds dotnet template definition.
src/​VisualStudio/​EditorConfig/​Templates/​EditorconfigDefault.vstemplate Adds default template definition.
src/​VisualStudio/​EditorConfig/​Templates/​Editorconfig.VB.DotNet.vstemplate Adds VB dotnet template definition.
src/​VisualStudio/​EditorConfig/​Templates/​Editorconfig.VB.Default.vstemplate Adds VB default template definition.
src/​VisualStudio/​EditorConfig/​Templates/​Editorconfig.CS.DotNet.vstemplate Adds C# dotnet template definition.
src/​VisualStudio/​EditorConfig/​Templates/​Editorconfig.CS.Default.vstemplate Adds C# default template definition.
src/​VisualStudio/​EditorConfig/​Templates/​Editorconfig.CS.AspNetCore.DotNet.vstemplate Adds ASP.NET Core dotnet template definition.
src/​VisualStudio/​EditorConfig/​Templates/​Editorconfig.CS.AspNetCore.Default.vstemplate Adds ASP.NET Core default template definition.
src/​VisualStudio/​EditorConfig/​Setup/​NewEditorconfigFileItem.vsdir Adds VS “New File Items” registrations for templates.
src/​VisualStudio/​EditorConfig/​Setup/​Microsoft.VisualStudio.Templates.Editorconfig.Setup.csproj Adds SWR-based insertion/setup project.
src/​VisualStudio/​EditorConfig/​Setup/​files.swr Adds SWR manifest for installed template files.
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.zh-Hant.xlf Added localized command strings (zh-Hant).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.zh-Hans.xlf Added localized command strings (zh-Hans).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.tr.xlf Added localized command strings (tr).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.ru.xlf Added localized command strings (ru).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.pt-BR.xlf Added localized command strings (pt-BR).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.pl.xlf Added localized command strings (pl).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.ko.xlf Added localized command strings (ko).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.ja.xlf Added localized command strings (ja).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.it.xlf Added localized command strings (it).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.fr.xlf Added localized command strings (fr).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.es.xlf Added localized command strings (es).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.de.xlf Added localized command strings (de).
src/​VisualStudio/​EditorConfig/​Command/​xlf/​VSCommandTable.vsct.cs.xlf Added localized command strings (cs).
src/​VisualStudio/​EditorConfig/​Command/​VSCommandTable.vsct Adds VSCT command table (menu items + placements).
src/​VisualStudio/​EditorConfig/​Command/​VSCommandTable.cs Adds generated command IDs/guids helper.
src/​VisualStudio/​EditorConfig/​Command/​source.extension.vsixmanifest VSIX manifest for the command package.
src/​VisualStudio/​EditorConfig/​Command/​PackageRegistration.pkgdef Adds pkgdef entry to register menu resources.
src/​VisualStudio/​EditorConfig/​Command/​Microsoft.VisualStudio.Templates.Editorconfig.Command.csproj New command VSIX project (VSCT compile, pkgdef generation).
src/​VisualStudio/​EditorConfig/​Command/​EditorconfigCommandPackage.cs AsyncPackage initialization for the command package.
src/​VisualStudio/​EditorConfig/​Command/​Commands/​CommandHandlerBase.cs AnyCode folder-view command handler base.
src/​VisualStudio/​EditorConfig/​Command/​Commands/​CommandBase.cs OleMenuCommand-based command helper for VS menus.
src/​VisualStudio/​EditorConfig/​Command/​Commands/​AddEditorConfigFileCommandProvider.cs MEF node extender wiring AnyCode command handler.
src/​VisualStudio/​EditorConfig/​Command/​Commands/​AddEditorConfigFileCommandHandler.cs Implements AnyCode “New EditorConfig” command execution.
src/​VisualStudio/​EditorConfig/​Command/​Commands/​AddEditorConfigFileCommand.cs Implements Solution Explorer “New EditorConfig” command execution.
Roslyn.slnx Adds the imported projects to Roslyn’s solution model.
Ide.slnf Includes the imported projects in the IDE solution filter.
eng/​Packages.props Adds central package versions needed by imported projects.
.gitignore Ignores generated ModifiedTemplates/ output.
.github/​memory/​FILE_MAP.md Updates repo file map to mention VisualStudio/EditorConfig.
.github/​instructions/​IDE.instructions.md Documents the new src/VisualStudio/EditorConfig/ subtree under IDE guidance.
Files not reviewed (1)
  • src/VisualStudio/EditorConfig/Wizard/WizardResource.Designer.cs: Generated file

Comment on lines +109 to +113
private static void WriteFile(string fileName, bool isDotnet, bool isAtSolutionLevel, string language)
{
string? editorconfigFileContents = GetEditorconfigFileContents(isDotnet, isAtSolutionLevel, language);
File.WriteAllText(fileName, editorconfigFileContents);
LogEvent(EventId.FileCreatedSuccessfully);
Comment on lines +20 to +30
try
{
var componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
var editorConfigGenerator = componentModel?.GetService<IEditorConfigGenerator>();
return editorConfigGenerator?.Generate(language);
}
catch (Exception ex)
{
LogException(ex, "Unable call roslyn editorconfig generator");
return null;
}
Comment on lines +18 to +26
private const string SolutionFolder = "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}";

public static DTE2 DTE { get; } = GetService<DTE, DTE2>();

public static TReturnType GetService<TServiceType, TReturnType>()
{
ThreadHelper.ThrowIfNotOnUIThread();
return (TReturnType)ServiceProvider.GlobalProvider.GetService(typeof(TServiceType));
}
Comment on lines +90 to +92
public async Task WriteTelemetryEventToOutputWindowAsync(TelemetryEvent telemetryEvent, string descrption)
{
await WriteLineToOutputWindowAsync($"{descrption}: {telemetryEvent}");
Comment on lines +120 to +122
<data name="AlreadyExists" xml:space="preserve">
<value>An .editorconfig file already exist in this location</value>
</data>
Copilot AI review requested due to automatic review settings September 4, 2026 03:45
@JoeRobich

Copy link
Copy Markdown
Member Author

/pr-val

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

View PR Validation Run triggered by @JoeRobich

Parameters
  • Validation Type: pr-val
  • Pipeline ID: 8972
  • Pipeline Version: main
  • PR Number: 85157
  • Commit SHA: 393d34ffbffb275b196a2ae3975700138cf61f59
  • Source Branch: merge/templates-editorconfig-into-roslyn
  • Target Branch: main
  • Build ID: 15210110

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

There are confirmed robustness and privacy/telemetry issues in the newly imported Wizard code paths that should be addressed before merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 1 High severity · 3 Medium severity · 2 Low severity

New issues introduced by this change (1)
Severity Finding
High severity src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​TemplateInfo.csTemplateInfo currently logs raw replacementsDictionary values to telemetry. The VS template…
Pre-existing issues (5)
Severity Finding
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Utilities/​VSHelpers.cs — The static DTE property is initialized by calling GetService(...), which enforces UI-thread… View comment
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​RoslynEditorConfigFileGenerator.csServiceProvider.GlobalProvider.GetService(...) is cast with a direct cast to IComponentModel,… View comment
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​EditorConfigFileGenerator.csGetEditorconfigFileContents(...) can return null (e.g., Roslyn generator service… View comment
Low severity src/​VisualStudio/​EditorConfig/​Wizard/​WizardResource.resx — User-facing English resource string has a grammatical error: “already exist” should be “already… View comment
Low severity src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​TelemetrySessionAggregator.cs — Typo in the DEBUG-only helper parameter name descrption -> description. Keeping these debug… View comment
Files not reviewed (1)
  • src/VisualStudio/EditorConfig/Wizard/WizardResource.Designer.cs: Generated file
Suppressed comments (6)

Previously missed (1) — in code that hasn't changed since the last review.

src/VisualStudio/EditorConfig/Wizard/Utilities/VSHelpers.cs:61

  • Directory.EnumerateFiles(..., SearchOption.AllDirectories) can throw (e.g., UnauthorizedAccessException/IOException) when walking a folder tree, especially for the AnyCode folder scenario. Since this is used to decide whether creation is supported, it’s better to treat enumeration failures as “no matching files” (or otherwise handle errors) rather than crashing the command.

src/VisualStudio/EditorConfig/Wizard/Utilities/VSHelpers.cs:24

  • VSHelpers.DTE is initialized via a type initializer that calls ThreadHelper.ThrowIfNotOnUIThread(). This can throw if the type is first touched off the UI thread (and also caches a potentially-null service). Consider making DTE a computed property and have GetService throw a clear exception when the service is unavailable, rather than returning null and failing later.
    src/VisualStudio/EditorConfig/Wizard/Generator/EditorConfigFileGenerator.cs:113
  • GetEditorconfigFileContents(...) can return null (e.g., if IEditorConfigGenerator isn’t available or throws), but WriteFile passes it directly to File.WriteAllText, which will throw ArgumentNullException. Consider falling back to the built-in DotNet/default templates (or failing gracefully) when generation returns null.
    src/VisualStudio/EditorConfig/Wizard/Generator/RoslynEditorConfigFileGenerator.cs:24
  • ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel)) can return null; the direct cast to IComponentModel would throw. Also the error message has a small grammar issue (missing "to"). Consider using as IComponentModel and keeping the failure path non-throwing.
    src/VisualStudio/EditorConfig/Wizard/Logging/TelemetrySessionAggregator.cs:92
  • Typo in parameter name descrption (and propagated to the output string). This is DEBUG-only, but it’s still easy to fix for readability/maintainability.
    src/VisualStudio/EditorConfig/Wizard/WizardResource.resx:122
  • The user-facing English resource string is grammatically incorrect ("already exist" → "already exists"). Since the corresponding .xlf files carry the source text too, this likely needs to be updated via the normal RESX→XLF flow so they stay in sync.

Comment on lines +21 to +30
public ImmutableArray<MessageData> GetMessageData()
{
var builder = ImmutableArray.CreateBuilder<MessageData>();
builder.Add(new MessageData("WizardRunKind", () => Enum.GetName(runKind.GetType(), runKind)));
foreach (var kvp in replacementsDictionary)
{
builder.Add(new MessageData("ReplacementsDictionaryValue", () => kvp.Value));
}
return builder.ToImmutable();
}
Normalize imported source headers and address Roslyn analyzer, nullability, MEF, and threading diagnostics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cadde354-c3ae-424c-b0c3-11f3e3662848
Copilot AI review requested due to automatic review settings September 4, 2026 05:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Several correctness and quality issues (telemetry property loss, resource-string grammar/localization sync, and template/IO robustness bugs) should be addressed before merging.

Review tier: Lite
Findings: 1 High severity · 3 Medium severity · 2 Low severity

Pre-existing issues (6)
Severity Finding
High severity src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​TemplateInfo.csTemplateInfo currently logs raw replacementsDictionary values to telemetry. The VS template… View comment
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Utilities/​VSHelpers.cs — The static DTE property is initialized by calling GetService(...), which enforces UI-thread… View comment
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​RoslynEditorConfigFileGenerator.csServiceProvider.GlobalProvider.GetService(...) is cast with a direct cast to IComponentModel,… View comment
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​EditorConfigFileGenerator.csGetEditorconfigFileContents(...) can return null (e.g., Roslyn generator service… View comment
Low severity src/​VisualStudio/​EditorConfig/​Wizard/​WizardResource.resx — User-facing English resource string has a grammatical error: “already exist” should be “already… View comment
Low severity src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​TelemetrySessionAggregator.cs — Typo in the DEBUG-only helper parameter name descrption -> description. Keeping these debug… View comment
Files not reviewed (1)
  • src/VisualStudio/EditorConfig/Wizard/WizardResource.Designer.cs: Generated file
Suppressed comments (7)

Previously missed (2) — in code that hasn't changed since the last review.

src/VisualStudio/EditorConfig/Wizard/Utilities/TemplateConstants.cs:307

  • The naming-symbol spec for type parameters appears to be incorrect: dotnet_naming_symbols.type_parameters.applicable_kinds = namespace. This prevents the type_parameters_should_be_tpascalcase rule from ever matching type parameters. (This line appears twice in the template constants.)

This issue also appears on line 669 of the same file.
src/VisualStudio/EditorConfig/Wizard/Utilities/VSHelpers.cs:63

  • Directory.EnumerateFiles(..., SearchOption.AllDirectories) can throw (e.g., UnauthorizedAccessException/IOException) when walking large trees, which would crash the command path that uses IsDotnet(directory). Since this is just a heuristic, it should fail closed and return false on IO/access errors.

src/VisualStudio/EditorConfig/Wizard/WizardResource.resx:122

  • The English resource string has a grammar error: "already exist" should be "already exists". This string is referenced by the generated Designer file and all XLF entries, so those will need to be regenerated/updated to keep localization in sync.
    src/VisualStudio/EditorConfig/Wizard/Logging/Messages/TemplateInfo.cs:30
  • TemplateInfo emits multiple MessageData entries with the same Name ("ReplacementsDictionaryValue"). LoggerHelpers.SetProperties deduplicates by property name, so only the first replacement value will be recorded and the rest are silently dropped.
    src/VisualStudio/EditorConfig/Wizard/Logging/TelemetrySessionAggregator.cs:95
  • In the DEBUG-only telemetry output helper, the parameter name "descrption" is misspelled (and used in the interpolated output). This makes the debug tracing harder to read/search.
    src/VisualStudio/EditorConfig/Wizard/Generator/RoslynEditorConfigFileGenerator.cs:31
  • The logged fault description has a typo/grammar issue ("Unable call"), which makes telemetry/error logs less searchable.
    src/VisualStudio/EditorConfig/Wizard/Utilities/TemplateConstants.cs:670
  • Same issue as earlier in this file: the type-parameter symbol spec uses applicable_kinds = namespace, which means the type-parameter naming rule can't apply.

Keep the insertion component name while preserving the package ID consumed by existing Visual Studio template manifests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cadde354-c3ae-424c-b0c3-11f3e3662848
Copilot AI review requested due to automatic review settings September 4, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

There are merge-blocking correctness/privacy issues in the newly added wizard/telemetry code paths (null file content write risk and logging of potentially sensitive template replacement values).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 2 High severity · 3 Medium severity · 2 Low severity

New issues introduced by this change (1)
Severity Finding
High severity src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​TemplateInfo.cs — TemplateInfo currently logs every replacementsDictionary value into telemetry. Template-wizard…
Pre-existing issues (6)
Severity Finding
High severity src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​Messages/​TemplateInfo.csTemplateInfo currently logs raw replacementsDictionary values to telemetry. The VS template… View comment
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Utilities/​VSHelpers.cs — The static DTE property is initialized by calling GetService(...), which enforces UI-thread… View comment
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​RoslynEditorConfigFileGenerator.csServiceProvider.GlobalProvider.GetService(...) is cast with a direct cast to IComponentModel,… View comment
Medium severity src/​VisualStudio/​EditorConfig/​Wizard/​Generator/​EditorConfigFileGenerator.csGetEditorconfigFileContents(...) can return null (e.g., Roslyn generator service… View comment
Low severity src/​VisualStudio/​EditorConfig/​Wizard/​WizardResource.resx — User-facing English resource string has a grammatical error: “already exist” should be “already… View comment
Low severity src/​VisualStudio/​EditorConfig/​Wizard/​Logging/​TelemetrySessionAggregator.cs — Typo in the DEBUG-only helper parameter name descrption -> description. Keeping these debug… View comment
Files not reviewed (1)
  • src/VisualStudio/EditorConfig/Wizard/WizardResource.Designer.cs: Generated file
Suppressed comments (5)

Previously missed (4) — in code that hasn't changed since the last review.

src/VisualStudio/EditorConfig/Wizard/Generator/EditorConfigFileGenerator.cs:66

  • LogCreateOperation currently reports Roslyn generation operations for any C#/VB language, even when isDotnet is false (so we actually write DefaultFileContent*). This makes telemetry/diagnostics misleading; the switch should prioritize isDotnet/isAtSolutionLevel first, then language only for the Roslyn-generator cases.
    src/VisualStudio/EditorConfig/Wizard/Generator/EditorConfigFileGenerator.cs:115
  • GetEditorconfigFileContents can return null (e.g., RoslynEditorConfigFileGenerator.Generate returns null or the language falls through to _ => null), which will throw ArgumentNullException in File.WriteAllText. Please ensure we always write a non-null fallback (and optionally log/telemetry when generation fails).
    src/VisualStudio/EditorConfig/Command/VSCommandTable.cs:14
  • PackageGuids.AddEditorConfig is a mutable static field; it should be readonly like AddEditorConfigCmdSet to avoid accidental reassignment and to match common Roslyn patterns for GUID constants.
    src/VisualStudio/EditorConfig/Wizard/Logging/TelemetrySessionAggregator.cs:95
  • Typo in parameter name descrption makes this debug-only helper harder to read/search; rename to description and update the interpolated string accordingly.

src/VisualStudio/EditorConfig/Wizard/WizardResource.resx:122

  • Grammar: "already exist" should be "already exists" in the English resource string. If you update the English source, please also update the corresponding text in the WizardResource.*.xlf files to keep localization sources in sync.

Comment on lines +27 to +30
foreach (var kvp in replacementsDictionary)
{
builder.Add(new MessageData("ReplacementsDictionaryValue", () => kvp.Value));
}
@JoeRobich

Copy link
Copy Markdown
Member Author

/pr-val

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

View PR Validation Run triggered by @JoeRobich

Parameters
  • Validation Type: pr-val
  • Pipeline ID: 8972
  • Pipeline Version: main
  • PR Number: 85157
  • Commit SHA: e49c1db69ef4063a0f2eab403b347b2c4d538591
  • Source Branch: merge/templates-editorconfig-into-roslyn
  • Target Branch: main
  • Build ID: 15212023

@jasonmalinowski jasonmalinowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signing off in that this code is moving, but I imagine there's some useful follow-ups to reduce the number of setup packages, or even just DLLs entirely.

- **EditorFeatures** (`src/EditorFeatures/`): VS Editor integration and text manipulation
- **VisualStudio** (`src/VisualStudio/`): Visual Studio-specific implementations
- **EditorConfig templates** (`src/VisualStudio/EditorConfig/`): item templates, generation wizard, context-menu command, VSIX projects, and Visual Studio insertion setup
- The setup insertion component is `Templates.Editorconfig.Setup`, but its SWR package identity must remain `Templates.Editorconfig.SolutionFile.Setup` because existing Visual Studio template packages depend on that ID.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd imagine we can just put this into the existing VSIX instead? Sure we'd have to remove a few lines of setup authoring when we insert but is that easier? (I admit I don't know the last time we removed a component, so maybe there's a surprise there)

| `Analyzers/`, `CodeStyle/` | ide | IDE0xxx code-style analyzers & fixes. |
| `LanguageServer/` | ide | LSP server. |
| `VisualStudio/` | ide | VS language services & UI. |
| `VisualStudio/` | ide | VS language services, UI, and EditorConfig template/wizard/command packaging under `EditorConfig/`. |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary change.

- **EditorFeatures** (`src/EditorFeatures/`): VS Editor integration and text manipulation
- **VisualStudio** (`src/VisualStudio/`): Visual Studio-specific implementations
- **EditorConfig templates** (`src/VisualStudio/EditorConfig/`): item templates, generation wizard, context-menu command, VSIX projects, and Visual Studio insertion setup
- The setup insertion component is `Templates.Editorconfig.Setup`, but its SWR package identity must remain `Templates.Editorconfig.SolutionFile.Setup` because existing Visual Studio template packages depend on that ID.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting this in IDE.instructions is probably a waste of context space.

Comment on lines +18 to +19
protected override bool QueryStatus(List<WorkspaceVisualNodeBase> selection)
=> selection.Count == 1 && selection[0] is IFolderNode;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which command is this defined for? Are we loading this package/DLL just to proffer a command like this? I'm just wondering if we were to pull this into any of our existing assemblies we can remove a DLL load.

Comment thread .gitignore
[Bb]inaries/
[Bb]in/
[Oo]bj/
src/VisualStudio/EditorConfig/Templates/ModifiedTemplates/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that should be landing in artifacts?

@JoeRobich
JoeRobich merged commit 0e119d1 into dotnet:main Sep 4, 2026
26 checks passed
@dotnet-policy-service dotnet-policy-service Bot added this to the Next milestone Sep 4, 2026
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.