package
0.1.7
Repository: https://github.com/polaris1119/tools.git
Documentation: pkg.go.dev

# Packages

Package completion provides core functionality for code completion in Go editors and tools.

# Functions

AddImport adds a single import statement to the given file.
AllImportsFixes formats f for each possible fix to the imports.
No description provided by the author
No description provided by the author
ApplyFix applies the command's suggested fix to the given file and range, returning the resulting edits.
BuildLink constructs a link with the given target, path, and anchor.
CanExtractFunction reports whether the code in the given range can be extracted to a function.
CanExtractVariable reports whether the code in the given range can be extracted to a variable.
CollectScopes returns all scopes in an ast path, ordered as innermost scope first.
CommentToMarkdown converts comment text to formatted markdown.
No description provided by the author
No description provided by the author
ComputeOneImportFixEdits returns text edits for a single import fix.
DefaultOptions is the options that are used for Gopls execution independent of any externally provided configuration (LSP initialization, command invokation, etc.).
Deref returns a pointer's element type, traversing as many levels as needed.
No description provided by the author
No description provided by the author
EnabledAnalyzers returns all of the analyzers enabled for the given snapshot.
No description provided by the author
FindPackageFromPos finds the first package containing pos in its type-checked AST.
FoldingRange gets all of the folding range for f.
Format formats a file with a given range.
No description provided by the author
FormatNode returns the "pretty-print" output for an ast node.
FormatType returns the detail and kind for a types.Type.
FormatVarType formats a *types.Var, accounting for type aliases.
No description provided by the author
No description provided by the author
GetParsedFile is a convenience function that extracts the Package and ParsedGoFile for a file in a Snapshot.
No description provided by the author
No description provided by the author
No description provided by the author
HoverInfo returns a HoverInformation struct for an ast node and its type object.
Identifier returns identifier information for a position in a file, accounting for a potentially incomplete selector.
No description provided by the author
ImportPath returns the unquoted import path of s, or "" if the path is not properly quoted.
IncomingCalls returns an array of CallHierarchyIncomingCall for a file and the position within the file.
InDir checks whether path is in the file tree rooted at dir.
InRange reports whether the given position is in the given token.File.
IsCommandLineArguments reports whether a given value denotes "command-line-arguments" package, which is a package with an unknown ID created by the go command.
No description provided by the author
IsInterface returns if a types.Type is an interface.
No description provided by the author
IsValidImport returns whether importPkgPath is importable by pkgPath.
No description provided by the author
KnownPackages returns a list of all known packages in the package graph that could potentially be imported by the given file.
LensFuncs returns the supported lensFuncs for Go files.
NewBuiltinSignature returns signature for the builtin object with a given name, if a builtin object with the name exists.
NewMappedRange returns a MappedRange for the given start and end token.Pos.
NewSignature returns formatted signature for a types.Signature struct.
NodeContains returns true if a node encloses a given position pos.
OutgoingCalls returns an array of CallHierarchyOutgoingCall for a file and the position within the file.
PrepareCallHierarchy returns an array of CallHierarchyItem for a file and the position within the file.
PrepareRename searches for a valid renaming at position pp.
ProtocolEditsFromSource converts text edits to LSP edits using the original source.
Qualifier returns a function that appropriately formats a types.PkgName appearing in a *ast.File.
References returns a list of references for a given identifier within the packages containing i.File.
Rename returns a map of TextEdits for each file modified when renaming a given identifier within a package.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WorkspaceSymbols matches symbols across all views using the given query, according to the match semantics parameterized by matcherType and style.

# Constants

