mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
package docvalues
|
|
|
|
import (
|
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
|
)
|
|
|
|
type CustomValueContext interface {
|
|
GetIsContext() bool
|
|
}
|
|
|
|
type EmptyValueContext struct{}
|
|
|
|
func (EmptyValueContext) GetIsContext() bool {
|
|
return true
|
|
}
|
|
|
|
var EmptyValueContextInstance = EmptyValueContext{}
|
|
|
|
type CustomValue struct {
|
|
FetchValue func(context CustomValueContext) DeprecatedValue
|
|
}
|
|
|
|
func (v CustomValue) GetTypeDescription() []string {
|
|
return v.FetchValue(EmptyValueContextInstance).GetTypeDescription()
|
|
}
|
|
|
|
func (v CustomValue) DeprecatedCheckIsValid(value string) []*InvalidValue {
|
|
return v.FetchValue(EmptyValueContextInstance).DeprecatedCheckIsValid(value)
|
|
}
|
|
|
|
func (v CustomValue) DeprecatedFetchCompletions(line string, cursor uint32) []protocol.CompletionItem {
|
|
return v.FetchValue(EmptyValueContextInstance).DeprecatedFetchCompletions(line, cursor)
|
|
}
|
|
|
|
func (v CustomValue) DeprecatedFetchHoverInfo(line string, cursor uint32) []string {
|
|
return v.FetchValue(EmptyValueContextInstance).DeprecatedFetchHoverInfo(line, cursor)
|
|
}
|