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 support for user home variable in settings #1916

Merged
merged 4 commits into from
Oct 9, 2023
Merged

Added support for user home variable in settings #1916

merged 4 commits into from
Oct 9, 2023

Conversation

AndreasArvidsson
Copy link
Member

eg "cursorless.private.hatShapesDir": "C:\\Users\\Andreas\\repositories\\pokey-dotfiles\\cursorless-hat-shapes",

Checklist

  • [/] I have added tests
  • [/] I have updated the docs and cheatsheet
  • [/] I have not broken the cheatsheet

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Mostly looks good, with minor comment; see also my commit for a couple changes I made

@@ -42,3 +46,20 @@ export default class VscodeConfiguration implements Configuration {

onDidChangeConfiguration = this.notifier.registerListener;
}

export function vscodeGetConfigurationString(path: string): string | undefined {
const value = vscode.workspace.getConfiguration().get<string>(path);
Copy link
Member

Choose a reason for hiding this comment

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

This loads the whole configuration, right? Before we just loaded the section we cared about. Probably prematurely optimising by caring about this stuff, but I'm assuming there's a reason VSCode supports retrieving just one section?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not really sure why vscode has this section separation. If you like I can split on the last dot and just fetch the section first?

Copy link
Member

Choose a reason for hiding this comment

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

Seems reasonable for now

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@AndreasArvidsson
Copy link
Member Author

@pokey poke!

@pokey pokey added this pull request to the merge queue Oct 9, 2023
Merged via the queue into main with commit fee6d41 Oct 9, 2023
@pokey pokey deleted the userHomeVar branch October 9, 2023 19:46
fidgetingbits pushed a commit to fidgetingbits/cursorless that referenced this pull request Nov 3, 2023
eg `"cursorless.private.hatShapesDir":
"C:\\Users\\Andreas\\repositories\\pokey-dotfiles\\cursorless-hat-shapes",`

## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet

---------

Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
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.

2 participants