AllowNetwork is a flag bit that indicates the invocation should be allowed to access the network.
No description provided by the author
Bounds controls bounds checking diagnostics.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DynamicSymbols uses whichever qualifier results in the highest scoring match for the given symbol query.
Escape controls diagnostics about escape choices.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FullyQualifiedSymbols is fully qualified symbols, i.e.
No description provided by the author
Go is a normal go source file.
Inline controls diagnostics about inlining choices.
No description provided by the author
No description provided by the author
No description provided by the author
LoadWorkspace is for packages.Load, and other operations that should consider the whole workspace at once.
Mod is a go.mod file.
In DegradeClosed mode, `gopls` will collect less information about packages without open files.
No description provided by the author
No description provided by the author
NarrowestPackage picks the "narrowest" package for a given file.
Nil controls nil checks.
No description provided by the author
Normal is appropriate for commands that might be run by a user and don't deliberately modify go.mod files, e.g.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PackageQualifiedSymbols is package qualified symbols i.e.
No description provided by the author
ParseExported specifies that the package is used only as a dependency, and only its exported declarations are needed.
ParseFull specifies the full AST is needed.
ParseHeader specifies that the main package declaration and imports are needed.
No description provided by the author
No description provided by the author
Structured is an experimental setting that returns a structured hover format.
Sum is a go.sum file.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Tmpl is a template file.
TypecheckAll means ParseFull for workspace packages, and both Full and Exported for others.
TypecheckFull means to use ParseFull.
Invalid default value.
TypecheckWorkspace means to use ParseFull for workspace packages, and ParseExported for others.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UnknownKind is a file type we don't know about.
UpdateUserModFile is for commands that intend to update the user's real go.mod file, e.g.
No description provided by the author
WidestPackage returns the Package containing the most files.
WriteTemporaryModFile is for commands that need information from a modified version of the user's go.mod file, e.g.

# Variables

ErrNoIdentFound is error returned when no identifer is found at a particular position.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Analyzer represents a go/analysis analyzer with some boolean properties that let the user know how to use the analyzer.
No description provided by the author
No description provided by the author
No description provided by the author
ClientOptions holds LSP-specific configuration that is provided by the client.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
An Diagnostic corresponds to an LSP Diagnostic.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FileIdentity uniquely identifies a file at a version from a FileSystem.
FileModification represents a modification to a file.
FoldingRangeInfo holds range and kind info of folding for an ast.Node.
No description provided by the author
Hooks contains configuration that is provided to the Gopls command by the main package.
No description provided by the author
IdentifierInfo holds information about an identifier in Go source.
No description provided by the author
InternalOptions contains settings that are not intended for use by the average user.
No description provided by the author
MappedRange provides mapped protocol.Range for a span.Range, accounting for UTF-16 code points.
No description provided by the author
No description provided by the author
No description provided by the author
Options holds various configuration that affects Gopls execution, organized by the nature or origin of the settings.
A ParsedGoFile contains the results of parsing a Go file.
A ParsedModule contains the results of parsing a go.mod file.
No description provided by the author
ReferenceInfo holds information about reference to an identifier in Go source.
No description provided by the author
ServerOptions holds LSP-specific configuration that is provided by the server.
No description provided by the author
Symbol holds a precomputed symbol value.
A TidiedModule contains the results of running `go mod tidy` on a module.
No description provided by the author
UserOptions holds custom Gopls configuration (not part of the LSP) that is modified by the client.
No description provided by the author

# Interfaces

FileHandle represents a handle to a specific version of a single file.
A FileSource maps uris to FileHandles.
Metadata represents package metadata retrieved from go/packages.
Overlay is the type for a file held in memory on a session.
Package represents a Go package that has been type-checked.
Session represents a single connection from a client.
Snapshot represents the current state for the given view.
No description provided by the author
View represents a single workspace.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
FileKind describes the kind of the file in question.
No description provided by the author
No description provided by the author
InvocationFlags represents the settings of a particular go command invocation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PackageFilter sets how a package is filtered out from a set of packages containing a given file.
ParseMode controls the content of the AST produced when parsing a source file.
SuggestedFixFunc is a function used to get the suggested fixes for a given gopls command, some of which are provided by go/analysis.Analyzers.
No description provided by the author
No description provided by the author
TypecheckMode controls what kind of parsing should be done (see ParseMode) while type checking a package.