Versions in this module Expand all Collapse all v0 v0.0.35 Oct 12, 2022 Changes in this version + const AssignVariableTypes + const Change + const Close + const CompositeLiteralFieldNames + const CompositeLiteralTypes + const ConstantValues + const Create + const Delete + const ExtractFunction + const ExtractMethod + const ExtractVariable + const FillStruct + const FunctionTypeParameters + const Go + const InvalidateMetadata + const Mod + const Open + const ParameterNames + const RangeVariableTypes + const Save + const StubMethods + const Sum + const Tmpl + const UndeclaredName + const UnknownFileAction + const UnknownKind + const Work + var AllInlayHints = map[string]*Hint + var AllParseModes = []ParseMode + var ErrNoIdentFound = errors.New("no identifier found") + var ErrNoModOnDisk = errors.New("go.mod file is not on disk") + var ErrNoRuneFound = errors.New("no rune found") + var ErrNotAType = errors.New("not a type name or method") + var ErrTmpModfileUnsupported = errors.New("-modfile is unsupported for this Go version") + var ErrViewExists = errors.New("view already exists for session") + var GeneratedAPIJSON = &APIJSON + var PackagesLoadError = errors.New("packages.Load error") + func AddImport(ctx context.Context, snapshot Snapshot, fh VersionedFileHandle, ...) ([]protocol.TextEdit, error) + func Analyze(ctx context.Context, snapshot Snapshot, pkg Package, includeConvenience bool) (map[span.URI][]*Diagnostic, error) + func ApplyFix(ctx context.Context, fix string, snapshot Snapshot, fh VersionedFileHandle, ...) ([]protocol.TextDocumentEdit, error) + func ApplyProtocolEdits(m *protocol.ColumnMapper, edits []protocol.TextEdit) (string, []diff.Edit, error) + func BuildLink(target, path, anchor string) string + func ByteOffsetsToRange(m *protocol.ColumnMapper, uri span.URI, start, end int) (protocol.Range, error) + func CanExtractFunction(tok *token.File, rng span.Range, src []byte, file *ast.File) (*fnExtractParams, bool, bool, error) + func CanExtractVariable(rng span.Range, file *ast.File) (ast.Expr, []ast.Node, bool, error) + 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 FindDeclAndField(files []*ast.File, pos token.Pos) (decl ast.Decl, field *ast.Field) + func Format(ctx context.Context, snapshot Snapshot, fh FileHandle) ([]protocol.TextEdit, error) + func FormatHover(h *HoverJSON, 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 FormatTypeParams(tparams *typeparams.TypeParamList) string + func FormatVarType(fset *token.FileSet, srcpkg Package, obj *types.Var, qf types.Qualifier) string + func FromProtocolEdits(m *protocol.ColumnMapper, edits []protocol.TextEdit) ([]diff.Edit, error) + func GCOptimizationDetails(ctx context.Context, snapshot Snapshot, pkg Package) (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, ...) ([]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 InDirLex(dir, path string) bool + func IncomingCalls(ctx context.Context, snapshot Snapshot, fh FileHandle, pos protocol.Position) ([]protocol.CallHierarchyIncomingCall, error) + func InlayHint(ctx context.Context, snapshot Snapshot, fh FileHandle, pRng protocol.Range) ([]protocol.InlayHint, error) + func IsCommandLineArguments(s string) bool + func IsGenerated(ctx context.Context, snapshot Snapshot, uri span.URI) bool + func IsInterface(T types.Type) bool + func IsNonFatalGoModError(err error) bool + func IsValidImport(pkgPath, importPkgPath string) bool + func IsWorkspaceModuleVersion(version string) bool + func KnownPackages(ctx context.Context, snapshot Snapshot, fh VersionedFileHandle) ([]string, error) + func LensFuncs() map[command.Command]LensFunc + func LineToRange(m *protocol.ColumnMapper, uri span.URI, start, end modfile.Position) (protocol.Range, 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 RecvIdent(recv *ast.FieldList) *ast.Ident + func Rename(ctx context.Context, s Snapshot, f FileHandle, pp protocol.Position, ...) (map[span.URI][]protocol.TextEdit, bool, error) + func SignatureHelp(ctx context.Context, snapshot Snapshot, fh FileHandle, ...) (*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.Edit) ([]protocol.TextEdit, error) + func WorkspaceModuleVersion(majorVersion string) string + func WorkspaceSymbols(ctx context.Context, matcher SymbolMatcher, style SymbolStyle, views []View, ...) ([]protocol.SymbolInformation, error) + type APIJSON struct + Analyzers []*AnalyzerJSON + Commands []*CommandJSON + Hints []*HintJSON + Lenses []*LensJSON + Options map[string][]*OptionJSON + type Analyzer struct + ActionKind []protocol.CodeActionKind + Analyzer *analysis.Analyzer + Enabled bool + Fix string + Severity protocol.DiagnosticSeverity + func EnabledAnalyzers(snapshot Snapshot) (analyzers []*Analyzer) + func (a Analyzer) IsEnabled(view View) bool + type AnalyzerJSON struct + Default bool + Doc string + Name string + func (a *AnalyzerJSON) String() string + func (a *AnalyzerJSON) Write(w io.Writer) + type Annotation string + const Bounds + const Escape + const Inline + const Nil + type BuildOptions struct + AllowImplicitNetworkAccess bool + AllowModfileModifications bool + BuildFlags []string + DirectoryFilters []string + Env map[string]string + ExpandWorkspaceToModule bool + ExperimentalPackageCacheKey bool + ExperimentalUseInvalidMetadata bool + ExperimentalWorkspaceModule bool + MemoryMode MemoryMode + TemplateExtensions []string + type ClientOptions struct + CompletionDeprecated bool + CompletionTags bool + ConfigurationSupported bool + DynamicConfigurationSupported bool + DynamicRegistrationSemanticTokensSupported bool + DynamicWatchedFilesSupported bool + HierarchicalDocumentSymbolSupport bool + InsertTextFormat protocol.InsertTextFormat + LineFoldingOnly bool + PreferredContentFormat protocol.MarkupKind + RelatedInformationSupported bool + SemanticMods []string + SemanticTypes []string + SupportedResourceOperations []protocol.ResourceOperationKind + type CommandJSON struct + ArgDoc string + Command string + Doc string + ResultDoc string + Title string + func (c *CommandJSON) String() string + func (c *CommandJSON) Write(w io.Writer) + type CompletionOptions struct + CompletionBudget time.Duration + ExperimentalPostfixCompletions bool + Matcher Matcher + UsePlaceholders bool + type CriticalError struct + Diagnostics []*Diagnostic + MainError error + type Declaration struct + MappedRange []MappedRange + type Diagnostic struct + Analyzer *Analyzer + Code string + CodeHref string + Message string + Range protocol.Range + Related []RelatedInformation + Severity protocol.DiagnosticSeverity + Source DiagnosticSource + SuggestedFixes []SuggestedFix + Tags []protocol.DiagnosticTag + URI span.URI + func (d *Diagnostic) String() string + type DiagnosticOptions struct + Analyses map[string]bool + Annotations map[Annotation]bool + DiagnosticsDelay time.Duration + ExperimentalWatchedFileDelay time.Duration + Staticcheck bool + type DiagnosticSource string + const ListError + const ModTidyError + const OptimizationDetailsError + const ParseError + const TemplateError + const TypeError + const UnknownError + const UpgradeNotification + const Vulncheck + const WorkFileError + func AnalyzerErrorKind(name string) DiagnosticSource + type DiffFunction func(before, after string) []diff.Edit + type DocumentationOptions struct + HoverKind HoverKind + LinkTarget string + LinksInHover bool + type EnumKey struct + Default string + Doc string + Name string + type EnumKeys struct + Keys []EnumKey + ValueType string + type EnumValue struct + Doc string + Value string + type FileAction int + func (a FileAction) String() string + type FileHandle interface + FileIdentity func() FileIdentity + Read func() ([]byte, error) + Saved func() bool + URI func() span.URI + type FileIdentity struct + Hash Hash + URI span.URI + func (id FileIdentity) String() string + type FileKind int + func FileKindForLang(langID string) FileKind + func (k FileKind) String() string + type FileModification struct + Action FileAction + LanguageID string + OnDisk bool + Text []byte + URI span.URI + Version int32 + type FileSource interface + GetFile func(ctx context.Context, uri span.URI) (FileHandle, error) + type Filterer struct + func NewFilterer(rawFilters []string) *Filterer + func (f *Filterer) Disallow(path string) bool + type FoldingRangeInfo struct + Kind protocol.FoldingRangeKind + func FoldingRange(ctx context.Context, snapshot Snapshot, fh FileHandle, lineFoldingOnly bool) (ranges []*FoldingRangeInfo, err error) + type FormattingOptions struct + Gofumpt bool + Local string + type Hash [sha256.Size]byte + func HashOf(data []byte) Hash + func Hashf(format string, args ...interface{}) Hash + func (h Hash) Less(other Hash) bool + func (h Hash) String() string + type Hint struct + Doc string + Name string + Run InlayHintFunc + type HintJSON struct + Default bool + Doc string + Name string + func (h *HintJSON) String() string + func (h *HintJSON) Write(w io.Writer) + type Hooks struct + ComputeEdits DiffFunction + ConvenienceAnalyzers map[string]*Analyzer + DefaultAnalyzers map[string]*Analyzer + GoDiff bool + GofumptFormat func(ctx context.Context, langVersion, modulePath string, src []byte) ([]byte, error) + LicensesText string + StaticcheckAnalyzers map[string]*Analyzer + StaticcheckSupported bool + TypeErrorAnalyzers map[string]*Analyzer + URLRegexp *regexp.Regexp + type HoverContext struct + Comment *ast.CommentGroup + func FindHoverContext(ctx context.Context, s Snapshot, pkg Package, obj types.Object, ...) (*HoverContext, error) + type HoverJSON struct + FullDocumentation string + LinkAnchor string + LinkPath string + Signature string + SingleLine string + SymbolName string + Synopsis string + func HoverIdentifier(ctx context.Context, i *IdentifierInfo) (*HoverJSON, error) + type HoverKind string + const FullDocumentation + const NoDocumentation + const SingleLine + const Structured + const SynopsisDocumentation + type IdentifierInfo struct + Declaration Declaration + Inferred *types.Signature + Name string + Snapshot Snapshot + Type struct{ ... } + func Identifier(ctx context.Context, snapshot Snapshot, fh FileHandle, ...) (*IdentifierInfo, error) + func (i *IdentifierInfo) IsImport() bool + 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 InlayHintFunc func(node ast.Node, tmap *lsppos.TokenMapper, info *types.Info, q *types.Qualifier) []protocol.InlayHint + type InlayHintOptions struct + Hints map[string]bool + type InternalOptions struct + ChattyDiagnostics bool + CompleteUnimported bool + CompletionDocumentation bool + DeepCompletion bool + LiteralCompletions bool + NewDiff string + ShowBugReports bool + TempModfile bool + VerboseWorkDoneProgress bool + type InvocationFlags int + const AllowNetwork + const LoadWorkspace + const Normal + 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 + func (l *LensJSON) String() string + func (l *LensJSON) Write(w io.Writer) + type MappedRange struct + func NewMappedRange(file *token.File, 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) URI() span.URI + type Matcher string + const CaseInsensitive + const CaseSensitive + const Fuzzy + type MemoryMode string + const ModeDegradeClosed + const ModeNormal + type Metadata interface + ModuleInfo func() *packages.Module + PackageName func() string + PackagePath func() string + type NavigationOptions struct + ImportShortcut ImportShortcut + SymbolMatcher SymbolMatcher + SymbolStyle SymbolStyle + type OptionJSON struct + Default string + Doc string + EnumKeys EnumKeys + EnumValues []EnumValue + Hierarchy string + Name string + Status string + Type string + func (o *OptionJSON) String() string + func (o *OptionJSON) Write(w io.Writer) + type OptionResult struct + Error error + Name string + Value interface{} + type OptionResults []OptionResult + func SetOptions(options *Options, opts interface{}) OptionResults + type Options struct + func DefaultOptions() *Options + func (o *Options) AddStaticcheckAnalyzer(a *analysis.Analyzer, enabled bool, severity protocol.DiagnosticSeverity) + func (o *Options) Clone() *Options + func (o *Options) EnableAllExperiments() + func (o *Options) ForClientCapabilities(caps protocol.ClientCapabilities) + type Overlay interface + Kind func() FileKind + type Package interface + CompiledGoFiles func() []*ParsedGoFile + File func(uri span.URI) (*ParsedGoFile, error) + ForTest func() string + GetImport func(pkgPath string) (Package, error) + GetSyntax func() []*ast.File + GetTypes func() *types.Package + GetTypesInfo func() *types.Info + GetTypesSizes func() types.Sizes + HasListOrParseErrors func() bool + HasTypeErrors func() bool + ID func() string + Imports func() []Package + MissingDependencies func() []string + Name func() string + ParseMode func() ParseMode + PkgPath func() string + Version func() *module.Version + func FindPackageFromPos(fset *token.FileSet, pkg Package, pos token.Pos) (Package, error) + type PackageFilter int + const NarrowestPackage + const WidestPackage + type ParseMode int + const ParseExported + const ParseFull + const ParseHeader + type ParsedGoFile struct + File *ast.File + Fixed bool + Mapper *protocol.ColumnMapper + Mode ParseMode + ParseErr scanner.ErrorList + Src []byte + Tok *token.File + URI span.URI + type ParsedModule struct + File *modfile.File + Mapper *protocol.ColumnMapper + ParseErrors []*Diagnostic + URI span.URI + type ParsedWorkFile struct + File *modfile.WorkFile + Mapper *protocol.ColumnMapper + ParseErrors []*Diagnostic + URI span.URI + type PrepareItem struct + Range protocol.Range + Text string + func PrepareRename(ctx context.Context, snapshot Snapshot, f FileHandle, pp protocol.Position) (_ *PrepareItem, usererr, err 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 Snapshot interface + ActivePackages func(ctx context.Context) ([]Package, error) + Analyze func(ctx context.Context, pkgID string, analyzers []*Analyzer) ([]*Diagnostic, error) + AwaitInitialized func(ctx context.Context) + BackgroundContext func() context.Context + BuildGoplsMod func(ctx context.Context) (*modfile.File, error) + BuiltinFile func(ctx context.Context) (*ParsedGoFile, error) + CachedImportPaths func(ctx context.Context) (map[string]Package, error) + DiagnosePackage func(ctx context.Context, pkg Package) (map[span.URI][]*Diagnostic, error) + FileSet func() *token.FileSet + FindFile func(uri span.URI) VersionedFileHandle + GetCriticalError func(ctx context.Context) *CriticalError + 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(uri span.URI) span.URI + ID func() uint64 + IgnoredFile func(uri span.URI) bool + IsBuiltin func(ctx context.Context, uri span.URI) bool + IsOpen func(uri span.URI) bool + KnownPackages func(ctx context.Context) ([]Package, error) + MetadataForFile func(ctx context.Context, uri span.URI) ([]Metadata, error) + ModFiles func() []span.URI + ModTidy func(ctx context.Context, pm *ParsedModule) (*TidiedModule, 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) + ParseWork func(ctx context.Context, fh FileHandle) (*ParsedWorkFile, 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 + RunGoCommands func(ctx context.Context, allowNetwork bool, wd string, ...) (bool, []byte, []byte, error) + RunProcessEnvFunc func(ctx context.Context, fn func(*imports.Options) error) error + Symbols func(ctx context.Context) map[span.URI][]Symbol + Templates func() map[span.URI]VersionedFileHandle + ValidBuildConfiguration func() bool + View func() View + WorkFile func() span.URI + WriteEnv func(ctx context.Context, w io.Writer) error + type SoftError struct + func (e *SoftError) Error() string + type SuggestedFix struct + ActionKind protocol.CodeActionKind + Command *protocol.Command + Edits map[span.URI][]protocol.TextEdit + Title string + func SuggestedFixFromCommand(cmd protocol.Command, kind protocol.CodeActionKind) SuggestedFix + type SuggestedFixFunc func(ctx context.Context, snapshot Snapshot, fh VersionedFileHandle, ...) (*analysis.SuggestedFix, error) + type Symbol struct + Kind protocol.SymbolKind + Name string + Range protocol.Range + type SymbolMatcher string + const SymbolCaseInsensitive + const SymbolCaseSensitive + const SymbolFastFuzzy + const SymbolFuzzy + type SymbolStyle string + const DynamicSymbols + const FullyQualifiedSymbols + const PackageQualifiedSymbols + type TidiedModule struct + Diagnostics []*Diagnostic + TidiedContent []byte + type TypecheckMode int + const TypecheckFull + const TypecheckWorkspace + type UIOptions struct + Codelenses map[string]bool + NoSemanticNumber bool + NoSemanticString bool + SemanticTokens bool + type UserOptions struct + VerboseOutput bool + func (u *UserOptions) EnvSlice() []string + func (u *UserOptions) SetEnvSlice(env []string) + type VersionedFileHandle interface + Session func() string + Version func() int32 + VersionedFileIdentity func() VersionedFileIdentity + type VersionedFileIdentity struct + SessionID string + URI span.URI + Version int32 + type View interface + ClearModuleUpgrades func(modfile span.URI) + FileKind func(FileHandle) FileKind + Folder func() span.URI + GoVersion func() int + IsGoPrivatePath func(path string) bool + ModuleUpgrades func(modfile span.URI) map[string]string + Name func() string + Options func() *Options + RegisterModuleUpgrades func(modfile span.URI, upgrades map[string]string) + SetOptions func(context.Context, *Options) (View, error) + SetVulnerabilities func(modfile span.URI, vulnerabilities []govulncheck.Vuln) + Shutdown func(ctx context.Context) + Snapshot func(ctx context.Context) (Snapshot, func()) + Vulnerabilities func(modfile span.URI) []govulncheck.Vuln