Skip to content
| Marketplace
Sign in
Visual Studio Code>Themes>Sunset Theme For Go and PythonNew to Visual Studio Code? Get it now.
Sunset Theme For Go and Python

Sunset Theme For Go and Python

kacker

|
81 installs
| (0) | Free
Customized for Go and Python language with enhanced Swagger/OpenAPI support, Dark theme that suits personal tastes, need enable settings 'ui.semanticTokens': true
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Sunset Theme For Go

一个为 Go 语言精心定制的 VS Code 深色主题,专注于提供优雅的代码阅读体验。

特点

  • 🎨 精心调校的配色方案,让代码结构一目了然
  • 🎯 针对 Go 语言特性的深度优化:
    • 结构体字段的访问权限(大小写)区分
    • 结构体标签(struct tags)的语法高亮
    • 方法接收者(receiver)的清晰展示
    • 函数参数和返回值的语义化着色
    • 包导入和导出的视觉区分
  • 🚀 新增 全面的 Swagger/OpenAPI 注解支持:
    • API 注解:@Tags、@Summary、@Description、@Router 等
    • 参数注解:@Param 支持 body、path、query、header、formData
    • 响应注解:@Success、@Failure 状态码高亮
    • 认证注解:apiKey、oauth2、basic、bearer 认证类型
    • 媒体类型:application/json、application/xml 等常见类型
    • HTTP 方法:GET、POST、PUT、DELETE、PATCH、HEAD、OPTIONS、TRACE
  • 🌙 舒适的深色背景,长时间编码不伤眼
  • 📝 支持 Markdown 文件的优雅渲染

语法高亮

主题对 Go 代码的各个部分都进行了细致的颜色处理:

  • 结构体字段:根据访问权限(公有/私有)使用不同颜色
  • 方法定义:突出显示接收者和方法名
  • 类型定义:结构体、接口等类型声明使用独特配色
  • 变量声明:常量、变量等使用语义化的颜色
  • 控制流:if、for、switch 等关键字清晰可辨
  • Swagger 注解:完整的 API 文档注解支持,提升 API 开发效率

Swagger 注解示例

// @title           Swagger Example API
// @version         1.0
// @description     This is a sample server celler server.
// @termsOfService  http://swagger.io/terms/

// @contact.name   API Support
// @contact.url    http://www.swagger.io/support
// @contact.email  support@swagger.io

// @license.name  Apache 2.0
// @license.url   http://www.apache.org/licenses/LICENSE-2.0.html

// @host      localhost:8080
// @BasePath  /api/v1

// @securityDefinitions.basic  BasicAuth

// @externalDocs.description  OpenAPI
// @externalDocs.url          https://swagger.io/resources/open-api/
func main() {
    // ...
}

// @Summary      Show an account
// @Description  Get account by ID
// @Tags         accounts
// @Accept       json
// @Produce      json
// @Param        id   path      int  true  "Account ID"
// @Success      200  {object}  model.Account
// @Failure      400  {object}  HTTPError
// @Failure      404  {object}  HTTPError  
// @Failure      500  {object}  HTTPError
// @Router       /accounts/{id} [get]
func GetAccount(c *gin.Context) {
    // ...
}

安装

在 VS Code 扩展商店中搜索 "Sunset Theme For Go" 即可安装。

使用

安装后,在 VS Code 的主题选择器中选择 "Sunset Dark" 即可启用主题。

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft