@@ -43,6 +43,20 @@ import (
4343// ID and Errors (if present) will always be filled.
4444// [Load] may return more information than requested.
4545//
46+ // The Mode flag is a union of several bits named NeedName,
47+ // NeedFiles, and so on, each of which determines whether
48+ // a given field of Package (Name, Files, etc) should be
49+ // populated.
50+ //
51+ // For convenience, we provide named constants for the most
52+ // common combinations of Need flags:
53+ //
54+ // [LoadFiles] lists of files in each package
55+ // [LoadImports] ... plus imports
56+ // [LoadTypes] ... plus type information
57+ // [LoadSyntax] ... plus type-annotated syntax
58+ // [LoadAllSyntax] ... for all dependencies
59+ //
4660// Unfortunately there are a number of open bugs related to
4761// interactions among the LoadMode bits:
4862// - https://github.com/golang/go/issues/56633
@@ -109,33 +123,18 @@ const (
109123
110124const (
111125 // LoadFiles loads the name and file names for the initial packages.
112- //
113- // Deprecated: LoadFiles exists for historical compatibility
114- // and should not be used. Please directly specify the needed fields using the Need values.
115126 LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles
116127
117128 // LoadImports loads the name, file names, and import mapping for the initial packages.
118- //
119- // Deprecated: LoadImports exists for historical compatibility
120- // and should not be used. Please directly specify the needed fields using the Need values.
121129 LoadImports = LoadFiles | NeedImports
122130
123131 // LoadTypes loads exported type information for the initial packages.
124- //
125- // Deprecated: LoadTypes exists for historical compatibility
126- // and should not be used. Please directly specify the needed fields using the Need values.
127132 LoadTypes = LoadImports | NeedTypes | NeedTypesSizes
128133
129134 // LoadSyntax loads typed syntax for the initial packages.
130- //
131- // Deprecated: LoadSyntax exists for historical compatibility
132- // and should not be used. Please directly specify the needed fields using the Need values.
133135 LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo
134136
135137 // LoadAllSyntax loads typed syntax for the initial packages and all dependencies.
136- //
137- // Deprecated: LoadAllSyntax exists for historical compatibility
138- // and should not be used. Please directly specify the needed fields using the Need values.
139138 LoadAllSyntax = LoadSyntax | NeedDeps
140139
141140 // Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile.
0 commit comments