labels: allow restoring cache-map
E.g. with unexpected termination for mu it is possible that the labels-cache (i.e., the one that is used for auto-completion) gets disconnected from reality. Add a --restore option to `mu label list` to restore the actual labels from the labels seen in the store.
This commit is contained in:
@ -30,6 +30,8 @@
|
||||
|
||||
namespace Mu {
|
||||
|
||||
class Store;
|
||||
|
||||
/**
|
||||
* The cache keeps track of what labels are being used. This can be used
|
||||
* for completion etc. and `mu label list`
|
||||
@ -143,6 +145,17 @@ public:
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Restore the labels-cache from the labels seen in the store.
|
||||
*
|
||||
* @param store a store
|
||||
*
|
||||
* @return Ok() or some error
|
||||
*/
|
||||
Result<void> restore(const Store& store);
|
||||
|
||||
|
||||
/**
|
||||
* Is the cache "dirty"?
|
||||
*
|
||||
@ -159,8 +172,6 @@ private:
|
||||
mutable bool dirty_{};
|
||||
};
|
||||
|
||||
class Store;
|
||||
|
||||
/**
|
||||
* Export labels to a file
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user