File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -216,31 +216,27 @@ void LanguageServer::changeConfiguration(Json::Value const& _settings)
216
216
217
217
if (jsonRemappings)
218
218
{
219
- int typeFailureCount = 0 ;
219
+ bool typeFailures = false ;
220
220
if (jsonRemappings.isArray ())
221
221
{
222
222
vector<frontend::ImportRemapper::Remapping> remappings;
223
223
for (Json::Value const & jsonPath: jsonRemappings)
224
224
{
225
225
if (jsonPath.isObject ())
226
- {
227
226
remappings.emplace_back (ImportRemapper::Remapping{
228
227
jsonPath.get (" context" , " " ).asString (),
229
228
jsonPath.get (" prefix" , " " ).asString (),
230
229
jsonPath.get (" target" , " " ).asString (),
231
230
});
232
- }
233
231
else
234
- {
235
- typeFailureCount++;
236
- }
232
+ typeFailures = true ;
237
233
}
238
- m_fileRepository.setRemappings (move (remappings));
234
+ m_fileRepository.setRemappings (std:: move (remappings));
239
235
}
240
236
else
241
- ++typeFailureCount ;
237
+ typeFailures = true ;
242
238
243
- if (typeFailureCount )
239
+ if (typeFailures )
244
240
m_client.trace (" Invalid JSON configuration passed. \" remappings\" should be of form [{\" context\" :\"\" , \" prefix\" :\" foo\" , \" target\" :\" bar\" }]." );
245
241
246
242
}
You can’t perform that action at this time.
0 commit comments