Files
kjol/tools/tsgo/internal/fourslash/tests/gen/codeFixUnusedIdentifier_suggestion_test.go
2026-07-09 16:50:43 -04:00

45 lines
1.6 KiB
Go

// Code generated by convertFourslash; DO NOT EDIT.
// To modify this test, run "npm run makemanual codeFixUnusedIdentifier_suggestion"
package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/lsp/lsproto"
"github.com/microsoft/typescript-go/internal/testutil"
)
func TestCodeFixUnusedIdentifier_suggestion(t *testing.T) {
fourslash.SkipIfFailing(t)
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @strict: false
function f([|p|]) {
const [|x|] = 0;
}`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.VerifySuggestionDiagnostics(t, []*lsproto.Diagnostic{
{
Message: lsproto.StringOrMarkupContent{String: new("Parameter 'p' implicitly has an 'any' type, but a better type may be inferred from usage.")},
Range: f.Ranges()[0].LSRange,
Code: &lsproto.IntegerOrString{Integer: new(int32(7044))},
},
{
Message: lsproto.StringOrMarkupContent{String: new("'p' is declared but its value is never read.")},
Range: f.Ranges()[0].LSRange,
Code: &lsproto.IntegerOrString{Integer: new(int32(6133))},
Tags: &[]lsproto.DiagnosticTag{lsproto.DiagnosticTagUnnecessary},
},
{
Message: lsproto.StringOrMarkupContent{String: new("'x' is declared but its value is never read.")},
Range: f.Ranges()[1].LSRange,
Code: &lsproto.IntegerOrString{Integer: new(int32(6133))},
Tags: &[]lsproto.DiagnosticTag{lsproto.DiagnosticTagUnnecessary},
},
})
f.VerifyCodeFixAvailable(t, nil)
}