Файли
openidea/src/platform/fileTemplates.ts
T
l0ng-ai 2859ec9106 feat(templates): New ▸ C# Class with the project's namespace (#3216)
Class, Interface, Struct, Enum and Record. The namespace is the nearest .csproj's
RootNamespace (else its file name) plus the folders below it. Projects on C# 10 or later
(.NET 6+, or LangVersion 10/latest) get a file-scoped namespace; .NET Framework, Unity,
.NET Standard and .NET Core projects get a namespace block.

Fixes #3190
2026-11-14 01:17:26 +08:00

38 рядки
1.3 KiB
TypeScript
Неформатований Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
export type NameStyle = "asis" | "snake" | "pascal" | "kebab";
export interface FileTemplateKind {
id: string;
label: string;
body: string;
/** Overrides the template's extension (Stylesheet › CSS / SCSS / Less). */
extension?: string;
}
export interface FileTemplate {
id: string;
/** Menu label, e.g. "Rust File". */
name: string;
icon: string;
/** Without the dot; empty for "File…" (the name carries the extension). */
extension: string;
nameStyle: NameStyle;
/**
* Package inference: `jvm` (Java/Kotlin source roots), `go` (directory), `php` (composer.json
* PSR-4) or `csharp` (the nearest .csproj's root namespace and the folders below it).
*/
packageStyle?: "jvm" | "go" | "php" | "csharp";
/** Dotted names (`com.acme.Foo`) create package directories. */
dottedPackages?: boolean;
kinds: FileTemplateKind[];
enabled?: boolean;
/** Prefilled name for fixed-name files (`Dockerfile`, `.editorconfig`). */
defaultName?: string;
/** Exact filename supplied by a plugin; skips the name prompt. */
fileName?: string;
variables?: { name: string; prompt: string }[];
/** Infer package style from the extension using the built-in rules. */
inferPackage?: boolean;
/** Reformat according to style: run Reformat Code on the new file (unset: on, as IDEA). */
reformat?: boolean;
}