summaryrefslogtreecommitdiff
path: root/info.go
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 20:22:09 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 20:22:09 +0100
commit5a8dbc6347b3541e84fe669b22c17ad3b715e258 (patch)
treeb148c450939688caaaeb4adac6f2faa1eaffe649 /info.go
downloadqwe-editor-5a8dbc6347b3541e84fe669b22c17ad3b715e258.tar.gz
Engage!
Diffstat (limited to 'info.go')
-rw-r--r--info.go31
1 files changed, 31 insertions, 0 deletions
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)
+ }
+}