• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AnderssonPeter / PowerType / 5536473282

pending completion
5536473282

push

github

AnderssonPeter
Update DynamicSourceCache when executing specific commands

317 of 492 branches covered (64.43%)

Branch coverage included in aggregate %.

58 of 58 new or added lines in 6 files covered. (100.0%)

676 of 948 relevant lines covered (71.31%)

177.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/PowerType/BackgroundProcessing/ExecutionEngine.cs
1
using PowerType.Model;
2

3
namespace PowerType.BackgroundProcessing;
4

5
internal partial class ExecutionEngine
6
{
7
    private ExecutionEngineThread? executionEngineThread;
8
    private readonly ThreadQueue<Command> threadQueue = new();
×
9

10
    public List<DictionarySuggester> GetSuggesters() => executionEngineThread?.GetSuggesters() ?? new List<DictionarySuggester>();
×
11

12
    public bool IsHealthy(out Exception? exception)
13
    {
14
        var thread = executionEngineThread;
×
15
        if (thread != null)
×
16
        {
17
            return thread.IsHealthy(out exception);
×
18
        }
19
        exception = new ThreadStateException("No execution thread is running");
×
20
        return false;
×
21
    }
22

23
    public void Start()
24
    {
25
        if (executionEngineThread != null)
×
26
        {
27
            throw new InvalidOperationException("Already started");
×
28
        }
29
        executionEngineThread = new ExecutionEngineThread(threadQueue);
×
30
    }
×
31

32
    public void Stop()
33
    {
34
        if (executionEngineThread == null)
×
35
        {
36
            throw new InvalidOperationException("Not started");
×
37
        }
38
        executionEngineThread.Dispose();
×
39
        executionEngineThread = null;
×
40
    }
×
41

42
    public void InitialDictionary(string dictionaryPath) =>
43
        threadQueue.Enqueue(new InitializeDictionaryCommand(dictionaryPath));
×
44

45
    public void Cache(PowerTypeDictionary dictionary, string currentWorkingDirectory) =>
46
        threadQueue.Enqueue(new CacheDictionaryDynamicSourcesCommand(dictionary, currentWorkingDirectory));
×
47

48
    public void CommandExecuted(PowerTypeDictionary dictionary, string currentWorkingDirectory, string command) => 
49
        threadQueue.Enqueue(new CommandExecutedCommand(dictionary, currentWorkingDirectory, command));
×
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc