MCPcopy Create free account
hub / github.com/github/gh-aw / extractLSPConfig

Function extractLSPConfig

pkg/workflow/workflow_builder.go:172–198  ·  view source on GitHub ↗
(parsedFrontmatter *FrontmatterConfig, frontmatter map[string]any)

Source from the content-addressed store, hash-verified

170}
171
172func extractLSPConfig(parsedFrontmatter *FrontmatterConfig, frontmatter map[string]any) map[string]LSPServerConfig {
173 if parsedFrontmatter != nil && len(parsedFrontmatter.LSP) > 0 {
174 return parsedFrontmatter.LSP
175 }
176
177 rawLSP, ok := frontmatter["lsp"]
178 if !ok {
179 return nil
180 }
181
182 jsonBytes, err := json.Marshal(rawLSP)
183 if err != nil {
184 workflowBuilderLog.Printf("Failed to marshal lsp frontmatter config: %v", err)
185 return nil
186 }
187
188 var lsp map[string]LSPServerConfig
189 if err := json.Unmarshal(jsonBytes, &lsp); err != nil {
190 workflowBuilderLog.Printf("Failed to unmarshal lsp frontmatter config: %v", err)
191 return nil
192 }
193
194 if len(lsp) == 0 {
195 return nil
196 }
197 return lsp
198}
199
200func extractFrontmatterSkills(parsedFrontmatter *FrontmatterConfig, frontmatter map[string]any) []string {
201 refs := extractFrontmatterSkillReferences(parsedFrontmatter, frontmatter)

Callers 1

Calls 1

PrintfMethod · 0.45

Tested by

no test coverage detected