(parsedFrontmatter *FrontmatterConfig, frontmatter map[string]any)
| 170 | } |
| 171 | |
| 172 | func 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 | |
| 200 | func extractFrontmatterSkills(parsedFrontmatter *FrontmatterConfig, frontmatter map[string]any) []string { |
| 201 | refs := extractFrontmatterSkillReferences(parsedFrontmatter, frontmatter) |
no test coverage detected