lsp

package
v0.0.0-...-713e2d3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDocumentServiceOptions = DocumentServiceOptions{
	ShadowRoot: filepath.Join(os.TempDir(), "litlua-workspace"),
	ShadowTransformerOpts: transformer.TransformOptions{
		WriterMode:          litlua.ModeShadow,
		NoBackup:            true,
		RequirePragmaOutput: false,
		NoLitLuaOutputExt:   false,
	},
	FinalTransformerOpts: transformer.TransformOptions{
		WriterMode:          litlua.ModePretty,
		NoBackup:            false,
		RequirePragmaOutput: true,
		NoLitLuaOutputExt:   false,
	},
}

Functions

This section is empty.

Types

type DocumentService

type DocumentService struct {
	// contains filtered or unexported fields
}

DocumentService handles all document transformations and path mappings

func NewDocumentService

func NewDocumentService(opts DocumentServiceOptions) (*DocumentService, error)

func (*DocumentService) CleanupShadowFiles

func (s *DocumentService) CleanupShadowFiles() error

CleanupShadowFiles removes all shadow files

func (*DocumentService) OriginalURI

func (s *DocumentService) OriginalURI(shadowURI string) (string, bool)

OriginalURI returns the original document URI for a shadow file

func (*DocumentService) PathToURI

func (s *DocumentService) PathToURI(path string) string

PathToURI converts a filesystem path to an LSP URI

func (*DocumentService) ShadowRoot

func (s *DocumentService) ShadowRoot() string

ShadowRoot returns the root directory for shadow files

func (*DocumentService) ShadowURI

func (s *DocumentService) ShadowURI(originalURI string) (string, bool)

ShadowURI returns the shadow URI for an original document URI

func (*DocumentService) TransformFinalDoc

func (s *DocumentService) TransformFinalDoc(text string, sourcePath string) (string, error)

TransformFinalDoc transforms a document for final 'compilation' output, returning the absolute path of the output file

func (*DocumentService) TransformShadowDoc

func (s *DocumentService) TransformShadowDoc(text string, documentURI lsp.DocumentURI) (shadowURI string, err error)

TransformShadowDoc transforms the document for LSP proxying and returns the shadow URI

func (*DocumentService) URIToPath

func (s *DocumentService) URIToPath(uri lsp.DocumentURI) (string, error)

URIToPath converts an LSP URI to a filesystem path

type DocumentServiceOptions

type DocumentServiceOptions struct {
	ShadowTransformerOpts transformer.TransformOptions
	FinalTransformerOpts  transformer.TransformOptions

	// Root directory for shadow files
	ShadowRoot string
}

func (DocumentServiceOptions) Validate

func (o DocumentServiceOptions) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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