mirror of https://github.com/golang/go.git
all: fix spelling
Change-Id: I13cf73d7e043dda1a06c28bb09e413a76a68df1f Reviewed-on: https://go-review.googlesource.com/c/tools/+/391934 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
parent
ff66cbef33
commit
4077921f14
|
|
@ -94,7 +94,7 @@ for input_exe need to allow writing.
|
|||
// IndSym Offset = file offset (within link edit section) of 4-byte indices within symtab.
|
||||
//
|
||||
// Section __TEXT.__symbol_stub1.
|
||||
// Offset and size (Reserved2) locate and describe a table for thios section.
|
||||
// Offset and size (Reserved2) locate and describe a table for this section.
|
||||
// Symbols beginning at IndirectSymIndex (Reserved1) (see LC_DYSYMTAB.IndSymOffset) refer to this table.
|
||||
// (These table entries are apparently PLTs [Procedure Linkage Table/Trampoline])
|
||||
//
|
||||
|
|
|
|||
|
|
@ -826,7 +826,7 @@ func codeFact(fact analysis.Fact) (analysis.Fact, error) {
|
|||
|
||||
// exportedFrom reports whether obj may be visible to a package that imports pkg.
|
||||
// This includes not just the exported members of pkg, but also unexported
|
||||
// constants, types, fields, and methods, perhaps belonging to oether packages,
|
||||
// constants, types, fields, and methods, perhaps belonging to other packages,
|
||||
// that find there way into the API.
|
||||
// This is an overapproximation of the more accurate approach used by
|
||||
// gc export data, which walks the type graph, but it's much simpler.
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
|
|||
}
|
||||
case *ast.CallExpr:
|
||||
// Only signal.Notify(make(chan os.Signal), os.Interrupt) is safe,
|
||||
// conservatively treate others as not safe, see golang/go#45043
|
||||
// conservatively treat others as not safe, see golang/go#45043
|
||||
if isBuiltinMake(pass.TypesInfo, arg) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ type object struct {
|
|||
//
|
||||
// ssa.Value for an object allocated by an SSA operation.
|
||||
// types.Type for an rtype instance object or *rtype-tagged object.
|
||||
// string for an instrinsic object, e.g. the array behind os.Args.
|
||||
// nil for an object allocated by an instrinsic.
|
||||
// string for an intrinsic object, e.g. the array behind os.Args.
|
||||
// nil for an object allocated by an intrinsic.
|
||||
// (cgn provides the identity of the intrinsic.)
|
||||
data interface{}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ func (s *SpanContext) Format(f fmt.State, r rune) {
|
|||
}
|
||||
|
||||
func (s *Span) Start() core.Event {
|
||||
// start never changes after construction, so we dont need to hold the mutex
|
||||
// start never changes after construction, so we don't need to hold the mutex
|
||||
return s.start
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ var (
|
|||
ErrServerOverloaded = NewError(-32000, "JSON RPC overloaded")
|
||||
)
|
||||
|
||||
// wireRequest is sent to a server to represent a Call or Notify operaton.
|
||||
// wireRequest is sent to a server to represent a Call or Notify operation.
|
||||
type wireRequest struct {
|
||||
// VersionTag is always encoded as the string "2.0"
|
||||
VersionTag wireVersionTag `json:"jsonrpc"`
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ func (n *netDialer) Dial(ctx context.Context) (io.ReadWriteCloser, error) {
|
|||
}
|
||||
|
||||
// NetPipeListener returns a new Listener that listens using net.Pipe.
|
||||
// It is only possibly to connect to it using the Dialier returned by the
|
||||
// It is only possibly to connect to it using the Dialer returned by the
|
||||
// Dialer method, each call to that method will generate a new pipe the other
|
||||
// side of which will be returned from the Accept call.
|
||||
func NetPipeListener(ctx context.Context) (Listener, error) {
|
||||
|
|
|
|||
|
|
@ -188,8 +188,8 @@ outer:
|
|||
if !ok {
|
||||
return nil, fmt.Errorf("invalid return type: %v", retTyp)
|
||||
}
|
||||
// Find the identifer whose name is most similar to the return type.
|
||||
// If we do not find any identifer that matches the pattern,
|
||||
// Find the identifier whose name is most similar to the return type.
|
||||
// If we do not find any identifier that matches the pattern,
|
||||
// generate a zero value.
|
||||
value := analysisinternal.FindBestMatch(retTyp.String(), idents)
|
||||
if value == nil {
|
||||
|
|
|
|||
|
|
@ -251,8 +251,8 @@ func SuggestedFix(fset *token.FileSet, rng span.Range, content []byte, file *ast
|
|||
return nil, fmt.Errorf("invalid struct field type: %v", fieldTyp)
|
||||
}
|
||||
|
||||
// Find the identifer whose name is most similar to the name of the field's key.
|
||||
// If we do not find any identifer that matches the pattern, generate a new value.
|
||||
// Find the identifier whose name is most similar to the name of the field's key.
|
||||
// If we do not find any identifier that matches the pattern, generate a new value.
|
||||
// NOTE: We currently match on the name of the field key rather than the field type.
|
||||
value := analysisinternal.FindBestMatch(obj.Field(i).Name(), idents)
|
||||
if value == nil {
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ func runAnalysis(ctx context.Context, snapshot *snapshot, analyzer *analysis.Ana
|
|||
|
||||
// exportedFrom reports whether obj may be visible to a package that imports pkg.
|
||||
// This includes not just the exported members of pkg, but also unexported
|
||||
// constants, types, fields, and methods, perhaps belonging to oether packages,
|
||||
// constants, types, fields, and methods, perhaps belonging to other packages,
|
||||
// that find there way into the API.
|
||||
// This is an overapproximation of the more accurate approach used by
|
||||
// gc export data, which walks the type graph, but it's much simpler.
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ func getWorkspaceDir(ctx context.Context, h *memoize.Handle, g *memoize.Generati
|
|||
}
|
||||
|
||||
// setMetadataLocked extracts metadata from pkg and records it in s. It
|
||||
// recurses through pkg.Imports to ensure that metadata exists for all
|
||||
// recurs through pkg.Imports to ensure that metadata exists for all
|
||||
// dependencies.
|
||||
func (s *snapshot) setMetadataLocked(ctx context.Context, pkgPath PackagePath, pkg *packages.Package, cfg *packages.Config, query []string, seen map[PackageID]struct{}) (*Metadata, error) {
|
||||
id := PackageID(pkg.ID)
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ func (w *workspace) dirs(ctx context.Context, fs source.FileSource) []span.URI {
|
|||
// reload of metadata (for example, unsaved changes to a go.mod or go.sum
|
||||
// file).
|
||||
func (w *workspace) invalidate(ctx context.Context, changes map[span.URI]*fileChange, fs source.FileSource) (_ *workspace, changed, reload bool) {
|
||||
// Prevent races to w.modFile or w.wsDirs below, if wmhas not yet been built.
|
||||
// Prevent races to w.modFile or w.wsDirs below, if w has not yet been built.
|
||||
w.buildMu.Lock()
|
||||
defer w.buildMu.Unlock()
|
||||
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ func (f *Forwarder) handler(handler jsonrpc2.Handler) jsonrpc2.Handler {
|
|||
// any environment variables output by `go env` and not already present in the
|
||||
// request.
|
||||
//
|
||||
// It returns an error if r is not an initialize requst, or is otherwise
|
||||
// It returns an error if r is not an initialize request, or is otherwise
|
||||
// malformed.
|
||||
func addGoEnvToInitializeRequest(ctx context.Context, r jsonrpc2.Request) (jsonrpc2.Request, error) {
|
||||
var params protocol.ParamInitialize
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
// are conditions that we expect to be met (or not to be met) at some point
|
||||
// after performing the interactions in the test. This is necessary because the
|
||||
// LSP is by construction asynchronous: both client and server can send
|
||||
// eachother notifications without formal acknowledgement that they have been
|
||||
// each other notifications without formal acknowledgement that they have been
|
||||
// fully processed.
|
||||
//
|
||||
// Simple Expectations may be combined to match specific conditions reported by
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ func (e SimpleExpectation) Check(s State) Verdict {
|
|||
return e.check(s)
|
||||
}
|
||||
|
||||
// Description returns e.descriptin.
|
||||
// Description returns e.description.
|
||||
func (e SimpleExpectation) Description() string {
|
||||
return e.description
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ func collectCallExpressions(fset *token.FileSet, mapper *protocol.ColumnMapper,
|
|||
// Calls to the same function are assigned to the same declaration.
|
||||
func toProtocolOutgoingCalls(ctx context.Context, snapshot Snapshot, fh FileHandle, callRanges []protocol.Range) ([]protocol.CallHierarchyOutgoingCall, error) {
|
||||
// Multiple calls could be made to the same function, defined by "same declaration
|
||||
// AST node & same idenfitier name" to provide a unique identifier key even when
|
||||
// AST node & same identifier name" to provide a unique identifier key even when
|
||||
// the func is declared in a struct or interface.
|
||||
type key struct {
|
||||
decl ast.Node
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ type candidate struct {
|
|||
pathInvokeMask uint16
|
||||
|
||||
// mods contains modifications that should be applied to the
|
||||
// candidate when inserted. For example, "foo" may be insterted as
|
||||
// candidate when inserted. For example, "foo" may be inserted as
|
||||
// "*foo" or "foo()".
|
||||
mods []typeModKind
|
||||
|
||||
|
|
@ -654,7 +654,7 @@ func (c *completer) collectCompletions(ctx context.Context) error {
|
|||
// synthesizes an *ast.Ident to allow completion in the face of
|
||||
// certain syntax errors.
|
||||
func (c *completer) containingIdent(src []byte) *ast.Ident {
|
||||
// In the normal case, our leaf AST node is the identifer being completed.
|
||||
// In the normal case, our leaf AST node is the identifier being completed.
|
||||
if ident, ok := c.path[0].(*ast.Ident); ok {
|
||||
return ident
|
||||
}
|
||||
|
|
@ -1981,7 +1981,7 @@ Nodes:
|
|||
inf.assignees = append(inf.assignees, c.pkg.GetTypesInfo().TypeOf(lhs))
|
||||
}
|
||||
} else {
|
||||
// Otherwse, record our single assignee, even if its type is
|
||||
// Otherwise, record our single assignee, even if its type is
|
||||
// not available. We use this info to downrank functions
|
||||
// with the wrong number of result values.
|
||||
inf.assignees = append(inf.assignees, c.pkg.GetTypesInfo().TypeOf(node.Lhs[i]))
|
||||
|
|
@ -2771,7 +2771,7 @@ func (ci *candidateInference) assigneesMatch(cand *candidate, sig *types.Signatu
|
|||
}
|
||||
|
||||
// Don't prefer completing into func(...interface{}) calls since all
|
||||
// functions wouuld match.
|
||||
// functions would match.
|
||||
if ci.variadicAssignees && len(ci.assignees) == 1 && isEmptyInterface(deslice(ci.assignees[0])) {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const MaxDeepCompletions = 3
|
|||
// "deep completion" refers to searching into objects' fields and methods to
|
||||
// find more completion candidates.
|
||||
type deepCompletionState struct {
|
||||
// enabled indicates wether deep completion is permitted.
|
||||
// enabled indicates whether deep completion is permitted.
|
||||
enabled bool
|
||||
|
||||
// queueClosed is used to disable adding new sub-fields to search queue
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ func parsePrintfVerb(f string, prevIdx int) (string, []formatOperand) {
|
|||
case 'w':
|
||||
addVerb(kindError)
|
||||
case '+', '-', '#', ' ', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
|
||||
// Flag or numeric width/precicision value.
|
||||
// Flag or numeric width/precision value.
|
||||
continue
|
||||
default:
|
||||
// Assume unrecognized rune is a custom fmt.Formatter verb.
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ func calculateIndentation(content []byte, tok *token.File, insertBeforeStmt ast.
|
|||
return string(content[lineOffset:stmtOffset]), nil
|
||||
}
|
||||
|
||||
// generateAvailableIdentifier adjusts the new function name until there are no collisons in scope.
|
||||
// generateAvailableIdentifier adjusts the new function name until there are no collisions in scope.
|
||||
// Possible collisions include other function and variable names. Returns the next index to check for prefix.
|
||||
func generateAvailableIdentifier(pos token.Pos, file *ast.File, path []ast.Node, info *types.Info, prefix string, idx int) (string, int) {
|
||||
scopes := CollectScopes(info, path, pos)
|
||||
|
|
@ -290,7 +290,7 @@ func extractFunctionMethod(fset *token.FileSet, rng span.Range, src []byte, file
|
|||
uninitialized []types.Object // vars we will need to initialize before the call
|
||||
)
|
||||
|
||||
// Avoid duplicates while traversing vars and uninitialzed.
|
||||
// Avoid duplicates while traversing vars and uninitialized.
|
||||
seenVars := make(map[types.Object]ast.Expr)
|
||||
seenUninitialized := make(map[types.Object]struct{})
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ func extractFunctionMethod(fset *token.FileSet, rng span.Range, src []byte, file
|
|||
|
||||
// Construct the appropriate call to the extracted function.
|
||||
// We must meet two conditions to use ":=" instead of '='. (1) there must be at least
|
||||
// one variable on the lhs that is uninitailized (non-free) prior to the assignment.
|
||||
// one variable on the lhs that is uninitialized (non-free) prior to the assignment.
|
||||
// (2) all of the initialized (free) variables on the lhs must be able to be redefined.
|
||||
sym := token.ASSIGN
|
||||
canDefineCount := len(uninitialized) + canRedefineCount
|
||||
|
|
@ -567,7 +567,7 @@ func extractFunctionMethod(fset *token.FileSet, rng span.Range, src []byte, file
|
|||
|
||||
// Create variable declarations for any identifiers that need to be initialized prior to
|
||||
// calling the extracted function. We do not manually initialize variables if every return
|
||||
// value is unitialized. We can use := to initialize the variables in this situation.
|
||||
// value is uninitialized. We can use := to initialize the variables in this situation.
|
||||
var declarations []ast.Stmt
|
||||
if canDefineCount != len(returns) {
|
||||
declarations = initializeVars(uninitialized, retVars, seenUninitialized, seenVars)
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ Outer:
|
|||
// If cursor is in a key: value expr, we don't want control flow highlighting
|
||||
return
|
||||
case *ast.CallExpr:
|
||||
// If cusor is an arg in a callExpr, we don't want control flow highlighting.
|
||||
// If cursor is an arg in a callExpr, we don't want control flow highlighting.
|
||||
if i > 0 {
|
||||
for _, arg := range node.Args {
|
||||
if arg == path[i-1] {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ func Identifier(ctx context.Context, snapshot Snapshot, fh FileHandle, pos proto
|
|||
return nil, findErr
|
||||
}
|
||||
|
||||
// ErrNoIdentFound is error returned when no identifer is found at a particular position
|
||||
// ErrNoIdentFound is error returned when no identifier is found at a particular position
|
||||
var ErrNoIdentFound = errors.New("no identifier found")
|
||||
|
||||
func findIdentifier(ctx context.Context, snapshot Snapshot, pkg Package, pgf *ParsedGoFile, pos token.Pos) (*IdentifierInfo, error) {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ func KnownPackages(ctx context.Context, snapshot Snapshot, fh VersionedFileHandl
|
|||
}, "", pgf.URI.Filename(), pkg.GetTypes().Name(), o.Env)
|
||||
})
|
||||
if err != nil {
|
||||
// if an error occurred, we stil have a decent list we can
|
||||
// if an error occurred, we still have a decent list we can
|
||||
// show to the user through snapshot.CachedImportPaths
|
||||
event.Error(ctx, "imports.GetAllCandidates", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@ func (o *Options) ForClientCapabilities(caps protocol.ClientCapabilities) {
|
|||
|
||||
// Check if the client supports diagnostic related information.
|
||||
o.RelatedInformationSupported = caps.TextDocument.PublishDiagnostics.RelatedInformation
|
||||
// Check if the client completion support incliudes tags (preferred) or deprecation
|
||||
// Check if the client completion support includes tags (preferred) or deprecation
|
||||
if caps.TextDocument.Completion.CompletionItem.TagSupport.ValueSet != nil {
|
||||
o.CompletionTags = true
|
||||
} else if caps.TextDocument.Completion.CompletionItem.DeprecatedSupport {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ type renamer struct {
|
|||
errors string
|
||||
from, to string
|
||||
satisfyConstraints map[satisfy.Constraint]bool
|
||||
packages map[*types.Package]Package // may include additional packages that are a rdep of pkg
|
||||
packages map[*types.Package]Package // may include additional packages that are a dep of pkg
|
||||
msets typeutil.MethodSetCache
|
||||
changeMethods bool
|
||||
}
|
||||
|
|
|
|||
|
|
@ -677,7 +677,7 @@ var (
|
|||
// The major version is not included, as that depends on the module path.
|
||||
//
|
||||
// If workspace module A is dependent on workspace module B, we need our
|
||||
// nonexistant version to be greater than the version A mentions.
|
||||
// nonexistent version to be greater than the version A mentions.
|
||||
// Otherwise, the go command will try to update to that version. Use a very
|
||||
// high minor version to make that more likely.
|
||||
const workspaceModuleVersion = ".9999999.0-goplsworkspace"
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ func Diagnose(f source.VersionedFileHandle) []*source.Diagnostic {
|
|||
|
||||
// Definition finds the definitions of the symbol at loc. It
|
||||
// does not understand scoping (if any) in templates. This code is
|
||||
// for defintions, type definitions, and implementations.
|
||||
// for definitions, type definitions, and implementations.
|
||||
// Results only for variables and templates.
|
||||
func Definition(snapshot source.Snapshot, fh source.VersionedFileHandle, loc protocol.Position) ([]protocol.Location, error) {
|
||||
x, _, err := symAtPosition(fh, loc)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ package template
|
|||
// this may be a bad choice for projects with lots of template files.
|
||||
|
||||
// This file contains the parsing code, some debugging printing, and
|
||||
// implementations for Diagnose, Definition, HJover, References
|
||||
// implementations for Diagnose, Definition, Hover, References
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
|
|
|||
Loading…
Reference in New Issue