Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-root workspace scoped variables are not expanded in go.alternateTools #3407

Closed
stan-stately opened this issue May 27, 2024 · 1 comment
Milestone

Comments

@stan-stately
Copy link

stan-stately commented May 27, 2024

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.22.3 darwin/arm64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • golang.org/x/tools/gopls v0.15.3
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.89.1 dc96b837cf6bb4af9cd736aa3af08cf8279f7685 arm64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.41.4
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
    • N/A

Share the Go related settings you have added/edited

{
  "folders": [
     {
       "name": "root",
       "path": ".",
      },
    ]
...
  "go.formatTool": "custom",
   "go.alternateTools": {
     "customFormatter": "${workspaceFolder:root}/bin/golangci-lint",
    },

Describe the bug

  • I'm in a multi root workspace with many go packages
  • I'm trying to point my custom formatter at ./bin/golangci-lint. This is located within the workspace root
  • The formatter fails with ${workspaceFolder:root}/bin/golangci-lint is not found.
  • If i remove the scoping: "customFormatter": "${workspaceFolder}/bin/golangci-lint", then the formatter fails with <path-to-current-folder>/bin/golangci-lint is not found.. The substitution works as expected but this changes for files in each workspace folder so its not really a usable config

Steps to reproduce the behavior:

  1. Create a vscode workspace
  2. Set the workspace settings from above
  3. Save a golang file to trigger the formatter

Screenshots or recordings

  • N/A
@gopherbot gopherbot added this to the Untriaged milestone May 27, 2024
@stan-stately
Copy link
Author

I think this is a duplicate of #2582. Seems to be fixed in nightly extension

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

No branches or pull requests

2 participants