Skip to content

Commit cc53c33

Browse files
authored
Don't ask for checker immediately in ProvideCodeActions (#2192)
1 parent 7c40d35 commit cc53c33

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

internal/ls/codeactions.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"slices"
66

77
"github.com/microsoft/typescript-go/internal/ast"
8-
"github.com/microsoft/typescript-go/internal/checker"
98
"github.com/microsoft/typescript-go/internal/compiler"
109
"github.com/microsoft/typescript-go/internal/core"
1110
"github.com/microsoft/typescript-go/internal/lsp/lsproto"
@@ -25,7 +24,6 @@ type CodeFixContext struct {
2524
Span core.TextRange
2625
ErrorCode int32
2726
Program *compiler.Program
28-
Checker *checker.Checker
2927
LS *LanguageService
3028
Diagnostic *lsproto.Diagnostic
3129
Params *lsproto.CodeActionParams
@@ -53,12 +51,6 @@ var codeFixProviders = []*CodeFixProvider{
5351
func (l *LanguageService) ProvideCodeActions(ctx context.Context, params *lsproto.CodeActionParams) (lsproto.CodeActionResponse, error) {
5452
program, file := l.getProgramAndFile(params.TextDocument.Uri)
5553

56-
// Get the type checker
57-
ch, done := program.GetTypeCheckerForFile(ctx, file)
58-
if done != nil {
59-
defer done()
60-
}
61-
6254
var actions []lsproto.CommandOrCodeAction
6355

6456
// Process diagnostics in the context to generate quick fixes
@@ -84,7 +76,6 @@ func (l *LanguageService) ProvideCodeActions(ctx context.Context, params *lsprot
8476
Span: core.NewTextRange(int(position), int(endPosition)),
8577
ErrorCode: errorCode,
8678
Program: program,
87-
Checker: ch,
8879
LS: l,
8980
Diagnostic: diag,
9081
Params: params,

0 commit comments

Comments
 (0)