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

Added relative workspace setting. #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added relative workspace setting. #89

wants to merge 1 commit into from

Conversation

9brada6
Copy link

@9brada6 9brada6 commented Jul 18, 2020

As described in the last comment #79 , I dunno if you saw it...

@odahcam
Copy link

odahcam commented Jun 29, 2021

@TysonAndre please consider merging this.

Copy link
Owner

@TysonAndre TysonAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://code.visualstudio.com/updates/v1_57 VS Code 1.57 added support for the IDE itself tracking whether a workspace and its config is trusted, this functionality should be fine in combination with bumping the minimum version of vs code

return conf;
}

for (let i = 0; i < conf.length; i++) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map to be easier to test (not modify original input) but otherwise seems reasonable.

Now that vs code supports marking folders as trusted outside of extensions there's less of a need to manually list workplaces to trust.


for (let i = 0; i < conf.length; i++) {
conf[i] = conf[i].replace(/\$\{workspaceFolder\}/gi, vscode.workspace.workspaceFolders[0].uri.fsPath).replace(/\\/gi, '/');
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could deduplicate if strings are exactly the same if workspaceFolder is the same directory as a hardcoded path

(e.g. convert to Set and back, or https://lodash.com/docs#uniq, or manually)

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.

3 participants