| 378 | } |
| 379 | |
| 380 | void DeclarationManager::removeDeclaration(Type type, const std::string& name) |
| 381 | { |
| 382 | // All parsers need to have finished |
| 383 | waitForTypedParsersToFinish(); |
| 384 | |
| 385 | // Acquire the lock and perform the removal |
| 386 | doWithDeclarationLock(type, [&](NamedDeclarations& decls) |
| 387 | { |
| 388 | auto decl = decls.find(name); |
| 389 | |
| 390 | if (decl != decls.end()) |
| 391 | { |
| 392 | removeDeclarationFromFile(decl->second); |
| 393 | |
| 394 | // Clear out this declaration's syntax block |
| 395 | auto syntax = decl->second->getBlockSyntax(); |
| 396 | syntax.name.clear(); |
| 397 | syntax.typeName.clear(); |
| 398 | syntax.contents.clear(); |
| 399 | syntax.fileInfo = vfs::FileInfo(); |
| 400 | decl->second->setBlockSyntax(syntax); |
| 401 | |
| 402 | decls.erase(decl); |
| 403 | |
| 404 | signal_DeclRemoved().emit(type, name); |
| 405 | } |
| 406 | }); |
| 407 | } |
| 408 | |
| 409 | namespace |
| 410 | { |
no test coverage detected