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

Remove replaceCodeSettings from Settings Sync configurations #805

Closed
shanalikhan opened this issue Mar 24, 2019 · 3 comments
Closed

Remove replaceCodeSettings from Settings Sync configurations #805

shanalikhan opened this issue Mar 24, 2019 · 3 comments

Comments

@shanalikhan
Copy link
Owner

shanalikhan commented Mar 24, 2019

Replace replaceCodeSettings from the Settings Sync.

  1. User should use Sync Pragma in order to disable upload of certain settings.
  2. Use host in order to switch the settings to other host.

Reference : https://github.com/shanalikhan/code-settings-sync/wiki/Sync-Pragmas

@shanalikhan shanalikhan added this to the Backlog milestone Mar 24, 2019
@shanalikhan shanalikhan modified the milestones: Backlog, v3.2.8 Apr 2, 2019
shanalikhan added a commit that referenced this issue Apr 3, 2019
shanalikhan added a commit that referenced this issue Apr 3, 2019
shanalikhan added a commit that referenced this issue Apr 4, 2019
* #806

* prettify custom setting json (#812)

* Fix auto upload (#801)

* Fix auto upload!

* Properly stop watching

* Add synchronous functions

* Move watcher to a new service

* Make a new service for watcher

* Add general ignored items setting for chokidar

* Use globalCommons's autoUploadService instance

* Reset

* Add local settings to ignored files

* Asynchronously get ignored items

* Remove unused import

* Use autoUploadService

* Use the globalCommonService everywhere
Since the autoUploadService is an instance in Commons, using a global
Commons instance will allow everything to use the same instance.

* Stop spamming with extension paths

* Fix to work with async functions

* Add global state to ignored files

* Add .DS_Store and sync.lock

* Start watcher only after downloading has finished

* Inform user that auto upload has started

* #805

* #820

* #820

* #821

* #805

* #823

* Go back to webpack and fix source maps

* Ignore node_modules and some other files (#826)
@darkvertex
Copy link

Hi there,

Forgive me if this question seems obvious, but the wiki page on "Sync Pragmas" is not 100% clear to me.

Do I use them directly in my settings.json that vscode uses for my user preferences? And if so, say I have 2 settings where I need values different per OS... Do I do this:

    // @sync os=linux
    "git.defaultCloneDirectory": "~/repos",
    // @sync os=windows
    "git.defaultCloneDirectory": "",

(which VSCode warns me is wrong because of "duplicate keys", so I'm guessing it's wrong..)
...or...

    // @sync os=linux
    "git.defaultCloneDirectory": "~/repos",
    // @sync os=windows
    // "git.defaultCloneDirectory": "",

and I can expect the good one to get uncommented should I sync on my Windows laptop? Is that how it's supposed to work?

Furthermore, what about multi-line settings... Do I need to apply the pragma comment per individual line? Or do I declare it twice like the previous example and declare it just before declaring a multiline pref?

Basically, do I do this below?

    "python.autoComplete.extraPaths": [
        // @sync os=linux
        "/mnt/users/alan/.local/lib/python2.7/site-packages",
        // @sync os=linux
        "/usr/lib/python2.7/site-packages",
        // @sync os=windows
        "C:\\Program Files\\Anaconda3\\lib\\site-packages",
    ],

or this below?

    // @sync os=linux
    "python.autoComplete.extraPaths": [
        "/mnt/users/alan/.local/lib/python2.7/site-packages",
        "/usr/lib/python2.7/site-packages",
    ],
    // @sync os=windows
    "python.autoComplete.extraPaths": [
        "C:\\Program Files\\Anaconda3\\lib\\site-packages",
    ],

or one commented like this below? (let's say I'm in Linux at the time)

    // @sync os=linux
    "python.autoComplete.extraPaths": [
        "/mnt/users/alan/.local/lib/python2.7/site-packages",
        "/usr/lib/python2.7/site-packages",
    ],
    // @sync os=windows
    // "python.autoComplete.extraPaths": [
    //     "C:\\Program Files\\Anaconda3\\lib\\site-packages",
    // ],

I would like to know which is the good syntax (and if you can later clarify it in the wiki page so it's clearer for others that would be great too.)

Thank you for an awesome extension btw!

@ctf0
Copy link

ctf0 commented May 1, 2019

@darkvertex according to

Before uploading your settings.json all the settings with inline pragmas are uncommented. Then, when your settings are synchronized, all the settings values with pragmas that don't match with your machine (OS, hostName or ENV variables) will be commented. Therefore VS Code won't apply them.

so i think a combination of ur first & second examples is what happens, @shanalikhan any insights ?

@rrileyca
Copy link

I echo these confusions in my comment here: #753 (comment)

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

4 participants