Skip to content

Add Go VS Code extension by default, DRY the extensions list - #191

Merged
rfay merged 3 commits into
mainfrom
20260730_go_extension
Jul 30, 2026
Merged

Add Go VS Code extension by default, DRY the extensions list#191
rfay merged 3 commits into
mainfrom
20260730_go_extension

Conversation

@rfay

@rfay rfay commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Enable the golang.go VS Code extension by default in all three templates, and pre-install gopls via Homebrew (alongside the existing go/golangci-lint) so it's ready without the extension fetching it on first use.
  • The vscode_extensions variable was byte-for-byte identical across drupal-core, drupal-contrib, and freeform. Extracted it into shared/vscode-extensions.tf, vendored into each template directory the same way modules/claude-remote-control already is — coder templates push and CI's terraform validate/test only ever see a single template directory, so a relative ../shared reference wouldn't survive.
  • Added a sync-shared Makefile target (wraps sync-claude-module + new sync-vscode-extensions) that make validate, make test-templates, and every make push-template-*/push-all-templates target now depend on, so vendoring happens automatically — no manual step.
  • Documented the canonical-source-plus-vendored-copy pattern in CLAUDE.md, including why the vendored copies must stay committed (CI validates each template directory standalone, with no make step).

Test plan

  • terraform fmt -check -recursive
  • make validate (init + validate for all three templates)
  • make test-templates (terraform test for all three templates, all passing)
  • Push template(s) to a real Coder instance and confirm "Go" appears checked-by-default in the VS Code Extensions picker on workspace creation
  • Open a .go file in VS Code for Web and confirm gopls is found without a prompt to auto-install

🤖 Generated with Claude Code

…ross templates

Enables golang.go by default in all three templates and pre-installs gopls
via Homebrew alongside the existing go/golangci-lint so the extension
doesn't need to fetch it on first use.

The vscode_extensions variable was identical in all three template.tf
files. Extracted it into shared/vscode-extensions.tf, vendored into each
template directory the same way modules/claude-remote-control already is
(coder templates push and CI only ever see one template directory, so a
relative ../shared reference wouldn't survive. make push-template-* /
validate / test-templates now depend on a new sync-shared target so the
vendoring happens automatically.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
EOF
)
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-30 19:45 UTC

rfay and others added 2 commits July 30, 2026 11:32
…edocs

An inline gh pr create --body heredoc containing an apostrophe broke shell
quoting earlier in this session. Document git commit -F / gh pr create
--body-file as the standard instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Coder pins the submitted value of any root-level Terraform `variable` the
first time a template is pushed, and reuses that pinned value on later
pushes instead of re-reading the .tf file's default unless --variable is
passed again. vscode_extensions was a `variable`, so adding golang.go to
its default had no effect on real builds: verified on staging that a
workspace built from the updated template still rejected "golang.go" as
an invalid option, even with the parameter value passed explicitly.

Switch shared/vscode-extensions.tf from a `variable` to a `locals` block
(recomputed fresh every plan, nothing for Coder to pin) and update the
var.vscode_extensions references to local.vscode_extensions in all three
templates. Verified by pushing freeform as an inactive staging version
and creating a disposable workspace pinned to it: golang.go was accepted
and installed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rfay
rfay merged commit 5351d55 into main Jul 30, 2026
21 of 24 checks passed
@rfay
rfay deleted the 20260730_go_extension branch July 30, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant