Scripted
  1. Scripted
  2. SCRIPTED-76

Read a '.scripted' or '.scriptedrc' file in user.home directory

    Details

    • Type: New Feature New Feature
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 0.3.0
    • Component/s: None
    • Labels:
      None

      Description

      Reason: so we can have personal tweaks to editor config without having to put them in the shared .scripted file that is at the root of the 'scripted file system'.

      It should probably follow similar rules that other editors / tools do:

      • user home .scripted file is read first
      • project-specific .scripted file is read next and any settings in there override the ones in user home file.

      Not sure if we should call the 'user home' file something different or also just .scripted.

        Activity

        Hide
        Kris De Volder (c) added a comment -

        I think we should make the 'user home' file be called '.scriptedrc' instead of '.scripted'. The reason for this is that we want to avoid, if possible, situation where the whole of user-home is treated as a 'project' by scripted. So the .scriptedrc file should only contain settings but not count as a 'project root marker'.

        Show
        Kris De Volder (c) added a comment - I think we should make the 'user home' file be called '.scriptedrc' instead of '.scripted'. The reason for this is that we want to avoid, if possible, situation where the whole of user-home is treated as a 'project' by scripted. So the .scriptedrc file should only contain settings but not count as a 'project root marker'.
        Hide
        Kris De Volder (c) added a comment -

        Scripted now reads both a .scripted and .scriptedrc file. The data in both are merged where .scripted properties override .scriptedrc properties.

        However, if the property in both are bound to an object then instead of overriding, the objects are merged recursively.

        So, it is possible, for example for both .scriptedrc and .scripted to contain blocks to be merged like in this example:

        /* .scriptedrc */
        {
           "ui": {
              "font_size" : 14,
              "navigator" : false
           }
        }
        
        /* .scripted */
        {
           "ui": {
               "navigator" : true
           }
        }
        

        In this case the navigator property in .scripted replaces the one in .scriptedrc, but "font_size" property from ".scriptedrc" is retained.

        Merged config is equivalent to:

        /* merged */
        {
           "ui": {
              "font_size" : 14,
              "navigator" : true
           }
        }
        

        All the logic for determining the merged config, and for searching for the scripted and scriptedrc files and project root context now happens in the server so that we can share this logic between client and server and keep it all together in one place.

        Show
        Kris De Volder (c) added a comment - Scripted now reads both a .scripted and .scriptedrc file. The data in both are merged where .scripted properties override .scriptedrc properties. However, if the property in both are bound to an object then instead of overriding, the objects are merged recursively. So, it is possible, for example for both .scriptedrc and .scripted to contain blocks to be merged like in this example: /* .scriptedrc */ { "ui" : { "font_size" : 14, "navigator" : false } } /* .scripted */ { "ui" : { "navigator" : true } } In this case the navigator property in .scripted replaces the one in .scriptedrc, but "font_size" property from ".scriptedrc" is retained. Merged config is equivalent to: /* merged */ { "ui" : { "font_size" : 14, "navigator" : true } } All the logic for determining the merged config, and for searching for the scripted and scriptedrc files and project root context now happens in the server so that we can share this logic between client and server and keep it all together in one place.
        Hide
        Andy Clement (c) added a comment -

        Kris - as part of this have you modified the documentation? I want to keep it up to date and relevant.

        Show
        Andy Clement (c) added a comment - Kris - as part of this have you modified the documentation? I want to keep it up to date and relevant.
        Hide
        Kris De Volder (c) added a comment -

        FAQ now updated.

        Show
        Kris De Volder (c) added a comment - FAQ now updated.

          People

          • Assignee:
            Kris De Volder (c)
            Reporter:
            Kris De Volder (c)
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: