Skip to content

TinyFunction/gorm-gen-sql-comment-highlighter

Repository files navigation

GORM Gen SQL Comment Highlighter

GoLand plugin for highlighting gorm-gen SQL written as Go line comments before mapper methods.

The plugin injects the IDE SQL language into consecutive // comment blocks that start with a SQL keyword, for example:

//select *
//from activity_company_info
//where store_id = @storeId
ListByStoreId(storeId string) ([]*custom.ActivityCompanyInfo, error)

Build

./gradlew buildPlugin

The built plugin ZIP is created under build/distributions/.

By default the Gradle build uses the local GoLand installation at /Applications/GoLand.app. Override it if needed:

./gradlew buildPlugin -PlocalIdePath=/path/to/GoLand.app

Run In Sandbox

./gradlew runIde

Open a mapper file such as sales-trade/cmd/ormgen/activity_company_info_mapper.go in the sandbox IDE and the SQL comment block should be highlighted as SQL.

About

GORM Gen SQL Comment Highlighter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors