| 31 | type NewDocumentFunc func(mgr *Manager, u uri.URI, identifier protocol.LanguageIdentifier, version int32, input []byte) Document |
| 32 | |
| 33 | func 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 |