Documentation
¶
Index ¶
- Variables
- type ApplyCodeActionFromCompletionOptions
- type CompletionsExpectedCodeAction
- type CompletionsExpectedItem
- type CompletionsExpectedItemDefaults
- type CompletionsExpectedItems
- type CompletionsExpectedList
- type EditRange
- type ExpectedCompletionEditRange
- type FourslashTest
- func (f *FourslashTest) Backspace(t *testing.T, count int)
- func (f *FourslashTest) BaselineAutoImportsCompletions(t *testing.T, markerNames []string)
- func (f *FourslashTest) Configure(t *testing.T, config *lsutil.UserPreferences)
- func (f *FourslashTest) ConfigureWithReset(t *testing.T, config *lsutil.UserPreferences) (reset func())
- func (f *FourslashTest) GetRangesByText() *collections.MultiMap[string, *RangeMarker]
- func (f *FourslashTest) GoToBOF(t *testing.T)
- func (f *FourslashTest) GoToEOF(t *testing.T)
- func (f *FourslashTest) GoToEachMarker(t *testing.T, markerNames []string, action func(marker *Marker, index int))
- func (f *FourslashTest) GoToEachRange(t *testing.T, action func(t *testing.T, rangeMarker *RangeMarker))
- func (f *FourslashTest) GoToFile(t *testing.T, filename string)
- func (f *FourslashTest) GoToFileNumber(t *testing.T, index int)
- func (f *FourslashTest) GoToMarker(t *testing.T, markerName string)
- func (f *FourslashTest) GoToMarkerOrRange(t *testing.T, markerOrRange MarkerOrRange)
- func (f *FourslashTest) GoToPosition(t *testing.T, position int)
- func (f *FourslashTest) GoToRangeStart(t *testing.T, rangeMarker *RangeMarker)
- func (f *FourslashTest) GoToSelect(t *testing.T, startMarkerName string, endMarkerName string)
- func (f *FourslashTest) GoToSelectRange(t *testing.T, rangeMarker *RangeMarker)
- func (f *FourslashTest) Insert(t *testing.T, text string)
- func (f *FourslashTest) InsertLine(t *testing.T, text string)
- func (f *FourslashTest) MarkerByName(t *testing.T, name string) *Marker
- func (f *FourslashTest) MarkerNames() []string
- func (f *FourslashTest) Markers() []*Marker
- func (f *FourslashTest) Paste(t *testing.T, text string)
- func (f *FourslashTest) Ranges() []*RangeMarker
- func (f *FourslashTest) Replace(t *testing.T, start int, length int, text string)
- func (f *FourslashTest) ReplaceLine(t *testing.T, lineIndex int, text string)
- func (f *FourslashTest) VerifyApplyCodeActionFromCompletion(t *testing.T, markerName *string, ...)
- func (f *FourslashTest) VerifyBaselineDocumentHighlights(t *testing.T, preferences *lsutil.UserPreferences, ...)
- func (f *FourslashTest) VerifyBaselineFindAllReferences(t *testing.T, markers ...string)
- func (f *FourslashTest) VerifyBaselineGoToDefinition(t *testing.T, includeOriginalSelectionRange bool, markers ...string)
- func (f *FourslashTest) VerifyBaselineGoToTypeDefinition(t *testing.T, markers ...string)
- func (f *FourslashTest) VerifyBaselineHover(t *testing.T)
- func (f *FourslashTest) VerifyBaselineInlayHints(t *testing.T, span *lsproto.Range, userPreferences *lsutil.UserPreferences)
- func (f *FourslashTest) VerifyBaselineRename(t *testing.T, preferences *lsutil.UserPreferences, ...)
- func (f *FourslashTest) VerifyBaselineRenameAtRangesWithText(t *testing.T, preferences *lsutil.UserPreferences, texts ...string)
- func (f *FourslashTest) VerifyBaselineSelectionRanges(t *testing.T)
- func (f *FourslashTest) VerifyBaselineSignatureHelp(t *testing.T)
- func (f *FourslashTest) VerifyCompletions(t *testing.T, markerInput MarkerInput, expected *CompletionsExpectedList) VerifyCompletionsResult
- func (f *FourslashTest) VerifyNotQuickInfoExists(t *testing.T)
- func (f *FourslashTest) VerifyQuickInfoAt(t *testing.T, marker string, expectedText string, expectedDocumentation string)
- func (f *FourslashTest) VerifyQuickInfoExists(t *testing.T)
- func (f *FourslashTest) VerifyQuickInfoIs(t *testing.T, expectedText string, expectedDocumentation string)
- func (f *FourslashTest) VerifyRenameFailed(t *testing.T, preferences *lsutil.UserPreferences)
- func (f *FourslashTest) VerifyRenameSucceeded(t *testing.T, preferences *lsutil.UserPreferences)
- func (f *FourslashTest) VerifySignatureHelp(t *testing.T, signatureHelpCases ...*SignatureHelpCase)
- type Ignored
- type Marker
- type MarkerInput
- type MarkerOrRange
- type MarkerOrRangeOrName
- type RangeMarker
- type SignatureHelpCase
- type TestData
- type TestFileInfo
- type VerifyCompletionsResult
Constants ¶
This section is empty.
Variables ¶
View Source
var AnyTextEdits *[]*lsproto.TextEdit
Functions ¶
This section is empty.
Types ¶
type ApplyCodeActionFromCompletionOptions ¶
type ApplyCodeActionFromCompletionOptions struct {
Name string
Source string
AutoImportData *ls.AutoImportData
Description string
NewFileContent *string
NewRangeContent *string
UserPreferences *lsutil.UserPreferences
}
type CompletionsExpectedItemDefaults ¶
type CompletionsExpectedItemDefaults struct {
CommitCharacters *[]string
EditRange ExpectedCompletionEditRange
}
type CompletionsExpectedItems ¶
type CompletionsExpectedItems struct {
Includes []CompletionsExpectedItem
Excludes []string
Exact []CompletionsExpectedItem
Unsorted []CompletionsExpectedItem
}
type CompletionsExpectedList ¶
type CompletionsExpectedList struct {
IsIncomplete bool
ItemDefaults *CompletionsExpectedItemDefaults
Items *CompletionsExpectedItems
UserPreferences *lsutil.UserPreferences // !!! allow user preferences in fourslash
}
type EditRange ¶
type EditRange struct {
Insert *RangeMarker
Replace *RangeMarker
}
type FourslashTest ¶
type FourslashTest struct {
// contains filtered or unexported fields
}
func NewFourslash ¶
func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, content string) *FourslashTest
func (*FourslashTest) Backspace ¶
func (f *FourslashTest) Backspace(t *testing.T, count int)
Removes the text at the current caret position as if the user pressed backspace `count` times.
func (*FourslashTest) BaselineAutoImportsCompletions ¶
func (f *FourslashTest) BaselineAutoImportsCompletions(t *testing.T, markerNames []string)
func (*FourslashTest) Configure ¶
func (f *FourslashTest) Configure(t *testing.T, config *lsutil.UserPreferences)
func (*FourslashTest) ConfigureWithReset ¶
func (f *FourslashTest) ConfigureWithReset(t *testing.T, config *lsutil.UserPreferences) (reset func())
func (*FourslashTest) GetRangesByText ¶
func (f *FourslashTest) GetRangesByText() *collections.MultiMap[string, *RangeMarker]
func (*FourslashTest) GoToBOF ¶
func (f *FourslashTest) GoToBOF(t *testing.T)
func (*FourslashTest) GoToEOF ¶
func (f *FourslashTest) GoToEOF(t *testing.T)
func (*FourslashTest) GoToEachMarker ¶
func (*FourslashTest) GoToEachRange ¶
func (f *FourslashTest) GoToEachRange(t *testing.T, action func(t *testing.T, rangeMarker *RangeMarker))
func (*FourslashTest) GoToFileNumber ¶
func (f *FourslashTest) GoToFileNumber(t *testing.T, index int)
func (*FourslashTest) GoToMarker ¶
func (f *FourslashTest) GoToMarker(t *testing.T, markerName string)
func (*FourslashTest) GoToMarkerOrRange ¶
func (f *FourslashTest) GoToMarkerOrRange(t *testing.T, markerOrRange MarkerOrRange)
func (*FourslashTest) GoToPosition ¶
func (f *FourslashTest) GoToPosition(t *testing.T, position int)
func (*FourslashTest) GoToRangeStart ¶
func (f *FourslashTest) GoToRangeStart(t *testing.T, rangeMarker *RangeMarker)
func (*FourslashTest) GoToSelect ¶
func (f *FourslashTest) GoToSelect(t *testing.T, startMarkerName string, endMarkerName string)
func (*FourslashTest) GoToSelectRange ¶
func (f *FourslashTest) GoToSelectRange(t *testing.T, rangeMarker *RangeMarker)
func (*FourslashTest) Insert ¶
func (f *FourslashTest) Insert(t *testing.T, text string)
Insert text at the current caret position.
func (*FourslashTest) InsertLine ¶
func (f *FourslashTest) InsertLine(t *testing.T, text string)
Insert text and a new line at the current caret position.
func (*FourslashTest) MarkerByName ¶
func (f *FourslashTest) MarkerByName(t *testing.T, name string) *Marker
func (*FourslashTest) MarkerNames ¶
func (f *FourslashTest) MarkerNames() []string
func (*FourslashTest) Markers ¶
func (f *FourslashTest) Markers() []*Marker
func (*FourslashTest) Paste ¶
func (f *FourslashTest) Paste(t *testing.T, text string)
Enters text as if the user had pasted it.
func (*FourslashTest) Ranges ¶
func (f *FourslashTest) Ranges() []*RangeMarker
func (*FourslashTest) ReplaceLine ¶
func (f *FourslashTest) ReplaceLine(t *testing.T, lineIndex int, text string)
Selects a line and replaces it with a new text.
func (*FourslashTest) VerifyApplyCodeActionFromCompletion ¶
func (f *FourslashTest) VerifyApplyCodeActionFromCompletion(t *testing.T, markerName *string, options *ApplyCodeActionFromCompletionOptions)
func (*FourslashTest) VerifyBaselineDocumentHighlights ¶
func (f *FourslashTest) VerifyBaselineDocumentHighlights( t *testing.T, preferences *lsutil.UserPreferences, markerOrRangeOrNames ...MarkerOrRangeOrName, )
func (*FourslashTest) VerifyBaselineFindAllReferences ¶
func (f *FourslashTest) VerifyBaselineFindAllReferences( t *testing.T, markers ...string, )
func (*FourslashTest) VerifyBaselineGoToDefinition ¶
func (f *FourslashTest) VerifyBaselineGoToDefinition( t *testing.T, includeOriginalSelectionRange bool, markers ...string, )
func (*FourslashTest) VerifyBaselineGoToTypeDefinition ¶
func (f *FourslashTest) VerifyBaselineGoToTypeDefinition( t *testing.T, markers ...string, )
func (*FourslashTest) VerifyBaselineHover ¶
func (f *FourslashTest) VerifyBaselineHover(t *testing.T)
func (*FourslashTest) VerifyBaselineInlayHints ¶
func (f *FourslashTest) VerifyBaselineInlayHints( t *testing.T, span *lsproto.Range, userPreferences *lsutil.UserPreferences, )
func (*FourslashTest) VerifyBaselineRename ¶
func (f *FourslashTest) VerifyBaselineRename( t *testing.T, preferences *lsutil.UserPreferences, markerOrNameOrRanges ...MarkerOrRangeOrName, )
func (*FourslashTest) VerifyBaselineRenameAtRangesWithText ¶
func (f *FourslashTest) VerifyBaselineRenameAtRangesWithText( t *testing.T, preferences *lsutil.UserPreferences, texts ...string, )
func (*FourslashTest) VerifyBaselineSelectionRanges ¶
func (f *FourslashTest) VerifyBaselineSelectionRanges(t *testing.T)
func (*FourslashTest) VerifyBaselineSignatureHelp ¶
func (f *FourslashTest) VerifyBaselineSignatureHelp(t *testing.T)
func (*FourslashTest) VerifyCompletions ¶
func (f *FourslashTest) VerifyCompletions(t *testing.T, markerInput MarkerInput, expected *CompletionsExpectedList) VerifyCompletionsResult
!!! user preferences param !!! completion context param
func (*FourslashTest) VerifyNotQuickInfoExists ¶
func (f *FourslashTest) VerifyNotQuickInfoExists(t *testing.T)
func (*FourslashTest) VerifyQuickInfoAt ¶
func (f *FourslashTest) VerifyQuickInfoAt(t *testing.T, marker string, expectedText string, expectedDocumentation string)
!!! expected tags
func (*FourslashTest) VerifyQuickInfoExists ¶
func (f *FourslashTest) VerifyQuickInfoExists(t *testing.T)
func (*FourslashTest) VerifyQuickInfoIs ¶
func (f *FourslashTest) VerifyQuickInfoIs(t *testing.T, expectedText string, expectedDocumentation string)
func (*FourslashTest) VerifyRenameFailed ¶
func (f *FourslashTest) VerifyRenameFailed(t *testing.T, preferences *lsutil.UserPreferences)
func (*FourslashTest) VerifyRenameSucceeded ¶
func (f *FourslashTest) VerifyRenameSucceeded(t *testing.T, preferences *lsutil.UserPreferences)
func (*FourslashTest) VerifySignatureHelp ¶
func (f *FourslashTest) VerifySignatureHelp(t *testing.T, signatureHelpCases ...*SignatureHelpCase)
type Marker ¶
type MarkerOrRange ¶
type RangeMarker ¶
type RangeMarker struct {
Range core.TextRange
LSRange lsproto.Range
Marker *Marker
// contains filtered or unexported fields
}
Inserted in source files by surrounding desired text in a range with `[|` and `|]`. For example,
[|text in range|]
is a range with `text in range` "selected".
func (*RangeMarker) FileName ¶
func (r *RangeMarker) FileName() string
func (*RangeMarker) GetName ¶
func (r *RangeMarker) GetName() *string
func (*RangeMarker) LSPos ¶
func (r *RangeMarker) LSPos() lsproto.Position
type SignatureHelpCase ¶
type SignatureHelpCase struct {
Context *lsproto.SignatureHelpContext
MarkerInput MarkerInput
Expected *lsproto.SignatureHelp
}
type TestData ¶
type TestData struct {
Files []*TestFileInfo
MarkerPositions map[string]*Marker
Markers []*Marker
Symlinks map[string]string
GlobalOptions map[string]string
Ranges []*RangeMarker
}
type TestFileInfo ¶
type TestFileInfo struct {
// The contents of the file (with markers, etc stripped out)
Content string
// contains filtered or unexported fields
}
func (*TestFileInfo) FileName ¶
func (t *TestFileInfo) FileName() string
FileName implements lsconv.Script.
type VerifyCompletionsResult ¶
type VerifyCompletionsResult struct {
AndApplyCodeAction func(t *testing.T, expectedAction *CompletionsExpectedCodeAction)
}
Click to show internal directories.
Click to hide internal directories.