ls

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host interface {
	FS() vfs.FS
	DefaultLibraryPath() string
	GetCurrentDirectory() string
	NewLine() string
	Trace(msg string)
	GetProjectVersion() int
	// GetRootFileNames was called GetScriptFileNames in the original code.
	GetRootFileNames() []string
	// GetCompilerOptions was called GetCompilationSettings in the original code.
	GetCompilerOptions() *core.CompilerOptions
	GetSourceFile(fileName string, path tspath.Path, languageVersion core.ScriptTarget) *ast.SourceFile
	// This responsibility was moved from the language service to the project,
	// because they were bidirectionally interdependent.
	GetProgram() *compiler.Program
	GetDefaultLibraryPath() string
}

type LanguageService

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

func NewLanguageService

func NewLanguageService(host Host) *LanguageService

func (*LanguageService) DefaultLibraryPath

func (l *LanguageService) DefaultLibraryPath() string

DefaultLibraryPath implements compiler.CompilerHost.

func (*LanguageService) FS

func (l *LanguageService) FS() vfs.FS

FS implements compiler.CompilerHost.

func (*LanguageService) GetCurrentDirectory

func (l *LanguageService) GetCurrentDirectory() string

GetCurrentDirectory implements compiler.CompilerHost.

func (*LanguageService) GetDocumentDiagnostics

func (l *LanguageService) GetDocumentDiagnostics(fileName string) []*ast.Diagnostic

func (*LanguageService) GetProgram

func (l *LanguageService) GetProgram() *compiler.Program

GetProgram updates the program if the project version has changed.

func (*LanguageService) GetSourceFile

func (l *LanguageService) GetSourceFile(fileName string, path tspath.Path, languageVersion core.ScriptTarget) *ast.SourceFile

GetSourceFile implements compiler.CompilerHost.

func (*LanguageService) NewLine

func (l *LanguageService) NewLine() string

NewLine implements compiler.CompilerHost.

func (*LanguageService) ProvideDefinitions

func (l *LanguageService) ProvideDefinitions(fileName string, position int) []Location

func (*LanguageService) ProvideHover

func (l *LanguageService) ProvideHover(fileName string, position int) string

func (*LanguageService) Trace

func (l *LanguageService) Trace(msg string)

Trace implements compiler.CompilerHost.

type Location

type Location struct {
	FileName string
	Range    core.TextRange
}

type TextChange

type TextChange struct {
	core.TextRange
	NewText string
}

func (TextChange) ApplyTo

func (t TextChange) ApplyTo(text string) string

Jump to

Keyboard shortcuts

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