@@ -26,23 +26,21 @@ class CodeTester(sources: List[SourceWithPositions], actions: List[Action]) {
26
26
*
27
27
* @param range The range over which to hover.
28
28
* @param expected The expected result.
29
- * @return This `CodeTester` after performing the action.
30
29
*
31
30
* @see dotty.tools.languageserver.util.actions.CodeHover
32
31
*/
33
- def hover (range : CodeRange , expected : String ): CodeTester =
32
+ def hover (range : CodeRange , expected : String ): this . type =
34
33
doAction(new CodeHover (range, expected))
35
34
36
35
/**
37
36
* Perform a jump to definition over `range`, verifies that the results are `expected`.
38
37
*
39
38
* @param range The range of positions from which run `jump to definition`.
40
39
* @param expected The expected positions to jump to.
41
- * @return This `CodeTester` after performing the action.
42
40
*
43
41
* @see dotty.tools.languageserver.util.actions.CodeDefinition
44
42
*/
45
- def definition (range : CodeRange , expected : Seq [CodeRange ]): CodeTester =
43
+ def definition (range : CodeRange , expected : Seq [CodeRange ]): this . type =
46
44
doAction(new CodeDefinition (range, expected))
47
45
48
46
/**
@@ -51,11 +49,10 @@ class CodeTester(sources: List[SourceWithPositions], actions: List[Action]) {
51
49
*
52
50
* @param range The range of positions to highlight.
53
51
* @param expected The expected ranges and the kind of symbols that should be highlighted.
54
- * @return This `CodeTester` after performing the action.
55
52
*
56
53
* @see dotty.tools.languageserver.util.actions.CodeDefinition
57
54
*/
58
- def highlight (range : CodeRange , expected : (CodeRange , DocumentHighlightKind )* ): CodeTester =
55
+ def highlight (range : CodeRange , expected : (CodeRange , DocumentHighlightKind )* ): this . type =
59
56
doAction(new CodeDocumentHighlight (range, expected))
60
57
61
58
/**
@@ -64,11 +61,10 @@ class CodeTester(sources: List[SourceWithPositions], actions: List[Action]) {
64
61
* @param range The range of positions from which search for references.
65
62
* @param expected The expected positions of the references
66
63
* @param withDecl When set, include the declaration of the symbol under `range` in the results.
67
- * @return This `CodeTester` after performing the action.
68
64
*
69
65
* @see dotty.tools.languageserver.util.actions.CodeReferences
70
66
*/
71
- def references (range : CodeRange , expected : List [CodeRange ], withDecl : Boolean = false ): CodeTester =
67
+ def references (range : CodeRange , expected : List [CodeRange ], withDecl : Boolean = false ): this . type =
72
68
doAction(new CodeReferences (range, expected, withDecl))
73
69
74
70
/**
@@ -77,11 +73,10 @@ class CodeTester(sources: List[SourceWithPositions], actions: List[Action]) {
77
73
*
78
74
* @param marker The position from which to ask for completions.
79
75
* @param expected The expected completion results.
80
- * @return This `CodeTester` after performing the action.
81
76
*
82
77
* @see dotty.tools.languageserver.util.actions.CodeCompletion
83
78
*/
84
- def completion (marker : CodeMarker , expected : Set [(String , CompletionItemKind , String )]): CodeTester =
79
+ def completion (marker : CodeMarker , expected : Set [(String , CompletionItemKind , String )]): this . type =
85
80
doAction(new CodeCompletion (marker, expected))
86
81
87
82
/**
@@ -91,11 +86,10 @@ class CodeTester(sources: List[SourceWithPositions], actions: List[Action]) {
91
86
* @param marker The position from which to ask for renaming.
92
87
* @param newName The new name to give to the symbol.
93
88
* @param expected The expected positions to change.
94
- * @return This `CodeTester` after performing the action.
95
89
*
96
90
* @see dotty.tools.languageserver.util.actions.CodeRename
97
91
*/
98
- def rename (marker : CodeMarker , newName : String , expected : Set [CodeRange ]): CodeTester =
92
+ def rename (marker : CodeMarker , newName : String , expected : Set [CodeRange ]): this . type =
99
93
doAction(new CodeRename (marker, newName, expected)) // TODO apply changes to the sources and positions
100
94
101
95
/**
@@ -104,11 +98,10 @@ class CodeTester(sources: List[SourceWithPositions], actions: List[Action]) {
104
98
*
105
99
* @param marker The marker defining the source file from which to query.
106
100
* @param expected The expected symbols to be found.
107
- * @return This `CodeTester` after performing the action.
108
101
*
109
102
* @see dotty.tools.languageserver.util.actions.CodeDocumentSymbol
110
103
*/
111
- def documentSymbol (marker : CodeMarker , expected : SymInfo * ): CodeTester =
104
+ def documentSymbol (marker : CodeMarker , expected : SymInfo * ): this . type =
112
105
doAction(new CodeDocumentSymbol (marker, expected))
113
106
114
107
/**
@@ -117,11 +110,10 @@ class CodeTester(sources: List[SourceWithPositions], actions: List[Action]) {
117
110
*
118
111
* @param query The query used to find symbols.
119
112
* @param expected The expected symbols to be found.
120
- * @return This `CodeTester` after performing the action.
121
113
*
122
114
* @see dotty.tools.languageserver.util.actions.CodeSymbol
123
115
*/
124
- def symbol (query : String , symbols : SymInfo * ): CodeTester =
116
+ def symbol (query : String , symbols : SymInfo * ): this . type =
125
117
doAction(new CodeSymbol (query, symbols))
126
118
127
119
private def doAction (action : Action ): this .type = {
0 commit comments