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

Function NewDocument

internal/pkg/document/document.go:33–41  ·  view source on GitHub ↗
(mgr *Manager, u uri.URI, identifier protocol.LanguageIdentifier, version int32, input []byte)

Source from the content-addressed store, hash-verified

31type NewDocumentFunc func(mgr *Manager, u uri.URI, identifier protocol.LanguageIdentifier, version int32, input []byte) Document
32
33func NewDocument(mgr *Manager, u uri.URI, identifier protocol.LanguageIdentifier, version int32, input []byte) Document {
34 switch identifier {
35 case protocol.DockerBakeLanguage:
36 return NewBakeHCLDocument(u, version, input)
37 case protocol.DockerComposeLanguage:
38 return NewComposeDocument(mgr, u, version, input)
39 }
40 return NewDockerfileDocument(u, version, input)
41}
42
43// DirectoryForPrefix returns the parent directory to be used given the
44// document's path and the prefix string that has been inserted into the

Callers 7

TestCalculateDiagnosticsFunction · 0.92
TestParseFunction · 0.92
TestUpdateFunction · 0.85
TestDocumentPathFunction · 0.85
TestDocumentPath_WindowsFunction · 0.85

Calls 3

NewBakeHCLDocumentFunction · 0.85
NewComposeDocumentFunction · 0.85
NewDockerfileDocumentFunction · 0.85

Tested by 7

TestCalculateDiagnosticsFunction · 0.74
TestParseFunction · 0.74
TestUpdateFunction · 0.68
TestDocumentPathFunction · 0.68
TestDocumentPath_WindowsFunction · 0.68