瀏覽代碼

Tweak default commented out JSON format.

Afshin Darian 7 年之前
父節點
當前提交
04267672df
共有 1 個文件被更改,包括 9 次插入7 次删除
  1. 9 7
      packages/coreutils/src/settingregistry.ts

+ 9 - 7
packages/coreutils/src/settingregistry.ts

@@ -916,29 +916,30 @@ namespace Private {
   /**
    * Replacement text for schema properties missing a `description` field.
    */
-  const nondescript = '[missing schema `description`]';
+  const nondescript = '[missing schema description]';
 
   /**
    * Replacement text for schema properties missing a `default` field.
    */
-  const undefaulted = '[missing schema `default`]';
+  const undefaulted = '[missing schema default]';
 
   /**
    * Replacement text for schema properties missing a `title` field.
    */
-  const untitled = '[missing schema `title`]';
+  const untitled = '[missing schema title]';
 
   /**
    * Returns an annotated (JSON with comments) version of a schema's defaults.
    */
   export
   function annotatedDefaults(schema: ISettingRegistry.ISchema, plugin: string): string {
-    const { description, title } = schema;
-    const keys = Object.keys(schema.properties);
+    const { description, properties, title } = schema;
+    const keys = Object.keys(properties).sort((a, b) => a.localeCompare(b));
 
     return [
       '{',
-      comment(`${title || untitled} (${plugin})`),
+      comment(`${title || untitled}`),
+      comment(plugin),
       comment(description || nondescript),
       comment(line),
       '',
@@ -964,7 +965,8 @@ namespace Private {
       : `Default value:\n\n"${key}": ` + JSON.stringify(reified, null, 2);
 
     return [
-      comment(`${title || untitled} (${key})`),
+      comment(`${title || untitled}`),
+      comment(key),
       comment(description || nondescript),
       comment(defaults || undefaulted)
     ].join('\n');