Visual Studio Code language support for FRG files - a custom language for defining API handlers, types, and services with Go code generation.
- Comprehensive syntax highlighting for all FRG language constructs
- Support for keywords:
syntax,info,import,type,enum,struct,service,returns - Built-in types:
string,bool,int,int32,int64,float,float32,float64,double,map,array,any,interface{} - Decorators:
@handler,@attr,@externDefs - HTTP methods:
get,post,put,delete,patch - Enhanced comment highlighting with keyword support (
// summary:,// tags:, etc.) - Go struct tags highlighting
- Go to Definition (
F12)- Jump from
@handlernames to Go function implementations - Navigate between
type/enumdefinitions and their usages
- Jump from
- Find All References (
Shift+F12)- Quickly find where types and enums are used
- Document Symbol Provider
- Outline view with breadcrumbs
- Navigate to services, handlers, types, enums
- Document Formatting (
Shift+Alt+F/Shift+Opt+F)- Auto-align fields in
typeandstructblocks - 4-space indentation
- Preserves comments and structure
- Auto-align fields in
- Range Formatting - Format selected text only
- Import File Links - Clickable import paths
- Reference Code Lens - Shows reference count above type/enum definitions
syntax = "v1"
info(
title: "Demo API"
desc: "A comprehensive FRG language example"
version: "v1.0.0"
)
type User {
ID string `json:"id"`
Email string `json:"email" validate:"email"`
Status UserStatus `json:"status"`
}
enum UserStatus {
Active = 1; // Active user
Inactive = 2; // Inactive user
}
@attr(
group: "users"
desc: "User management operations"
)
service {
// summary: Get user by ID
// tags: Users
@handler getUser
get /api/v1/users/:id() returns(User)
// summary: Create new user
// tags: Users
@handler createUser
post /api/v1/users(User) returns(User)
}- Visual Studio Code version 1.75.0 or higher
This extension is available on the Visual Studio Marketplace. To install:
- Open VS Code
- Press
Ctrl+P/Cmd+Pto open the Quick Open dialog - Enter
ext install frg-language-support - Reload VS Code when prompted
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
# Prepare for publishing
npm run vscode:prepublishsrc/
├── extension.ts # Main entry point
├── providers/ # Language feature providers
│ ├── definitionProvider.ts # Go to Definition
│ ├── documentLinkProvider.ts # Import file links
│ ├── referenceProvider.ts # Find References
│ ├── codeLensProvider.ts # Reference count
│ ├── documentSymbolProvider.ts # Outline view
│ └── formattingProvider.ts # Document formatting
└── utils/ # Utilities
├── helpers.ts # Shared functions
└── formatter.ts # Formatting logic
MIT
For issues, questions, or contributions, please visit GitHub Repository.