lang

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package lang maps file paths to a language identifier used to pick the right prompt pack. Keep this list short and obvious; unknown extensions fall through to the default pack.

Index

Constants

View Source
const (
	Default    = "default"
	TypeScript = "typescript"
	JavaScript = "javascript"
	Go         = "go"
	Python     = "python"
	Java       = "java"
	Rust       = "rust"
	Ruby       = "ruby"
	CSharp     = "csharp"
	PHP        = "php"
)

Identifier returned by Detect. These match the pack file names in internal/prompts/packs (e.g. Detect("foo.ts") → "typescript" → typescript.md).

Variables

This section is empty.

Functions

func Detect

func Detect(path string) string

Detect returns the language identifier for a file path, or Default when the extension is unknown.

func Dominant

func Dominant(paths []string) string

Dominant picks the most common language across a set of files. Ties are broken by alphabetical order so the result is deterministic.

Types

This section is empty.

Jump to

Keyboard shortcuts

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