all: fix a few function names on comments

Change-Id: I91eec68ebd9394685a6586c8d0cf01ecf3fd82e2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/441775
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
cui fliter 2022-10-10 20:58:54 +08:00 коммит произвёл Gopher Robot
Родитель 350f1e2c0a
Коммит f90d8ad46c
14 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -207,7 +207,7 @@ func pkgContainsFile(bp *build.Package, filename string) byte {
return 0 // not found
}
// ParseQueryPos parses the source query position pos and returns the
// parseQueryPos parses the source query position pos and returns the
// AST node of the loaded program lprog that it identifies.
// If needExact, it must identify a single AST subtree;
// this is appropriate for queries that allow fairly arbitrary syntax,

Просмотреть файл

@ -80,7 +80,7 @@ func ContainingPackage(ctxt *build.Context, dir, filename string) (*build.Packag
// (go/build.Context defines these as methods, but does not export them.)
// hasSubdir calls ctxt.HasSubdir (if not nil) or else uses
// HasSubdir calls ctxt.HasSubdir (if not nil) or else uses
// the local file system to answer the question.
func HasSubdir(ctxt *build.Context, root, dir string) (rel string, ok bool) {
if f := ctxt.HasSubdir; f != nil {

Просмотреть файл

@ -303,7 +303,7 @@ func sanityCheckDomTree(f *Function) {
// Printing functions ----------------------------------------
// printDomTree prints the dominator tree as text, using indentation.
// printDomTreeText prints the dominator tree as text, using indentation.
func printDomTreeText(buf *bytes.Buffer, v *BasicBlock, indent int) {
fmt.Fprintf(buf, "%*s%s\n", 4*indent, "", v)
for _, child := range v.dom.children {

2
gopls/internal/lsp/cache/load.go поставляемый
Просмотреть файл

@ -616,7 +616,7 @@ func containsOpenFileLocked(s *snapshot, m *KnownMetadata) bool {
return false
}
// containsFileInWorkspace reports whether m contains any file inside the
// containsFileInWorkspaceLocked reports whether m contains any file inside the
// workspace of the snapshot s.
//
// s.mu must be held while calling this function.

Просмотреть файл

@ -118,7 +118,7 @@ func (m *Mapper) Range(start, end int) (protocol.Range, error) {
return protocol.Range{Start: startPos, End: endPos}, nil
}
// UTF16Len returns the UTF-16 length of the UTF-8 encoded content, were it to
// UTF16len returns the UTF-16 length of the UTF-8 encoded content, were it to
// be re-encoded as UTF-16.
func UTF16len(buf []byte) int {
// This function copies buf, but microbenchmarks showed it to be faster than

Просмотреть файл

@ -25,7 +25,7 @@ type TokenMapper struct {
mapper *Mapper
}
// NewMapper creates a new TokenMapper for the given content, using the
// NewTokenMapper creates a new TokenMapper for the given content, using the
// provided file to compute offsets.
func NewTokenMapper(content []byte, file *token.File) *TokenMapper {
return &TokenMapper{

Просмотреть файл

@ -24,7 +24,7 @@ func runRemote(cmd *exec.Cmd) error {
return nil
}
// autoNetworkAddress returns the default network and address for the
// autoNetworkAddressDefault returns the default network and address for the
// automatically-started gopls remote. See autostart_posix.go for more
// information.
func autoNetworkAddressDefault(goplsPath, id string) (network string, address string) {

Просмотреть файл

@ -33,7 +33,7 @@ func daemonizePosix(cmd *exec.Cmd) {
}
}
// autoNetworkAddress resolves an id on the 'auto' pseduo-network to a
// autoNetworkAddressPosix resolves an id on the 'auto' pseduo-network to a
// real network and address. On unix, this uses unix domain sockets.
func autoNetworkAddressPosix(goplsPath, id string) (network string, address string) {
// Especially when doing local development or testing, it's important that

Просмотреть файл

@ -651,7 +651,7 @@ func extractFunctionMethod(fset *token.FileSet, rng span.Range, src []byte, file
}, nil
}
// adjustRangeForCommentsAndWhitespace adjusts the given range to exclude unnecessary leading or
// adjustRangeForCommentsAndWhiteSpace adjusts the given range to exclude unnecessary leading or
// trailing whitespace characters from selection as well as leading or trailing comments.
// In the following example, each line of the if statement is indented once. There are also two
// extra spaces after the sclosing bracket before the line break and a comment.
@ -1119,7 +1119,7 @@ func varOverridden(info *types.Info, firstUse *ast.Ident, obj types.Object, isFr
return isOverriden
}
// parseExtraction generates an AST file from the given text. We then return the portion of the
// parseBlockStmt generates an AST file from the given text. We then return the portion of the
// file that represents the text.
func parseBlockStmt(fset *token.FileSet, src []byte) (*ast.BlockStmt, error) {
text := "package main\nfunc _() { " + string(src) + " }"

Просмотреть файл

@ -354,7 +354,7 @@ func ToProtocolEdits(m *protocol.ColumnMapper, edits []diff.Edit) ([]protocol.Te
return result, nil
}
// ToProtocolEdits converts LSP TextEdits to diff.Edits.
// FromProtocolEdits converts LSP TextEdits to diff.Edits.
// See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textEditArray
func FromProtocolEdits(m *protocol.ColumnMapper, edits []protocol.TextEdit) ([]diff.Edit, error) {
if edits == nil {

Просмотреть файл

@ -276,7 +276,7 @@ func computeImportRenamingEdits(ctx context.Context, s Snapshot, renamingPkg Pac
return result, nil
}
// computeImportRenamingEdits computes all edits to files within the renming packages.
// computePackageNameRenamingEdits computes all edits to files within the renming packages.
func computePackageNameRenamingEdits(renamingPkg Package, newName string) (map[span.URI][]protocol.TextEdit, error) {
result := make(map[span.URI][]protocol.TextEdit)
// Rename internal references to the package in the renaming package.

Просмотреть файл

@ -185,7 +185,7 @@ func isWindowsDrivePath(path string) bool {
return unicode.IsLetter(rune(path[0])) && path[1] == ':'
}
// isWindowsDriveURI returns true if the file URI is of the format used by
// isWindowsDriveURIPath returns true if the file URI is of the format used by
// Windows URIs. The url.Parse package does not specially handle Windows paths
// (see golang/go#6027), so we check if the URI path has a drive prefix (e.g. "/C:").
func isWindowsDriveURIPath(uri string) bool {

Просмотреть файл

@ -91,7 +91,7 @@ func runesLen(runes []rune) (len int) {
return len
}
// isASCII reports whether s contains only ASCII.
// stringIsASCII reports whether s contains only ASCII.
// TODO(adonovan): combine when x/tools allows generics.
func stringIsASCII(s string) bool {
for i := 0; i < len(s); i++ {

Просмотреть файл

@ -18,7 +18,7 @@ import (
// regular expressions. That is the only change to the code from codewalk.go.
// See http://9p.io/sys/doc/sam/sam.html Table II for details on the syntax.
// addrToByte evaluates the given address starting at offset start in data.
// addrToByteRange evaluates the given address starting at offset start in data.
// It returns the lo and hi byte offset of the matched region within data.
func addrToByteRange(addr string, start int, data []byte) (lo, hi int, err error) {
if addr == "" {