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

Feature Request: sync pragma conditional blocks #1062

Open
daisy-develops opened this issue Oct 8, 2019 · 4 comments
Open

Feature Request: sync pragma conditional blocks #1062

daisy-develops opened this issue Oct 8, 2019 · 4 comments

Comments

@daisy-develops
Copy link

I like being able to keep things between my Mac and Windows separated using the sync pragma, but it would be even better if we could do something like:

// @sync if os=windows
"editor.fontFamily": "Fira Code Retina",
"terminal.integrated.fontFamily": "Consolas"
// @sync endIf

Or // @syncIf and // @end like this other settings sync extension: https://github.com/jacobdufault/vscode-sync

@shanalikhan
Copy link
Owner

shanalikhan commented Oct 9, 2019

Nice idea!
@protium-dev can assist us on this :)

@shanalikhan shanalikhan added this to the Backlog milestone Oct 9, 2019
@shanalikhan
Copy link
Owner

@daisy-develops

If your scenario is limited to os related settings. Look here: https://github.com/shanalikhan/code-settings-sync/wiki/Sync-Pragmas#per-os

Let me know if it helps,

@daisy-develops
Copy link
Author

daisy-develops commented Oct 10, 2019

@shanalikhan Hi! It's just my immediate use case because I haven't configured for hosts, however, the example for host still illustrates the limitation:

// settings.json on "home" computer running Linux

{
  // @sync host=home os=linux
  "window.zoomLevel": "1",
  // @sync host=work os=windows
  // "window.zoomLevel": "0",
}

// settings.json on "work" computer running Windows

{
  // @sync host=home os=linux
  // "window.zoomLevel": "1",
  // @sync host=work os=windows
  "window.zoomLevel": "0",
}

I can only have one setting per @sync pragma. What if I had another setting that I wanted to be different between the two?

{
  @sync host=home os=linux
  "window.zoomLevel": "1",
  "some.other.setting": "some special value for linux@home", // this is going to go to everything that syncs these settings
  @sync host=work os=windows
  "window.zoomLevel": "0",
  "some.other.setting": "some special value for windows@work", // this is going to go to everything and possibly override the other one (bad news for linux@home)
}

This is what has prompted me to make the feature request:

	// @sync os=mac
	// "editor.fontFamily": "FiraCode-Retina",
	// @sync os=windows
	"editor.fontFamily": "Fira Code Retina",
	// @sync os=windows
	"terminal.integrated.fontFamily": "Consolas",

Fira Code Retina looks terrible in my Windows terminal, so I need to set it back to the one I like. It would be really convenient to be able to specify more than one setting per pragma.

@shanalikhan
Copy link
Owner

This is what has prompted me to make the feature request:

@daisy-develops so you are saying that without host // @sync os=mac doesn't simply work?

Have you tried it?
If it doesnt work with simple // @sync os=mac then it should be taken as a bug. Let me know about your findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants