d2lsp

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Completion implements lsp autocomplete features Currently handles: - Complete dot and inside maps for reserved keyword holders (style, labels, etc) - Complete discrete values for keywords like shape - Complete suggestions for formats for keywords like opacity

d2lsp contains functions useful for IDE clients

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoardAtPosition added in v0.6.9

func GetBoardAtPosition(text string, pos d2ast.Position) ([]string, error)

func GetRefRanges

func GetRefRanges(path string, fs map[string]string, boardPath []string, key string) (ranges []d2ast.Range, importRanges []d2ast.Range, _ error)

Types

type CompletionItem added in v0.6.9

type CompletionItem struct {
	Label      string
	Kind       CompletionKind
	Detail     string
	InsertText string
}

func GetCompletionItems added in v0.6.9

func GetCompletionItems(text string, line, column int) ([]CompletionItem, error)

type CompletionKind added in v0.6.9

type CompletionKind int
const (
	KeywordCompletion CompletionKind = iota
	StyleCompletion
	ShapeCompletion
)

Jump to

Keyboard shortcuts

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