80 lines
2.1 KiB
Go
80 lines
2.1 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual getJavaScriptCompletions16"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
. "github.com/microsoft/typescript-go/internal/fourslash/tests/util"
|
|
"github.com/microsoft/typescript-go/internal/lsp/lsproto"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestGetJavaScriptCompletions16(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @allowNonTsExtensions: true
|
|
// @Filename: file.js
|
|
"use strict";
|
|
|
|
class Something {
|
|
|
|
/**
|
|
* @param {number} a
|
|
*/
|
|
constructor(a, b) {
|
|
a/*body*/
|
|
}
|
|
|
|
/**
|
|
* @param {number} a
|
|
*/
|
|
method(a) {
|
|
a/*method*/
|
|
}
|
|
}
|
|
let x = new Something(/*sig*/);`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToMarker(t, "body")
|
|
f.Insert(t, ".")
|
|
f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "toFixed",
|
|
Kind: new(lsproto.CompletionItemKindMethod),
|
|
},
|
|
},
|
|
},
|
|
})
|
|
f.Backspace(t, 1)
|
|
f.GoToMarker(t, "sig")
|
|
f.VerifySignatureHelp(t, fourslash.VerifySignatureHelpOptions{Text: "Something(a: number, b: any): Something"})
|
|
f.GoToMarker(t, "method")
|
|
f.Insert(t, ".")
|
|
f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "toFixed",
|
|
Kind: new(lsproto.CompletionItemKindMethod),
|
|
},
|
|
},
|
|
},
|
|
})
|
|
}
|