From 5a8dbc6347b3541e84fe669b22c17ad3b715e258 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 21 Jan 2026 20:22:09 +0100 Subject: Engage! --- info.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 info.go (limited to 'info.go') diff --git a/info.go b/info.go new file mode 100644 index 0000000..2fed31e --- /dev/null +++ b/info.go @@ -0,0 +1,31 @@ +package main + +// Provides a way to view all detected file types and their associated LSP +// (Language Server Protocol) configurations. + +import ( + "fmt" + "strings" +) + +// PrintInfo prints a summary table of all supported languages and their LSP setup. +func PrintInfo() { + // Table header. + fmt.Printf("%-15s %-10s %-20s\n", "Name", "LSP", "Command") + fmt.Println(strings.Repeat("-", 80)) + + for _, ft := range fileTypes { + lspEnabled := "no" + if ft.EnableLSP { + lspEnabled = "yes" + } + + lspCmd := ft.LSPCommand + // Append arguments if they exist (e.g., --stdio). + if len(ft.LSPCommandArgs) > 0 { + lspCmd += " " + strings.Join(ft.LSPCommandArgs, " ") + } + + fmt.Printf("%-15s %-10s %-20s\n", ft.Name, lspEnabled, lspCmd) + } +} -- cgit v1.2.3