Versions in this module Expand all Collapse all v0 v0.5.7 Dec 5, 2020 Changes in this version + const Analysis + const Change + const Close + const CommandPrefix + const Create + const Delete + const Go + const GoModTidy + const InvalidateMetadata + const ListError + const Mod + const ModTidyError + const Open + const OptionDeprecated + const OptionHandled + const OptionUnexpected + const ParseError + const Save + const Sum + const TypeError + const UnknownError + const UnknownFileAction + const UnknownKind + var CommandAddDependency = &Command + var CommandExtractFunction = &Command + var CommandExtractVariable = &Command + var CommandFillStruct = &Command + var CommandGenerate = &Command + var CommandGenerateGoplsMod = &Command + var CommandGoGetPackage = &Command + var CommandRegenerateCgo = &Command + var CommandRemoveDependency = &Command + var CommandTest = &Command + var CommandTidy = &Command + var CommandToggleDetails = &Command + var CommandUndeclaredName = &Command + var CommandUpdateGoSum = &Command + var CommandUpgradeDependency = &Command + var CommandVendor = &Command + var Commands = []*Command + var ErrNoIdentFound = errors.New("no identifier found") + var ErrNoModOnDisk = errors.New("go.mod file is not on disk") + var ErrNotAType = errors.New("not a type name or method") + var ErrTmpModfileUnsupported = errors.New("-modfile is unsupported for this Go version") + var GeneratedAPIJSON = &APIJSON + var PackagesLoadError = errors.New("packages.Load error") + func Analyze(ctx context.Context, snapshot Snapshot, pkg Package, ...) (map[span.URI][]*Diagnostic, error) + func BuildLink(target, path, anchor string) string + func CollectScopes(info *types.Info, path []ast.Node, pos token.Pos) []*types.Scope + func CommentToMarkdown(text string) string + func CompareDiagnostic(a, b *Diagnostic) int + func CompareURI(left, right span.URI) int + func ComputeOneImportFixEdits(snapshot Snapshot, pgf *ParsedGoFile, fix *imports.ImportFix) ([]protocol.TextEdit, error) + func Deref(typ types.Type) types.Type + func DocumentSymbols(ctx context.Context, snapshot Snapshot, fh FileHandle) ([]protocol.DocumentSymbol, error) + func FileDiagnostics(ctx context.Context, snapshot Snapshot, uri span.URI) (VersionedFileIdentity, []*Diagnostic, error) + func FindPosInPackage(snapshot Snapshot, searchpkg Package, pos token.Pos) (*ParsedGoFile, Package, error) + func Format(ctx context.Context, snapshot Snapshot, fh FileHandle) ([]protocol.TextEdit, error) + func FormatHover(h *HoverInformation, options *Options) (string, error) + func FormatNode(fset *token.FileSet, n ast.Node) string + func FormatType(typ types.Type, qf types.Qualifier) (detail string, kind protocol.CompletionItemKind) + func FormatVarType(ctx context.Context, snapshot Snapshot, srcpkg Package, obj *types.Var, ...) string + func FromProtocolEdits(m *protocol.ColumnMapper, edits []protocol.TextEdit) ([]diff.TextEdit, error) + func GCOptimizationDetails(ctx context.Context, snapshot Snapshot, pkgDir span.URI) (map[VersionedFileIdentity][]*Diagnostic, error) + func GetParsedFile(ctx context.Context, snapshot Snapshot, fh FileHandle, pkgPolicy PackageFilter) (Package, *ParsedGoFile, error) + func Highlight(ctx context.Context, snapshot Snapshot, fh FileHandle, pos protocol.Position) ([]protocol.Range, error) + func Hover(ctx context.Context, snapshot Snapshot, fh FileHandle, ...) (*protocol.Hover, error) + func Implementation(ctx context.Context, snapshot Snapshot, f FileHandle, pp protocol.Position) ([]protocol.Location, error) + func ImportPath(s *ast.ImportSpec) string + func InDir(dir, path string) bool + func IncomingCalls(ctx context.Context, snapshot Snapshot, fh FileHandle, pos protocol.Position) ([]protocol.CallHierarchyIncomingCall, error) + func IsGenerated(ctx context.Context, snapshot Snapshot, uri span.URI) bool + func IsInterface(T types.Type) bool + func IsNonFatalGoModError(err error) bool + func IsWorkspaceModuleVersion(version string) bool + func LensFuncs() map[string]LensFunc + func MarshalArgs(args ...interface{}) ([]json.RawMessage, error) + func NewBuiltinSignature(ctx context.Context, s Snapshot, name string) (*signature, error) + func NewSignature(ctx context.Context, s Snapshot, pkg Package, sig *types.Signature, ...) *signature + func NodeContains(n ast.Node, pos token.Pos) bool + func OutgoingCalls(ctx context.Context, snapshot Snapshot, fh FileHandle, pos protocol.Position) ([]protocol.CallHierarchyOutgoingCall, error) + func PrepareCallHierarchy(ctx context.Context, snapshot Snapshot, fh FileHandle, pos protocol.Position) ([]protocol.CallHierarchyItem, error) + func Qualifier(f *ast.File, pkg *types.Package, info *types.Info) types.Qualifier + func Rename(ctx context.Context, s Snapshot, f FileHandle, pp protocol.Position, ...) (map[span.URI][]protocol.TextEdit, error) + func SignatureHelp(ctx context.Context, snapshot Snapshot, fh FileHandle, pos protocol.Position) (*protocol.SignatureInformation, int, error) + func SortDiagnostics(d []*Diagnostic) + func TestsAndBenchmarks(ctx context.Context, snapshot Snapshot, fh FileHandle) (testFns, error) + func ToProtocolEdits(m *protocol.ColumnMapper, edits []diff.TextEdit) ([]protocol.TextEdit, error) + func UnmarshalArgs(jsonArgs []json.RawMessage, args ...interface{}) error + func WorkspaceModuleVersion(majorVersion string) string + func WorkspaceSymbols(ctx context.Context, matcherType SymbolMatcher, style SymbolStyle, ...) ([]protocol.SymbolInformation, error) + type APIJSON struct + Commands []*CommandJSON + Lenses []*LensJSON + Options map[string][]*OptionJSON + type Analyzer struct + Analyzer *analysis.Analyzer + Command *Command + Enabled bool + FixesError func(msg string) bool + HighConfidence bool + func EnabledAnalyzers(snapshot Snapshot) (analyzers []Analyzer) + func (a Analyzer) IsEnabled(view View) bool + type AppliesFunc func(fset *token.FileSet, rng span.Range, src []byte, file *ast.File, ...) bool + type BuiltinPackage struct + Package *ast.Package + ParsedFile *ParsedGoFile + type ClientOptions struct + ConfigurationSupported bool + DynamicConfigurationSupported bool + DynamicWatchedFilesSupported bool + HierarchicalDocumentSymbolSupport bool + InsertTextFormat protocol.InsertTextFormat + LineFoldingOnly bool + PreferredContentFormat protocol.MarkupKind + SemanticMods []string + SemanticTypes []string + type Command struct + Async bool + Name string + Title string + func (c *Command) Applies(ctx context.Context, snapshot Snapshot, fh FileHandle, pRng protocol.Range) bool + func (c *Command) IsSuggestedFix() bool + func (c *Command) SuggestedFix(ctx context.Context, snapshot Snapshot, fh VersionedFileHandle, ...) ([]protocol.TextDocumentEdit, error) + func (c Command) ID() string + type CommandJSON struct + Command string + Doc string + Title string + type CriticalError struct + MainError error + func (err *CriticalError) Error() string + type DebuggingOptions struct + CompletionBudget time.Duration + VerboseOutput bool + type Declaration struct + MappedRange []MappedRange + type Diagnostic struct + Message string + Range protocol.Range + Related []RelatedInformation + Severity protocol.DiagnosticSeverity + Source string + Tags []protocol.DiagnosticTag + type EnumValue struct + Doc string + Value string + type Error struct + Category string + Kind ErrorKind + Message string + Range protocol.Range + Related []RelatedInformation + SuggestedFixes []SuggestedFix + URI span.URI + func (e *Error) Error() string + type ErrorKind int + type ErrorList []*Error + func (err ErrorList) Error() string + type ExperimentalOptions struct + AllowImplicitNetworkAccess bool + AllowModfileModifications bool + Annotations map[string]bool + ExpandWorkspaceToModule bool + ExperimentalDiagnosticsDelay time.Duration + ExperimentalPackageCacheKey bool + ExperimentalWorkspaceModule bool + SemanticTokens bool + Staticcheck bool + type FileAction int + func (a FileAction) String() string + type FileHandle interface + FileIdentity func() FileIdentity + Kind func() FileKind + Read func() ([]byte, error) + Saved func() bool + URI func() span.URI + type FileIdentity struct + Hash string + Kind FileKind + URI span.URI + func (id FileIdentity) String() string + type FileKind int + func DetectLanguage(langID, filename string) FileKind + func (k FileKind) String() string + type FileModification struct + Action FileAction + LanguageID string + OnDisk bool + Text []byte + URI span.URI + Version float64 + type FileSource interface + GetFile func(ctx context.Context, uri span.URI) (FileHandle, error) + type FoldingRangeInfo struct + Kind protocol.FoldingRangeKind + func FoldingRange(ctx context.Context, snapshot Snapshot, fh FileHandle, lineFoldingOnly bool) (ranges []*FoldingRangeInfo, err error) + type Hooks struct + ComputeEdits diff.ComputeEdits + ConvenienceAnalyzers map[string]Analyzer + DefaultAnalyzers map[string]Analyzer + GoDiff bool + GofumptFormat func(ctx context.Context, src []byte) ([]byte, error) + StaticcheckAnalyzers map[string]Analyzer + TypeErrorAnalyzers map[string]Analyzer + URLRegexp *regexp.Regexp + type HoverInformation struct + FullDocumentation string + LinkAnchor string + LinkPath string + Signature string + SingleLine string + Synopsis string + func HoverIdentifier(ctx context.Context, i *IdentifierInfo) (*HoverInformation, error) + func HoverInfo(ctx context.Context, pkg Package, obj types.Object, node ast.Node) (*HoverInformation, error) + type HoverKind string + const FullDocumentation + const NoDocumentation + const SingleLine + const Structured + const SynopsisDocumentation + type IdentifierInfo struct + Declaration Declaration + Name string + Snapshot Snapshot + Type struct{ ... } + func Identifier(ctx context.Context, snapshot Snapshot, fh FileHandle, pos protocol.Position) (*IdentifierInfo, error) + type ImportFix struct + Edits []protocol.TextEdit + Fix *imports.ImportFix + func AllImportsFixes(ctx context.Context, snapshot Snapshot, fh FileHandle) (allFixEdits []protocol.TextEdit, editsPerFix []*ImportFix, err error) + type ImportShortcut string + const Both + const Definition + const Link + func (s ImportShortcut) ShowDefinition() bool + func (s ImportShortcut) ShowLinks() bool + type InternalOptions struct + CompleteUnimported bool + CompletionDocumentation bool + DeepCompletion bool + LiteralCompletions bool + TempModfile bool + VerboseWorkDoneProgress bool + type InvocationFlags int + const AllowNetwork + const LoadWorkspace + const Normal + const UpdateUserModFile + const WriteTemporaryModFile + func (m InvocationFlags) AllowNetwork() bool + func (m InvocationFlags) Mode() InvocationFlags + type LensFunc func(context.Context, Snapshot, FileHandle) ([]protocol.CodeLens, error) + type LensJSON struct + Doc string + Lens string + Title string + type LinkTarget string + type MappedRange struct + func NewMappedRange(fset *token.FileSet, m *protocol.ColumnMapper, start, end token.Pos) MappedRange + func (s MappedRange) Range() (protocol.Range, error) + func (s MappedRange) Span() (span.Span, error) + func (s MappedRange) SpanRange() span.Range + func (s MappedRange) URI() span.URI + type Matcher string + const CaseInsensitive + const CaseSensitive + const Fuzzy + type OptionJSON struct + Default string + Doc string + EnumValues []EnumValue + Name string + Type string + type OptionResult struct + Error error + Name string + Replacement string + State OptionState + Value interface{} + type OptionResults []OptionResult + func SetOptions(options *Options, opts interface{}) OptionResults + type OptionState int + type Options struct + func DefaultOptions() *Options + func (o *Options) AddStaticcheckAnalyzer(a *analysis.Analyzer) + func (o *Options) Clone() *Options + func (o *Options) ForClientCapabilities(caps protocol.ClientCapabilities) + type Overlay interface + type Package interface + CompiledGoFiles func() []*ParsedGoFile + File func(uri span.URI) (*ParsedGoFile, error) + ForTest func() string + GetErrors func() []*Error + GetImport func(pkgPath string) (Package, error) + GetSyntax func() []*ast.File + GetTypes func() *types.Package + GetTypesInfo func() *types.Info + GetTypesSizes func() types.Sizes + ID func() string + Imports func() []Package + IsIllTyped func() bool + MissingDependencies func() []string + Name func() string + PkgPath func() string + Version func() *module.Version + type PackageFilter int + const NarrowestPackage + const WidestPackage + type ParseMode int + const ParseExported + const ParseFull + const ParseHeader + type ParsedGoFile struct + File *ast.File + Mapper *protocol.ColumnMapper + Mode ParseMode + ParseErr error + Src []byte + Tok *token.File + URI span.URI + type ParsedModule struct + File *modfile.File + Mapper *protocol.ColumnMapper + ParseErrors []*Error + URI span.URI + type PrepareItem struct + Range protocol.Range + Text string + func PrepareRename(ctx context.Context, snapshot Snapshot, f FileHandle, pp protocol.Position) (*PrepareItem, error) + type ReferenceInfo struct + Name string + func References(ctx context.Context, s Snapshot, f FileHandle, pp protocol.Position, ...) ([]*ReferenceInfo, error) + type RelatedInformation struct + Message string + Range protocol.Range + URI span.URI + type ServerOptions struct + SupportedCodeActions map[FileKind]map[protocol.CodeActionKind]bool + SupportedCommands []string + type Session interface + Cache func() interface{} + DidModifyFiles func(ctx context.Context, changes []FileModification) (map[span.URI]View, map[View]Snapshot, []func(), error) + ExpandModificationsToDirectories func(ctx context.Context, changes []FileModification) []FileModification + FileWatchingGlobPatterns func(ctx context.Context) map[string]struct{} + GetFile func(ctx context.Context, uri span.URI) (FileHandle, error) + NewView func(ctx context.Context, name string, folder, tempWorkspaceDir span.URI, ...) (View, Snapshot, func(), error) + Options func() *Options + Overlays func() []Overlay + SetOptions func(*Options) + Shutdown func(ctx context.Context) + View func(name string) View + ViewOf func(uri span.URI) (View, error) + Views func() []View + type Snapshot interface + Analyze func(ctx context.Context, pkgID string, analyzers ...*analysis.Analyzer) ([]*Error, error) + AwaitInitialized func(ctx context.Context) + BackgroundContext func() context.Context + BuiltinPackage func(ctx context.Context) (*BuiltinPackage, error) + CachedImportPaths func(ctx context.Context) (map[string]Package, error) + FileSet func() *token.FileSet + FindFile func(uri span.URI) VersionedFileHandle + GetFile func(ctx context.Context, uri span.URI) (FileHandle, error) + GetReverseDependencies func(ctx context.Context, id string) ([]Package, error) + GetVersionedFile func(ctx context.Context, uri span.URI) (VersionedFileHandle, error) + GoModForFile func(ctx context.Context, uri span.URI) span.URI + ID func() uint64 + IgnoredFile func(uri span.URI) bool + IsOpen func(uri span.URI) bool + KnownPackages func(ctx context.Context) ([]Package, error) + ModFiles func() []span.URI + ModTidy func(ctx context.Context, pm *ParsedModule) (*TidiedModule, error) + ModUpgrade func(ctx context.Context, fh FileHandle) (map[string]string, error) + ModWhy func(ctx context.Context, fh FileHandle) (map[string]string, error) + PackageForFile func(ctx context.Context, uri span.URI, mode TypecheckMode, ...) (Package, error) + PackagesForFile func(ctx context.Context, uri span.URI, mode TypecheckMode) ([]Package, error) + ParseGo func(ctx context.Context, fh FileHandle, mode ParseMode) (*ParsedGoFile, error) + ParseMod func(ctx context.Context, fh FileHandle) (*ParsedModule, error) + PosToDecl func(ctx context.Context, pgf *ParsedGoFile) (map[token.Pos]ast.Decl, error) + PosToField func(ctx context.Context, pgf *ParsedGoFile) (map[token.Pos]*ast.Field, error) + RunGoCommandDirect func(ctx context.Context, mode InvocationFlags, inv *gocommand.Invocation) (*bytes.Buffer, error) + RunGoCommandPiped func(ctx context.Context, mode InvocationFlags, inv *gocommand.Invocation, ...) error + RunProcessEnvFunc func(ctx context.Context, fn func(*imports.Options) error) error + ValidBuildConfiguration func() bool + View func() View + WorkspacePackages func(ctx context.Context) ([]Package, error) + WriteEnv func(ctx context.Context, w io.Writer) error + type SuggestedFix struct + Command *protocol.Command + Edits map[span.URI][]protocol.TextEdit + Title string + type SuggestedFixFunc func(fset *token.FileSet, rng span.Range, src []byte, file *ast.File, ...) (*analysis.SuggestedFix, error) + type SymbolMatcher string + const SymbolCaseInsensitive + const SymbolCaseSensitive + const SymbolFuzzy + type SymbolStyle string + const DynamicSymbols + const FullyQualifiedSymbols + const PackageQualifiedSymbols + type TidiedModule struct + Errors []*Error + TidiedContent []byte + type TypeCheckDiagnostics struct + Diagnostics map[span.URI][]*Diagnostic + HasParseOrListErrors bool + HasTypeErrors bool + func GetTypeCheckDiagnostics(ctx context.Context, snapshot Snapshot, pkg Package) TypeCheckDiagnostics + type TypecheckMode int + const TypecheckAll + const TypecheckFull + const TypecheckUnknown + const TypecheckWorkspace + type UserOptions struct + Analyses map[string]bool + BuildFlags []string + Codelenses map[string]bool + Env map[string]string + Gofumpt bool + HoverKind HoverKind + ImportShortcut ImportShortcut + LinkTarget string + LinksInHover bool + Local string + Matcher Matcher + SymbolMatcher SymbolMatcher + SymbolStyle SymbolStyle + UsePlaceholders bool + func (u *UserOptions) EnvSlice() []string + func (u *UserOptions) SetEnvSlice(env []string) + type VersionedFileHandle interface + Session func() string + Version func() float64 + VersionedFileIdentity func() VersionedFileIdentity + type VersionedFileIdentity struct + SessionID string + URI span.URI + Version float64 + type View interface + Folder func() span.URI + IsGoPrivatePath func(path string) bool + Name func() string + Options func() *Options + Rebuild func(ctx context.Context) (Snapshot, func(), error) + SetOptions func(context.Context, *Options) (View, error) + Shutdown func(ctx context.Context) + Snapshot func(ctx context.Context) (Snapshot, func())