MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getProgramAndFile

Method getProgramAndFile

internal/ls/languageservice.go:62–69  ·  view source on GitHub ↗
(documentURI lsproto.DocumentUri)

Source from the content-addressed store, hash-verified

60}
61
62func (l *LanguageService) getProgramAndFile(documentURI lsproto.DocumentUri) (*compiler.Program, *ast.SourceFile) {
63 fileName := documentURI.FileName()
64 program, file := l.tryGetProgramAndFile(fileName)
65 if file == nil {
66 panic("file not found: " + fileName)
67 }
68 return program, file
69}
70
71func (l *LanguageService) GetDocumentPositionMapper(fileName string) *sourcemap.DocumentPositionMapper {
72 d, ok := l.documentPositionMappers[fileName]

Callers 15

ProvideDiagnosticsMethod · 0.95
GetRenameInfoMethod · 0.95
ProvideHoverMethod · 0.95
ProvideOnAutoInsertMethod · 0.95
ProvideCodeLensesMethod · 0.95
ProvideInlayHintMethod · 0.95
ProvideTypeDefinitionMethod · 0.95
ProvideFoldingRangeMethod · 0.95
ProvideCodeActionsMethod · 0.95

Calls 3

tryGetProgramAndFileMethod · 0.95
panicFunction · 0.85
FileNameMethod · 0.65

Tested by

no test coverage detected