38
38
ALSLanguageClient ,
39
39
ALSSettings ,
40
40
assertEqual ,
41
- awaitIndexingEnd ,
42
41
test ,
43
42
)
44
43
@@ -68,18 +67,18 @@ async def test1(lsp: ALSLanguageClient) -> None:
68
67
)
69
68
# Because no project file was set, we need a didOpen to load the project
70
69
lsp .didOpenVirtual ()
71
- await awaitIndexingEnd (lsp )
70
+ await lsp . awaitIndexingEnd ()
72
71
assertEqual (await lsp .getObjDirBasename (), "value-from-init" )
73
72
74
73
# Now let's change the settings
75
74
lsp .didChangeConfig ({"scenarioVariables" : {"Var" : "new-value" }})
76
- await awaitIndexingEnd (lsp )
75
+ await lsp . awaitIndexingEnd ()
77
76
assertEqual (await lsp .getObjDirBasename (), "new-value" )
78
77
79
78
# Now we send a null value to revert to the base config which should be the config
80
79
# file, not the initialize request.
81
80
lsp .didChangeConfig ({"scenarioVariables" : None })
82
- await awaitIndexingEnd (lsp )
81
+ await lsp . awaitIndexingEnd ()
83
82
assertEqual (await lsp .getObjDirBasename (), "value-from-config-file" )
84
83
85
84
@@ -99,17 +98,17 @@ async def test2(lsp: ALSLanguageClient) -> None:
99
98
)
100
99
# Because no project file was set, we need a didOpen to load the project
101
100
lsp .didOpenVirtual ()
102
- await awaitIndexingEnd (lsp )
101
+ await lsp . awaitIndexingEnd ()
103
102
assertEqual (await lsp .getObjDirBasename (), "value-from-init" )
104
103
105
104
# Now let's change the settings and revert back to see if we revert to the right
106
105
# value.
107
106
lsp .didChangeConfig ({"scenarioVariables" : {"Var" : "new-value" }})
108
- await awaitIndexingEnd (lsp )
107
+ await lsp . awaitIndexingEnd ()
109
108
assertEqual (await lsp .getObjDirBasename (), "new-value" )
110
109
111
110
lsp .didChangeConfig ({"scenarioVariables" : None })
112
- await awaitIndexingEnd (lsp )
111
+ await lsp . awaitIndexingEnd ()
113
112
assertEqual (await lsp .getObjDirBasename (), "value-from-init" )
114
113
115
114
@@ -130,19 +129,19 @@ async def test3(lsp: ALSLanguageClient) -> None:
130
129
)
131
130
# Because no project file was set, we need a didOpen to load the project
132
131
lsp .didOpenVirtual ()
133
- await awaitIndexingEnd (lsp )
132
+ await lsp . awaitIndexingEnd ()
134
133
# No value was provided for the scenario variable, so we should get the default
135
134
# value defined in the project.
136
135
assertEqual (await lsp .getObjDirBasename (), "value-from-prj" )
137
136
138
137
# Now let's change the settings and revert back to see if we revert to the right
139
138
# value.
140
139
lsp .didChangeConfig ({"scenarioVariables" : {"Var" : "new-value" }})
141
- await awaitIndexingEnd (lsp )
140
+ await lsp . awaitIndexingEnd ()
142
141
assertEqual (await lsp .getObjDirBasename (), "new-value" )
143
142
144
143
lsp .didChangeConfig ({"scenarioVariables" : None })
145
- await awaitIndexingEnd (lsp )
144
+ await lsp . awaitIndexingEnd ()
146
145
assertEqual (await lsp .getObjDirBasename (), "value-from-prj" )
147
146
148
147
@@ -158,7 +157,7 @@ async def test4(lsp: ALSLanguageClient) -> None:
158
157
)
159
158
# Because no project file was set, we need a didOpen to load the project
160
159
lsp .didOpenVirtual ()
161
- await awaitIndexingEnd (lsp )
160
+ await lsp . awaitIndexingEnd ()
162
161
# No value was provided for the scenario variable, so we should get the default
163
162
# value defined in the project.
164
163
assertEqual (await lsp .getObjDirBasename (), "value-from-prj" )
@@ -168,14 +167,14 @@ async def test4(lsp: ALSLanguageClient) -> None:
168
167
lsp .didChangeConfig (
169
168
{"scenarioVariables" : {"Var" : "value-from-first-config-change" }}
170
169
)
171
- await awaitIndexingEnd (lsp )
170
+ await lsp . awaitIndexingEnd ()
172
171
assertEqual (await lsp .getObjDirBasename (), "value-from-first-config-change" )
173
172
174
173
# Now we change to another value, and revert with a null value.
175
174
lsp .didChangeConfig ({"scenarioVariables" : {"Var" : "new-value" }})
176
- await awaitIndexingEnd (lsp )
175
+ await lsp . awaitIndexingEnd ()
177
176
assertEqual (await lsp .getObjDirBasename (), "new-value" )
178
177
179
178
lsp .didChangeConfig ({"scenarioVariables" : None })
180
- await awaitIndexingEnd (lsp )
179
+ await lsp . awaitIndexingEnd ()
181
180
assertEqual (await lsp .getObjDirBasename (), "value-from-first-config-change" )
0 commit comments