Skip to content

Commit 4077921

Browse files
kortschakpjweinbgo
authored andcommitted
all: fix spelling
Change-Id: I13cf73d7e043dda1a06c28bb09e413a76a68df1f Reviewed-on: https://go-review.googlesource.com/c/tools/+/391934 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
1 parent ff66cbe commit 4077921

File tree

28 files changed

+37
-37
lines changed

28 files changed

+37
-37
lines changed

cmd/splitdwarf/splitdwarf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ for input_exe need to allow writing.
9494
// IndSym Offset = file offset (within link edit section) of 4-byte indices within symtab.
9595
//
9696
// Section __TEXT.__symbol_stub1.
97-
// Offset and size (Reserved2) locate and describe a table for thios section.
97+
// Offset and size (Reserved2) locate and describe a table for this section.
9898
// Symbols beginning at IndirectSymIndex (Reserved1) (see LC_DYSYMTAB.IndSymOffset) refer to this table.
9999
// (These table entries are apparently PLTs [Procedure Linkage Table/Trampoline])
100100
//

go/analysis/internal/checker/checker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ func codeFact(fact analysis.Fact) (analysis.Fact, error) {
826826

827827
// exportedFrom reports whether obj may be visible to a package that imports pkg.
828828
// This includes not just the exported members of pkg, but also unexported
829-
// constants, types, fields, and methods, perhaps belonging to oether packages,
829+
// constants, types, fields, and methods, perhaps belonging to other packages,
830830
// that find there way into the API.
831831
// This is an overapproximation of the more accurate approach used by
832832
// gc export data, which walks the type graph, but it's much simpler.

go/analysis/passes/sigchanyzer/sigchanyzer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
5050
}
5151
case *ast.CallExpr:
5252
// Only signal.Notify(make(chan os.Signal), os.Interrupt) is safe,
53-
// conservatively treate others as not safe, see golang/go#45043
53+
// conservatively treat others as not safe, see golang/go#45043
5454
if isBuiltinMake(pass.TypesInfo, arg) {
5555
return
5656
}

