symbols

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

contains modified code from gopls/internal/golang/workspace_symbol.go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComboMatcher

type ComboMatcher []MatcherFunc

func (ComboMatcher) Match

func (c ComboMatcher) Match(chunks []string) (int, float64)

type MatcherFunc

type MatcherFunc func(chunks []string) (int, float64)

A MatcherFunc returns the index and score of a symbol match.

See the comment for symbolCollector for more information.

func MatchExact

func MatchExact(exact string) MatcherFunc

func NewFuzzyMatcher

func NewFuzzyMatcher(query string) MatcherFunc

func ParseQuery

func ParseQuery(q string, newMatcher func(string) MatcherFunc) MatcherFunc

ParseQuery parses a field-separated symbol query, extracting the special characters listed below, and returns a matcherFunc corresponding to the AND of all field queries.

Special characters:

^  match exact prefix
$  match exact suffix
'  match exact

In all three of these special queries, matches are 'smart-cased', meaning they are case sensitive if the symbol query contains any upper-case characters, and case insensitive otherwise.

func SmartCase

func SmartCase(q string, m MatcherFunc) MatcherFunc

SmartCase returns a matcherFunc that is case-sensitive if q contains any upper-case characters, and case-insensitive otherwise.

type SymbolInformation

type SymbolInformation[T any] struct {
	Score  float64
	Symbol string
	Data   T
}

type SymbolStore

type SymbolStore[T any] interface {
	Store(SymbolInformation[T])
	TooLow(float64) bool
	Results() []protocol.SymbolInformation
}

func NewSymbolStore

func NewSymbolStore[T any](resolver func(SymbolInformation[T]) (protocol.SymbolInformation, bool)) SymbolStore[T]

Jump to

Keyboard shortcuts

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