| 93 | } |
| 94 | |
| 95 | func (c *tomlToolConfig) Set(scope Scope, keyPath string, value any) (string, error) { |
| 96 | parts, err := Parse(keyPath) |
| 97 | if err != nil { |
| 98 | return "", err |
| 99 | } |
| 100 | path := c.PathFor(scope) |
| 101 | if path == "" { |
| 102 | return "", fmt.Errorf("editorconfig: %s scope %s unsupported", c.spec.name, scope) |
| 103 | } |
| 104 | data, _, err := loadTOML(path) |
| 105 | if err != nil { |
| 106 | return "", err |
| 107 | } |
| 108 | Set(data, parts, value) |
| 109 | if err := writeTOML(path, data); err != nil { |
| 110 | return "", err |
| 111 | } |
| 112 | return path, nil |
| 113 | } |
| 114 | |
| 115 | func (c *tomlToolConfig) Unset(scope Scope, keyPath string) (bool, string, error) { |
| 116 | parts, err := Parse(keyPath) |