d2lsp

package
v0.0.0-...-f8d3efd Latest Latest
Warning

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

Go to latest
Published: Nov 20, 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

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

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

func GetCompletionItems

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

type CompletionKind

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