Skip to content

Conversation

@jakebailey
Copy link
Member

Updates the version, fixes or silences existing issues, then also enables the modernize fixes and fixes them except for the small number of cases I would like to ignore.

Copilot AI review requested due to automatic review settings October 30, 2025 03:16
return false
}

func Some[T any](slice []T, f func(T) bool) bool {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This func arguably shouldn't exist but that's larger diff.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the codebase by adopting newer Go standard library features and patterns introduced in recent Go versions (primarily Go 1.23+). The changes leverage built-in optimizations and cleaner APIs.

Key changes:

  • Adopts sync.WaitGroup.Go() method introduced in Go 1.23 to simplify goroutine spawning patterns
  • Uses strings.Builder for efficient string concatenation instead of repeated string concatenation operations
  • Replaces manual loops with standard library functions like slices.Contains(), slices.ContainsFunc(), maps.Copy(), and strings.CutPrefix/CutSuffix()
  • Migrates to strings.SplitSeq() for iterator-based string splitting
  • Simplifies type checking with reflect.TypeFor[T]()
  • Replaces interface{} with any alias for consistency
  • Updates golangci-lint version and enables the modernize linter

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.golangci.yml Enables the modernize linter to enforce modern Go patterns
.custom-gcl.yml Updates golangci-lint version from v2.5.0 to v2.6.0
internal/vfs/vfstest/vfstest_test.go Adopts WaitGroup.Go() but missing wg.Wait() call
internal/tsoptions/tsconfigparsing_test.go Uses maps.Copy() for map copying
internal/tsoptions/tsconfigparsing.go Replaces runtime type check with compile-time type constant
internal/transformers/estransforms/objectrestspread.go Uses slices.ContainsFunc() for cleaner iteration
internal/testutil/tsbaseline/error_baseline.go Adopts strings.SplitSeq() iterator pattern with impossible condition bug
internal/testutil/harnessutil/harnessutil.go Uses strings.CutPrefix/CutSuffix() for cleaner string trimming
internal/scanner/scanner.go Migrates to strings.Builder for efficient string building
internal/project/background/queue.go Adopts WaitGroup.Go() method
internal/project/ata/validatepackagename_test.go Adds linter exception for intentional string concatenation in test
internal/parser/parser.go Simplifies range loop with modern syntax
internal/module/resolver_test.go Adopts WaitGroup.Go() method
internal/ls/signaturehelp.go Removes custom containsNode() in favor of slices.Contains()
internal/ls/lsutil/userpreferences.go Replaces interface{} with any alias
internal/ls/completions.go Uses strings.CutPrefix() and strings.Builder
internal/glob/glob.go Replaces interface{} with any alias
internal/fourslash/test_parser.go Replaces interface{} with any alias
internal/fourslash/fourslash.go Uses slices.Contains() for cleaner iteration
internal/fourslash/baselineutil.go Replaces interface{} with any alias
internal/execute/tsctests/runner.go Adds linter exception for intentional string concatenation
internal/core/workgroup.go Adopts WaitGroup.Go() method
internal/core/core.go Simplifies conditional logic with max() and adds linter exception
internal/compiler/projectreferenceparser.go Uses maps.Copy() for map copying
internal/compiler/fileloader.go Migrates to strings.Builder for efficient string building
internal/checker/nodebuilderimpl.go Uses slices.Contains() for cleaner iteration
internal/checker/mapper.go Uses slices.Contains() for cleaner iteration
internal/checker/grammarchecks.go Adds linter exception to preserve existing loop pattern
internal/binder/binder.go Adds linter exception to preserve existing loop pattern
internal/ast/ast.go Adds linter exception to preserve existing loop pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants