@@ -98,7 +98,7 @@ func ensureWorkflowSchema(verbose bool) error {
9898 return nil
9999}
100100
101- // ensureVSCodeSettings creates or updates .vscode/settings.json with YAML schema configuration
101+ // ensureVSCodeSettings creates or updates .vscode/settings.json
102102func ensureVSCodeSettings (verbose bool ) error {
103103 vscodeConfigLog .Print ("Creating or updating .vscode/settings.json" )
104104
@@ -111,52 +111,22 @@ func ensureVSCodeSettings(verbose bool) error {
111111
112112 settingsPath := filepath .Join (vscodeDir , "settings.json" )
113113
114- // Read existing settings if they exist
115- var settings VSCodeSettings
116- if data , err := os .ReadFile (settingsPath ); err == nil {
117- vscodeConfigLog .Printf ("Reading existing settings from: %s" , settingsPath )
118- if err := json .Unmarshal (data , & settings ); err != nil {
119- return fmt .Errorf ("failed to parse existing settings.json: %w" , err )
114+ // Check if settings.json already exists
115+ if _ , err := os .Stat (settingsPath ); err == nil {
116+ vscodeConfigLog .Print ("Settings file already exists, skipping creation" )
117+ if verbose {
118+ fmt .Fprintf (os .Stderr , "Settings file already exists at %s\n " , settingsPath )
120119 }
121- } else {
122- vscodeConfigLog .Print ("No existing settings found, creating new one" )
123- settings .Other = make (map [string ]any )
120+ return nil
124121 }
125122
126- // Initialize yaml.schemas if it doesn't exist
127- if settings .YAMLSchemas == nil {
128- settings .YAMLSchemas = make (map [string ]any )
129- }
130-
131- // Add schema mapping for workflow files
132- schemaPath := "./.github/aw/schemas/agentic-workflow.json"
133- workflowPattern := ".github/workflows/*.md"
134-
135- // Check if already configured
136- if existingPattern , exists := settings .YAMLSchemas [schemaPath ]; exists {
137- if existingPattern == workflowPattern {
138- vscodeConfigLog .Print ("Schema mapping already configured, skipping update" )
139- if verbose {
140- fmt .Fprintf (os .Stderr , "YAML schema mapping already configured in %s\n " , settingsPath )
141- }
142- return nil
143- }
144- }
145-
146- settings .YAMLSchemas [schemaPath ] = workflowPattern
147-
148- // Ensure yaml validation settings are enabled
149- if settings .Other == nil {
150- settings .Other = make (map [string ]any )
151- }
152- if _ , exists := settings .Other ["yaml.validate" ]; ! exists {
153- settings .Other ["yaml.validate" ] = true
154- }
155- if _ , exists := settings .Other ["yaml.hover" ]; ! exists {
156- settings .Other ["yaml.hover" ] = true
157- }
158- if _ , exists := settings .Other ["yaml.completion" ]; ! exists {
159- settings .Other ["yaml.completion" ] = true
123+ // Create minimal settings file with just Copilot settings
124+ settings := VSCodeSettings {
125+ Other : map [string ]any {
126+ "github.copilot.enable" : map [string ]bool {
127+ "markdown" : true ,
128+ },
129+ },
160130 }
161131
162132 // Write settings file with proper indentation
@@ -173,7 +143,7 @@ func ensureVSCodeSettings(verbose bool) error {
173143 return nil
174144}
175145
176- // ensureVSCodeExtensions creates or updates .vscode/extensions.json with RedHat YAML extension
146+ // ensureVSCodeExtensions creates or updates .vscode/extensions.json
177147func ensureVSCodeExtensions (verbose bool ) error {
178148 vscodeConfigLog .Print ("Creating or updating .vscode/extensions.json" )
179149
@@ -185,39 +155,23 @@ func ensureVSCodeExtensions(verbose bool) error {
185155
186156 extensionsPath := filepath .Join (vscodeDir , "extensions.json" )
187157
188- // Read existing extensions if they exist
189- var extensions VSCodeExtensions
190- if data , err := os .ReadFile (extensionsPath ); err == nil {
191- vscodeConfigLog .Printf ("Reading existing extensions from: %s" , extensionsPath )
192- if err := json .Unmarshal (data , & extensions ); err != nil {
193- return fmt .Errorf ("failed to parse existing extensions.json: %w" , err )
194- }
195- } else {
196- vscodeConfigLog .Print ("No existing extensions file found, creating new one" )
197- extensions .Recommendations = []string {}
198- }
199-
200- // Check if RedHat YAML extension is already in recommendations
201- redhatYAMLExt := "redhat.vscode-yaml"
202- hasYAMLExt := false
203- for _ , ext := range extensions .Recommendations {
204- if ext == redhatYAMLExt {
205- hasYAMLExt = true
206- break
207- }
208- }
209-
210- if hasYAMLExt {
211- vscodeConfigLog .Print ("RedHat YAML extension already in recommendations, skipping update" )
158+ // Check if extensions.json already exists
159+ if _ , err := os .Stat (extensionsPath ); err == nil {
160+ vscodeConfigLog .Print ("Extensions file already exists, skipping creation" )
212161 if verbose {
213- fmt .Fprintf (os .Stderr , "RedHat YAML extension already in %s\n " , extensionsPath )
162+ fmt .Fprintf (os .Stderr , "Extensions file already exists at %s\n " , extensionsPath )
214163 }
215164 return nil
216165 }
217166
218- // Add RedHat YAML extension to recommendations
219- extensions .Recommendations = append (extensions .Recommendations , redhatYAMLExt )
220- vscodeConfigLog .Printf ("Added %s to recommendations" , redhatYAMLExt )
167+ // Create minimal extensions file with common recommendations
168+ extensions := VSCodeExtensions {
169+ Recommendations : []string {
170+ "astro-build.astro-vscode" ,
171+ "davidanson.vscode-markdownlint" ,
172+ },
173+ }
174+ vscodeConfigLog .Print ("Creating new extensions file with basic recommendations" )
221175
222176 // Write extensions file with proper indentation
223177 data , err := json .MarshalIndent (extensions , "" , " " )
0 commit comments