private void parseCompilerOptions()

in javascript/src/com/google/idea/blaze/typescript/BlazeTypeScriptConfig.java [288:391]


  private void parseCompilerOptions(JsonObject json) {
    this.compilerOptions = json;
    for (Map.Entry<String, JsonElement> entry : json.entrySet()) {
      String name = entry.getKey();
      JsonElement value = entry.getValue();
      switch (name) {
        case "baseUrl":
          this.baseUrl = value.getAsString();
          break;
        case "inlineSourceMap":
          this.inlineSourceMap = value.getAsBoolean();
          break;
        case "jsxFactory":
          this.jsxFactory = value.getAsString();
          break;
        case "module":
          switch (Ascii.toLowerCase(value.getAsString())) {
            case "commonjs":
              this.module = ModuleTarget.COMMON_JS;
              break;
            case "other":
              this.module = ModuleTarget.OTHER;
              break;
            default:
              this.module = ModuleTarget.UNKNOWN;
              break;
          }
          break;
        case "moduleResolution":
          switch (Ascii.toLowerCase(value.getAsString())) {
            case "node":
              this.moduleResolution = ModuleResolution.NODE;
              break;
            case "classic":
              this.moduleResolution = ModuleResolution.CLASSIC;
              break;
            default:
              this.moduleResolution = ModuleResolution.UNKNOWN;
              break;
          }
          break;
        case "noImplicitAny":
          this.noImplicitAny = value.getAsBoolean();
          break;
        case "noImplicitThis":
          this.noImplicitThis = value.getAsBoolean();
          break;
        case "noLib":
          this.noLib = value.getAsBoolean();
          break;
        case "paths":
          parsePaths(value.getAsJsonObject());
          break;
        case "plugins":
          for (JsonElement plugin : value.getAsJsonArray()) {
            plugins.add(plugin.getAsJsonObject().get("name").getAsString());
          }
          break;
        case "rootDirs":
          for (JsonElement rootDir : value.getAsJsonArray()) {
            String rootDirString = rootDir.getAsString();
            if (rootDirString.startsWith(workspaceRelativePathPrefix)) {
              rootDirString =
                  workspaceRelativePathReplacement
                      + rootDirString.substring(workspaceRelativePathPrefix.length());
            }
            rootDirs.add(rootDirString);
          }
          break;
        case "sourceMap":
          this.sourceMap = value.getAsBoolean();
          break;
        case "strictNullChecks":
          this.strictNullChecks = value.getAsBoolean();
          break;
        case "target":
          switch (Ascii.toLowerCase(value.getAsString())) {
            case "esnext":
              this.target = LanguageTarget.NEXT;
              break;
            case "es3":
              this.target = LanguageTarget.ES3;
              break;
            case "es5":
              this.target = LanguageTarget.ES5;
              break;
            case "es6":
            case "es2015":
              this.target = LanguageTarget.ES6;
              break;
            default:
              // ignored, assume es5
          }
          break;
        case "types":
          for (JsonElement type : value.getAsJsonArray()) {
            types.add(type.getAsString());
          }
          break;
        default:
          // ignored
      }
    }
  }