lspscan

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package lspscan — LSPSource adapter that detects language servers on PATH.

V1 strategy: hold a curated list of well-known LSP binary names → display label, and check exec.LookPath for each. Detected entries appear with Active=true. The list is conservative — extending it is a one-line change in knownLSPs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is the concrete LSPSource. Construct with New (for production) or NewWith (when sharing a settings Reader across adapters).

The settings Reader supplies the enabledPlugins map from `~/.claude/settings.json`. It is stateful (caches parsed contents between calls) so adapters that share a Reader instance also share the cache — see cmd/clyde/main.go for the shared wiring.

func New

func New() *Source

New constructs a Source with its own private settings Reader at the default path. Use NewWith to share a Reader across adapters (so their settings.json caches coalesce — see cmd/clyde/main.go).

func NewWith

func NewWith(r *claudesettings.Reader) *Source

NewWith constructs a Source backed by the given settings Reader. A nil reader is treated as "use a fresh default-path Reader".

func (*Source) LSPs

func (s *Source) LSPs() ([]ports.LSPInfo, error)

LSPs returns all known language servers found on PATH. Result is sorted alphabetically by display name and deduplicated by name (so detecting both pyright-langserver and pyright reports a single "pyright" entry).

The PATH scan is cached for the process lifetime — see scanBinaries. ClaudeEnabled is recomputed per call from the current settings.json so toggling a plugin in Claude Code is reflected without a clyde restart.

ClaudeEnabled is set by cross-referencing Claude Code's settings.json enabledPlugins map: a plugin keyed "<binary>-lsp@*" with value true means Claude Code has the LSP wired into its plugin system. When this is false while the binary is on PATH, the TUI flags it with an amber dot — the user has the LSP installed but Claude isn't actually using it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL