MCPcopy Create free account
hub / github.com/docker/docker-language-server / OpenDockerfile

Function OpenDockerfile

internal/pkg/document/manager.go:46–58  ·  view source on GitHub ↗
(ctx context.Context, manager *Manager, documentURI, path string)

Source from the content-addressed store, hash-verified

44}
45
46func OpenDockerfile(ctx context.Context, manager *Manager, documentURI, path string) ([]byte, []*parser.Node) {
47 doc := manager.Get(ctx, uri.URI(documentURI))
48 if doc != nil {
49 if dockerfile, ok := doc.(DockerfileDocument); ok {
50 return dockerfile.Input(), dockerfile.Nodes()
51 }
52 }
53 dockerfileBytes, result, err := parseDockerfile(path)
54 if err != nil {
55 return nil, nil
56 }
57 return dockerfileBytes, result.AST.Children
58}
59
60func NewDocumentManager(opts ...ManagerOpt) *Manager {
61 m := Manager{

Callers 6

ResolveExpressionFunction · 0.92
CompletionFunction · 0.92
InlayHintFunction · 0.92
CollectDiagnosticsMethod · 0.92
InlineCompletionFunction · 0.92
findBuildStagesFunction · 0.92

Calls 5

parseDockerfileFunction · 0.85
GetMethod · 0.65
URIMethod · 0.65
InputMethod · 0.65
NodesMethod · 0.65

Tested by

no test coverage detected