MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getCodeFixActions

Method getCodeFixActions

internal/fourslash/fourslash.go:1919–1930  ·  view source on GitHub ↗

getCodeFixActions gets per-diagnostic quick fix code actions, excluding fix-all entries.

(t *testing.T, errorCode ...int)

Source from the content-addressed store, hash-verified

1917
1918// getCodeFixActions gets per-diagnostic quick fix code actions, excluding fix-all entries.
1919func (f *FourslashTest) getCodeFixActions(t *testing.T, errorCode ...int) []*lsproto.CodeAction {
1920 t.Helper()
1921 all := f.getAllQuickFixActions(t, errorCode...)
1922 // Filter to only per-diagnostic fixes (those with diagnostics attached)
1923 var actions []*lsproto.CodeAction
1924 for _, action := range all {
1925 if action.Diagnostics != nil && len(*action.Diagnostics) > 0 {
1926 actions = append(actions, action)
1927 }
1928 }
1929 return actions
1930}
1931
1932// getAllQuickFixActions gets all quick fix code actions including fix-all entries.
1933func (f *FourslashTest) getAllQuickFixActions(t *testing.T, errorCode ...int) []*lsproto.CodeAction {

Callers 5

VerifyCodeFixMethod · 0.95

Calls 4

getAllQuickFixActionsMethod · 0.95
lenFunction · 0.85
HelperMethod · 0.65
appendFunction · 0.50

Tested by

no test coverage detected