Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

feat: allow workspaceFolder substition in go.alternateTools #2544

Conversation

pseudo-su
Copy link
Contributor

This is a feature I'd like, raised an issue describing it here

Copy link
Contributor

@ramya-rao-a ramya-rao-a left a 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.

@msftclas
Copy link

msftclas commented Jun 4, 2019

CLA assistant check
All CLA requirements met.

@pseudo-su pseudo-su force-pushed the feat/allow-workspacefolder-alternatetools branch from a0c2101 to 3927e9d Compare June 4, 2019 06:57
src/util.ts Outdated
return getBinPathWithPreferredGopath(
tool,
(tool === 'go') ? [] : [getToolsGopath(), getCurrentGoPath()],
resolveObjectPaths(alternateTools),
Copy link
Contributor

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)

Copy link
Contributor Author

@pseudo-su pseudo-su Jun 4, 2019

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 😄.

John Stableford and others added 2 commits June 5, 2019 09:11
@ramya-rao-a ramya-rao-a merged commit f722e2d into microsoft:master Jun 5, 2019
@pseudo-su pseudo-su deleted the feat/allow-workspacefolder-alternatetools branch June 5, 2019 07:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants