gotools/gopls/internal/golang/undeclared.go

var undeclaredNamePrefixes

// undeclaredFixTitle generates a code action title for "undeclared name" errors,
// suggesting the creation of the missing variable or function if applicable.
func undeclaredFixTitle(path []ast.Node, errMsg string) string {}

// CreateUndeclared generates a suggested declaration for an undeclared variable or function.
func CreateUndeclared(fset *token.FileSet, start, end token.Pos, content []byte, file *ast.File, pkg *types.Package, info *types.Info) (*token.FileSet, *analysis.SuggestedFix, error) {}

// replaceableAssign returns position of token.ASSIGN if ident meets the following conditions:
// 1) parent node must be an *ast.AssignStmt with Tok set to token.ASSIGN.
// 2) ident must not be self assignment.
//
// For example, we should not add a colon when
// a = a + 1
// ^   ^ cursor here
func replaceableAssign(info *types.Info, ident *ast.Ident, parent ast.Node) (token.Pos, bool) {}

// referencesIdent checks whether the given undefined ident appears in the given expression.
func referencesIdent(info *types.Info, expr ast.Expr, ident *ast.Ident) bool {}

func newFunctionDeclaration(path []ast.Node, file *ast.File, pkg *types.Package, info *types.Info, fset *token.FileSet) (*token.FileSet, *analysis.SuggestedFix, error) {}

func typeToArgName(ty types.Type) string {}

// isCallPosition reports whether the path denotes the subtree in call position, f().
func isCallPosition(path []ast.Node) bool {}