CaseFormatter is a VS Code extension that converts selected C# entity/class code into a TypeScript interface.
Features
- Converts properties (
get; set; and get; init;) inside a C# class into TypeScript fields
- Provides multiple case options for output field names:
camelCase
PascalCase
lowercase
UPPERCASE
- Includes Command Palette and keyboard shortcut support
Usage
- Open a file containing a C# class/entity.
- Select the class block you want to convert.
- Run the command:
- Command Palette:
CaseFormatter: Generate Interface from Entity
- Shortcut:
Ctrl+Alt+I (macOS: Cmd+Alt+I)
- Choose the desired output case format from the list.
- The selected text will be replaced with the generated TypeScript interface.
Example
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public decimal? Price { get; set; }
public DateTime CreatedAt { get; set; }
}
Output
export interface IProduct {
id: number;
name: string;
price: number | null;
createdAt: string;
}
Extension Settings
This extension adds the following setting:
caseformatter.defaultCase: Default field naming format (camel, pascal, lower, upper)
Requirements
- Visual Studio Code
^1.116.0
Release Notes
See the CHANGELOG.md file for version history.
License
MIT – see LICENSE for details.
CaseFormatter, seçtiğiniz C# entity/class metnini TypeScript interface çıktısına dönüştüren bir VS Code eklentisidir.
Özellikler
- C#
class içindeki property'leri (get; set; ve get; init;) TypeScript alanlarına çevirir
- Çıktı alan adları için farklı case seçenekleri sunar:
camelCase
PascalCase
lowercase
UPPERCASE
- Komut paleti ve klavye kısayolu desteği içerir
Kullanım
- C# class/entity içeren bir dosya açın.
- Dönüştürmek istediğiniz class bloğunu seçin.
- Komutu çalıştırın:
- Komut Paleti:
CaseFormatter: Entity'den Interface Üret
- Kısayol:
Ctrl+Alt+I (macOS: Cmd+Alt+I)
- Açılan listeden çıktı case biçimini seçin.
- Seçili metin, üretilen TypeScript interface ile değiştirilir.
Örnek
Girdi:
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public decimal? Price { get; set; }
public DateTime CreatedAt { get; set; }
}
Çıktı:
export interface IProduct {
id: number;
name: string;
price: number | null;
createdAt: string;
}
Eklenti Ayarları
Bu eklenti aşağıdaki ayarı ekler:
caseformatter.defaultCase: Varsayılan alan adlandırma biçimi (camel, pascal, lower, upper)
Gereksinimler
- Visual Studio Code
^1.116.0
Sürüm Notları
Sürüm geçmişi için CHANGELOG.md dosyasına bakabilirsiniz.
Lisans
MIT - detaylar için LICENSE.