Gopium 🌺 VSCode Extension
Gopium vscode extension for Gopium provides better experience for usage and simplify interactions with Gopium CLI.
Requirements and Installation
To install gopium vscode extension go to vscode marketplace.
In order to work, extension requires latest version of Gopium CLI and Goutline tools.
Extension automatically tries to install required tools if they have been not detected in your system.
To install and update gopium cli use:
go install github.com/1pkg/gopium@latest
To install and update goutline use:
go install github.com/1pkg/goutline@latest
You can easily adjust list of Gopium transformations to your needs by updating gopium.actions
settings in vscode, see also Gopium available transformations and walkers.
By default extension uses next transformations presets:
gopium pack | gopium cache | gopium pack cache | gopium false sharing | gopium pack verbose | gopium cache verbose
which are defined by next settings in vscode:
{
"gopium.actions": [
{
"name": "pack",
"walker": "ast_go",
"strategies": ["memory_pack"]
},
{
"name": "cache",
"walker": "ast_go",
"strategies": ["cache_rounding_cpu_l1_discrete"]
},
{
"name": "pack cache",
"walker": "ast_go",
"strategies": ["filter_pads", "memory_pack", "explicit_paddings_type_natural", "cache_rounding_cpu_l1_discrete"]
},
{
"name": "false sharing",
"walker": "ast_go",
"strategies": ["filter_pads", "false_sharing_cpu_l1"]
},
{
"name": "pack verbose",
"walker": "ast_go",
"strategies": [
"filter_pads",
"memory_pack",
"explicit_paddings_type_natural",
"fields_annotate_comment",
"struct_annotate_comment",
"add_tag_group_soft"
]
},
{
"name": "cache verbose",
"walker": "ast_go",
"strategies": [
"filter_pads",
"explicit_paddings_type_natural",
"cache_rounding_cpu_l1_discrete",
"fields_annotate_comment",
"struct_annotate_comment",
"add_tag_group_soft"
]
}
]
}
Origin and Decisions
Extension is based on and heavily using vscode-go extension functionality and keeps it as submodule. Such decision to vendor extension was made in favor to simplify origin Gopium VSCode Extension development by reusing common components like: goutline codelens, tools installation, etc.
Nevertheless it's impossible to just seamlessly reuse another extension to build your own, so a lot of functionality has been patched and changed, most noticeable: vscode-go telemetry is disabled, vscode-go extension entrypoits are removed, go-outline is replaced with go-outline, etc.
To publish the extension use guide.
Licence
Gopium is licensed under the MIT License.
See LICENSE for the full license text.