MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / Set

Method Set

internal/editorconfig/json_tool.go:100–118  ·  view source on GitHub ↗
(scope Scope, keyPath string, value any)

Source from the content-addressed store, hash-verified

98}
99
100func (c *jsonToolConfig) Set(scope Scope, keyPath string, value any) (string, error) {
101 parts, err := Parse(keyPath)
102 if err != nil {
103 return "", err
104 }
105 path := c.PathFor(scope)
106 if path == "" {
107 return "", fmt.Errorf("editorconfig: %s scope %s unsupported", c.spec.name, scope)
108 }
109 data, _, err := loadJSON(path)
110 if err != nil {
111 return "", err
112 }
113 Set(data, parts, value)
114 if err := writeJSON(path, data); err != nil {
115 return "", err
116 }
117 return path, nil
118}
119
120func (c *jsonToolConfig) Unset(scope Scope, keyPath string) (bool, string, error) {
121 parts, err := Parse(keyPath)

Callers

nothing calls this directly

Calls 5

PathForMethod · 0.95
ParseFunction · 0.85
loadJSONFunction · 0.85
SetFunction · 0.85
writeJSONFunction · 0.70

Tested by

no test coverage detected