-
Notifications
You must be signed in to change notification settings - Fork 645
feat: allow workspaceFolder substition in go.alternateTools #2544
feat: allow workspaceFolder substition in go.alternateTools #2544
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pseudo-su Looks like this is your first PR contribution to this project, Thanks & Welcome!
As described in #2543 (comment), we need to resolve the path before calling getBinPathWithPreferredGopath
The util.resolvePath()
function makes use of the vscode
module.
Since getBinPathWithPreferredGopath
gets used both from the extension and the debug adapter, we can't use code that uses the vscode
module as the process that runs the debug adapter won't have access to it.
I suggest the below:
- Update
getBinPathWithPreferredGopath
to take in the resolved alternate path instead of the entire mapping of alternateTools - Update the caller
getBinPathWithPreferredGopath
to resolve the path upfront, and pass the resolved path.
a0c2101
to
3927e9d
Compare
src/util.ts
Outdated
return getBinPathWithPreferredGopath( | ||
tool, | ||
(tool === 'go') ? [] : [getToolsGopath(), getCurrentGoPath()], | ||
resolveObjectPaths(alternateTools), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getBinPathWithPreferredGopath
only needs to deal with the current tool.
So, instead of resolving the path for all the alternate tools, why not resolve the path for the given tool and just pass that to getBinPathWithPreferredGopath
?
i.e update getBinPathWithPreferredGopath
to take alternateToolPath
(a string) instead of alternateTools
(a key-value map)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does make more sense, I'll change it now. I was focussing more on trying to figure out what I was doing wrong that's making the build fail 😄.
This is a feature I'd like, raised an issue describing it here