scope

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package scope identifies the (language, toolchain-version) partition a source file belongs to. Graph data is stored and served per scope, so every file is mapped to exactly one scope at index time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectVersion

func DetectVersion(projectRoot, filePath string, lang model.Language) string

DetectVersion resolves the toolchain MAJOR version for filePath (absolute) within projectRoot, given its already-determined language. Graphs are grouped by major version, so e.g. Go 1.22 and 1.26.4 both map to "v1", and TypeScript 5.4.2 maps to "v5". It walks up to the nearest governing manifest (go.mod for Go, package.json for TS/JS) and returns fallbackVersion ("v0") when nothing is detectable.

Types

type Scope

type Scope struct {
	Language model.Language
	Version  string
}

Scope is a (language, version) partition. Version is a detected toolchain version string (e.g. "1.22", "5.4.2") or fallbackVersion ("v0").

func (Scope) Key

func (s Scope) Key() string

Key is the stable identifier used in DB filenames, manifest entries, URL path segments, and CLI --scope values: "{language}-{version}".

Jump to

Keyboard shortcuts

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