private JArray GetCodeModel(Entity owner, VirtualDirectory buildSystemDirectory)
        {
            VirtualDirectory temp      = FileEntity.Decorate(owner).TempDirectory;
            JArray           codeModel = null;

            try
            {
                codeModel = cmakeConversation.GetCodeModelFromServer(temp.Directory("cmake"),
                                                                     FileEntity.Decorate(owner.Root).Directory,
                                                                     buildSystemDirectory);
            }
            catch (TimeoutException e)
            {
                executionContext.WriteError($"Timeout during cmake server conversation: {e}", false);
            }
            if (codeModel == null)
            {
                throw new FormattableException("Could not fetch code model from cmake build system.");
            }
            return(codeModel);
        }
Beispiel #2
0
 public MockedCMakeConversationAbstraction()
 {
     cmakeConversation.GetCodeModelFromServer(null, null, null)
     .ReturnsForAnyArgs(info => new JArray(CodeModel));
 }