go/pointer/analysis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ type object struct {
5959
//
6060
// ssa.Value for an object allocated by an SSA operation.
6161
// types.Type for an rtype instance object or *rtype-tagged object.
62-
// string for an instrinsic object, e.g. the array behind os.Args.
63-
// nil for an object allocated by an instrinsic.
62+
// string for an intrinsic object, e.g. the array behind os.Args.
63+
// nil for an object allocated by an intrinsic.
6464
// (cgn provides the identity of the intrinsic.)
6565
data interface{}
6666

internal/event/export/trace.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (s *SpanContext) Format(f fmt.State, r rune) {
9090
}
9191

9292
func (s *Span) Start() core.Event {
93-
// start never changes after construction, so we dont need to hold the mutex
93+
// start never changes after construction, so we don't need to hold the mutex
9494
return s.start
9595
}
9696

internal/jsonrpc2/wire.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var (
3333
ErrServerOverloaded = NewError(-32000, "JSON RPC overloaded")
3434
)
3535

36-
// wireRequest is sent to a server to represent a Call or Notify operaton.
36+
// wireRequest is sent to a server to represent a Call or Notify operation.
3737
type wireRequest struct {
3838
// VersionTag is always encoded as the string "2.0"
3939
VersionTag wireVersionTag `json:"jsonrpc"`

internal/jsonrpc2_v2/net.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (n *netDialer) Dial(ctx context.Context) (io.ReadWriteCloser, error) {
8181
}
8282

8383
// NetPipeListener returns a new Listener that listens using net.Pipe.
84-
// It is only possibly to connect to it using the Dialier returned by the
84+
// It is only possibly to connect to it using the Dialer returned by the
8585
// Dialer method, each call to that method will generate a new pipe the other
8686
// side of which will be returned from the Accept call.
8787
func NetPipeListener(ctx context.Context) (Listener, error) {

internal/lsp/analysis/fillreturns/fillreturns.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ outer:
188188
if !ok {
189189
return nil, fmt.Errorf("invalid return type: %v", retTyp)
190190
}
191-
// Find the identifer whose name is most similar to the return type.
192-
// If we do not find any identifer that matches the pattern,
191+
// Find the identifier whose name is most similar to the return type.
192+
// If we do not find any identifier that matches the pattern,
193193
// generate a zero value.
194194
value := analysisinternal.FindBestMatch(retTyp.String(), idents)
195195
if value == nil {

internal/lsp/analysis/fillstruct/fillstruct.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ func SuggestedFix(fset *token.FileSet, rng span.Range, content []byte, file *ast
251251
return nil, fmt.Errorf("invalid struct field type: %v", fieldTyp)
252252
}
253253

254-
// Find the identifer whose name is most similar to the name of the field's key.
255-
// If we do not find any identifer that matches the pattern, generate a new value.
254+
// Find the identifier whose name is most similar to the name of the field's key.
255+
// If we do not find any identifier that matches the pattern, generate a new value.
256256
// NOTE: We currently match on the name of the field key rather than the field type.
257257
value := analysisinternal.FindBestMatch(obj.Field(i).Name(), idents)
258258
if value == nil {

internal/lsp/cache/analysis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func runAnalysis(ctx context.Context, snapshot *snapshot, analyzer *analysis.Ana
367367

368368
// exportedFrom reports whether obj may be visible to a package that imports pkg.
369369
// This includes not just the exported members of pkg, but also unexported
370-
// constants, types, fields, and methods, perhaps belonging to oether packages,
370+
// constants, types, fields, and methods, perhaps belonging to other packages,
371371
// that find there way into the API.
372372
// This is an overapproximation of the more accurate approach used by
373373
// gc export data, which walks the type graph, but it's much simpler.

internal/lsp/cache/load.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ func getWorkspaceDir(ctx context.Context, h *memoize.Handle, g *memoize.Generati
364364
}
365365

366366
// setMetadataLocked extracts metadata from pkg and records it in s. It
367-
// recurses through pkg.Imports to ensure that metadata exists for all
367+
// recurs through pkg.Imports to ensure that metadata exists for all
368368
// dependencies.
369369
func (s *snapshot) setMetadataLocked(ctx context.Context, pkgPath PackagePath, pkg *packages.Package, cfg *packages.Config, query []string, seen map[PackageID]struct{}) (*Metadata, error) {
370370
id := PackageID(pkg.ID)

internal/lsp/cache/workspace.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func (w *workspace) dirs(ctx context.Context, fs source.FileSource) []span.URI {
272272
// reload of metadata (for example, unsaved changes to a go.mod or go.sum
273273
// file).
274274
func (w *workspace) invalidate(ctx context.Context, changes map[span.URI]*fileChange, fs source.FileSource) (_ *workspace, changed, reload bool) {
275-
// Prevent races to w.modFile or w.wsDirs below, if wmhas not yet been built.
275+
// Prevent races to w.modFile or w.wsDirs below, if w has not yet been built.
276276
w.buildMu.Lock()
277277
defer w.buildMu.Unlock()
278278

internal/lsp/lsprpc/lsprpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func (f *Forwarder) handler(handler jsonrpc2.Handler) jsonrpc2.Handler {
319319
// any environment variables output by `go env` and not already present in the
320320
// request.
321321
//
322-
// It returns an error if r is not an initialize requst, or is otherwise
322+
// It returns an error if r is not an initialize request, or is otherwise
323323
// malformed.
324324
func addGoEnvToInitializeRequest(ctx context.Context, r jsonrpc2.Request) (jsonrpc2.Request, error) {
325325
var params protocol.ParamInitialize

internal/lsp/regtest/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// are conditions that we expect to be met (or not to be met) at some point
2727
// after performing the interactions in the test. This is necessary because the
2828
// LSP is by construction asynchronous: both client and server can send
29-
// eachother notifications without formal acknowledgement that they have been
29+
// each other notifications without formal acknowledgement that they have been
3030
// fully processed.
3131
//
3232
// Simple Expectations may be combined to match specific conditions reported by

internal/lsp/regtest/expectation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (e SimpleExpectation) Check(s State) Verdict {
7272
return e.check(s)
7373
}
7474

75-
// Description returns e.descriptin.
75+
// Description returns e.description.
7676
func (e SimpleExpectation) Description() string {
7777
return e.description
7878
}

internal/lsp/source/call_hierarchy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func collectCallExpressions(fset *token.FileSet, mapper *protocol.ColumnMapper,
253253
// Calls to the same function are assigned to the same declaration.
254254
func toProtocolOutgoingCalls(ctx context.Context, snapshot Snapshot, fh FileHandle, callRanges []protocol.Range) ([]protocol.CallHierarchyOutgoingCall, error) {
255255
// Multiple calls could be made to the same function, defined by "same declaration
256-
// AST node & same idenfitier name" to provide a unique identifier key even when
256+
// AST node & same identifier name" to provide a unique identifier key even when
257257
// the func is declared in a struct or interface.
258258
type key struct {
259259
decl ast.Node

internal/lsp/source/completion/completion.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ type candidate struct {
372372
pathInvokeMask uint16
373373

374374
// mods contains modifications that should be applied to the
375-
// candidate when inserted. For example, "foo" may be insterted as
375+
// candidate when inserted. For example, "foo" may be inserted as
376376
// "*foo" or "foo()".
377377
mods []typeModKind
378378

@@ -654,7 +654,7 @@ func (c *completer) collectCompletions(ctx context.Context) error {
654654
// synthesizes an *ast.Ident to allow completion in the face of
655655
// certain syntax errors.
656656
func (c *completer) containingIdent(src []byte) *ast.Ident {
657-
// In the normal case, our leaf AST node is the identifer being completed.
657+
// In the normal case, our leaf AST node is the identifier being completed.
658658
if ident, ok := c.path[0].(*ast.Ident); ok {
659659
return ident
660660
}
@@ -1981,7 +1981,7 @@ Nodes:
19811981
inf.assignees = append(inf.assignees, c.pkg.GetTypesInfo().TypeOf(lhs))
19821982
}
19831983
} else {
1984-
// Otherwse, record our single assignee, even if its type is
1984+
// Otherwise, record our single assignee, even if its type is
19851985
// not available. We use this info to downrank functions
19861986
// with the wrong number of result values.
19871987
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
27712771
}
27722772

27732773
// Don't prefer completing into func(...interface{}) calls since all
2774-
// functions wouuld match.
2774+
// functions would match.
27752775
if ci.variadicAssignees && len(ci.assignees) == 1 && isEmptyInterface(deslice(ci.assignees[0])) {
27762776
return false
27772777
}

internal/lsp/source/completion/deep_completion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const MaxDeepCompletions = 3
1919
// "deep completion" refers to searching into objects' fields and methods to
2020
// find more completion candidates.
2121
type deepCompletionState struct {
22-
// enabled indicates wether deep completion is permitted.
22+
// enabled indicates whether deep completion is permitted.
2323
enabled bool
2424

2525
// queueClosed is used to disable adding new sub-fields to search queue

internal/lsp/source/completion/printf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func parsePrintfVerb(f string, prevIdx int) (string, []formatOperand) {
156156
case 'w':
157157
addVerb(kindError)
158158
case '+', '-', '#', ' ', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
159-
// Flag or numeric width/precicision value.
159+
// Flag or numeric width/precision value.
160160
continue
161161
default:
162162
// Assume unrecognized rune is a custom fmt.Formatter verb.

internal/lsp/source/extract.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func calculateIndentation(content []byte, tok *token.File, insertBeforeStmt ast.
145145
return string(content[lineOffset:stmtOffset]), nil
146146
}
147147

148-
// generateAvailableIdentifier adjusts the new function name until there are no collisons in scope.
148+
// generateAvailableIdentifier adjusts the new function name until there are no collisions in scope.
149149
// Possible collisions include other function and variable names. Returns the next index to check for prefix.
150150
func generateAvailableIdentifier(pos token.Pos, file *ast.File, path []ast.Node, info *types.Info, prefix string, idx int) (string, int) {
151151
scopes := CollectScopes(info, path, pos)
@@ -290,7 +290,7 @@ func extractFunctionMethod(fset *token.FileSet, rng span.Range, src []byte, file
290290
uninitialized []types.Object // vars we will need to initialize before the call
291291
)
292292

293-
// Avoid duplicates while traversing vars and uninitialzed.
293+
// Avoid duplicates while traversing vars and uninitialized.
294294
seenVars := make(map[types.Object]ast.Expr)
295295
seenUninitialized := make(map[types.Object]struct{})
296296

@@ -523,7 +523,7 @@ func extractFunctionMethod(fset *token.FileSet, rng span.Range, src []byte, file
523523

524524
// Construct the appropriate call to the extracted function.
525525
// We must meet two conditions to use ":=" instead of '='. (1) there must be at least
526-
// one variable on the lhs that is uninitailized (non-free) prior to the assignment.
526+
// one variable on the lhs that is uninitialized (non-free) prior to the assignment.
527527
// (2) all of the initialized (free) variables on the lhs must be able to be redefined.
528528
sym := token.ASSIGN
529529
canDefineCount := len(uninitialized) + canRedefineCount
@@ -567,7 +567,7 @@ func extractFunctionMethod(fset *token.FileSet, rng span.Range, src []byte, file
567567

568568
// Create variable declarations for any identifiers that need to be initialized prior to
569569
// calling the extracted function. We do not manually initialize variables if every return
570-
// value is unitialized. We can use := to initialize the variables in this situation.
570+
// value is uninitialized. We can use := to initialize the variables in this situation.
571571
var declarations []ast.Stmt
572572
if canDefineCount != len(returns) {
573573
declarations = initializeVars(uninitialized, retVars, seenUninitialized, seenVars)

internal/lsp/source/highlight.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Outer:
136136
// If cursor is in a key: value expr, we don't want control flow highlighting
137137
return
138138
case *ast.CallExpr:
139-
// If cusor is an arg in a callExpr, we don't want control flow highlighting.
139+
// If cursor is an arg in a callExpr, we don't want control flow highlighting.
140140
if i > 0 {
141141
for _, arg := range node.Args {
142142
if arg == path[i-1] {

internal/lsp/source/identifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func Identifier(ctx context.Context, snapshot Snapshot, fh FileHandle, pos proto
116116
return nil, findErr
117117
}
118118

119-
// ErrNoIdentFound is error returned when no identifer is found at a particular position
119+
// ErrNoIdentFound is error returned when no identifier is found at a particular position
120120
var ErrNoIdentFound = errors.New("no identifier found")
121121

122122
func findIdentifier(ctx context.Context, snapshot Snapshot, pkg Package, pgf *ParsedGoFile, pos token.Pos) (*IdentifierInfo, error) {

internal/lsp/source/known_packages.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func KnownPackages(ctx context.Context, snapshot Snapshot, fh VersionedFileHandl
8484
}, "", pgf.URI.Filename(), pkg.GetTypes().Name(), o.Env)
8585
})
8686
if err != nil {
87-
// if an error occurred, we stil have a decent list we can
87+
// if an error occurred, we still have a decent list we can
8888
// show to the user through snapshot.CachedImportPaths
8989
event.Error(ctx, "imports.GetAllCandidates", err)
9090
}

internal/lsp/source/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ func (o *Options) ForClientCapabilities(caps protocol.ClientCapabilities) {
690690

691691
// Check if the client supports diagnostic related information.
692692
o.RelatedInformationSupported = caps.TextDocument.PublishDiagnostics.RelatedInformation
693-
// Check if the client completion support incliudes tags (preferred) or deprecation
693+
// Check if the client completion support includes tags (preferred) or deprecation
694694
if caps.TextDocument.Completion.CompletionItem.TagSupport.ValueSet != nil {
695695
o.CompletionTags = true
696696
} else if caps.TextDocument.Completion.CompletionItem.DeprecatedSupport {

internal/lsp/source/rename.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type renamer struct {
3232
errors string
3333
from, to string
3434
satisfyConstraints map[satisfy.Constraint]bool
35-
packages map[*types.Package]Package // may include additional packages that are a rdep of pkg
35+
packages map[*types.Package]Package // may include additional packages that are a dep of pkg
3636
msets typeutil.MethodSetCache
3737
changeMethods bool
3838
}

internal/lsp/source/view.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ var (
677677
// The major version is not included, as that depends on the module path.
678678
//
679679
// If workspace module A is dependent on workspace module B, we need our
680-
// nonexistant version to be greater than the version A mentions.
680+
// nonexistent version to be greater than the version A mentions.
681681
// Otherwise, the go command will try to update to that version. Use a very
682682
// high minor version to make that more likely.
683683
const workspaceModuleVersion = ".9999999.0-goplsworkspace"

internal/lsp/template/implementations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func Diagnose(f source.VersionedFileHandle) []*source.Diagnostic {
7171

7272
// Definition finds the definitions of the symbol at loc. It
7373
// does not understand scoping (if any) in templates. This code is
74-
// for defintions, type definitions, and implementations.
74+
// for definitions, type definitions, and implementations.
7575
// Results only for variables and templates.
7676
func Definition(snapshot source.Snapshot, fh source.VersionedFileHandle, loc protocol.Position) ([]protocol.Location, error) {
7777
x, _, err := symAtPosition(fh, loc)

internal/lsp/template/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package template
99
// this may be a bad choice for projects with lots of template files.
1010

1111
// This file contains the parsing code, some debugging printing, and
12-
// implementations for Diagnose, Definition, HJover, References
12+
// implementations for Diagnose, Definition, Hover, References
1313

1414
import (
1515
"bytes"

0 commit comments

Comments
 (0)