Expose native filesystem sources through public loading API
This commit is contained in:
@@ -11,6 +11,18 @@ const (
|
||||
LayerResolution Layer = "resolution"
|
||||
)
|
||||
|
||||
// SourceKind identifies source acquisition independently of precedence.
|
||||
type SourceKind string
|
||||
|
||||
const (
|
||||
SourceKindFile SourceKind = "file"
|
||||
SourceKindFilesystem SourceKind = "filesystem"
|
||||
SourceKindBytes SourceKind = "bytes"
|
||||
SourceKindReader SourceKind = "reader"
|
||||
SourceKindMapping SourceKind = "mapping"
|
||||
SourceKindCLI SourceKind = "cli"
|
||||
)
|
||||
|
||||
// ChangeKind identifies a recorded operation. The zero value is
|
||||
// used for input and default origins.
|
||||
type ChangeKind string
|
||||
@@ -156,14 +168,16 @@ type Location struct {
|
||||
Column int
|
||||
}
|
||||
|
||||
// SourceInfo describes a source discovered during a load. Path is a canonical
|
||||
// local path when one exists. ImportedFrom identifies the declaration that
|
||||
// included this source.
|
||||
// SourceInfo describes a source discovered during a load. Kind identifies
|
||||
// acquisition independently of Layer. Path is a canonical host path or a
|
||||
// namespace-relative filesystem path; synthetic sources have no Path.
|
||||
// ImportedFrom identifies the declaration that included this source.
|
||||
type SourceInfo struct {
|
||||
ID string
|
||||
Label string
|
||||
Path string
|
||||
Layer Layer
|
||||
Kind SourceKind
|
||||
ImportedFrom *Location
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user