コード例 #1
0
        public virtual async Task <CompilerResult> CompileAsync(string sourceFileName, string targetFileName)
        {
            bool onlyPreview = false;

            if (WEIgnore.TestWEIgnore(sourceFileName, this is ILintCompiler ? "linter" : "compiler", ServiceName.ToLowerInvariant()))
            {
                if (WESettings.Instance.General.ShowWEIgnoreLogs)
                {
                    Logger.Log(String.Format(CultureInfo.CurrentCulture,
                                             "{0}: The file {1} is ignored by .weignore. Skipping..",
                                             ServiceName, Path.GetFileName(sourceFileName)));
                }

                if (!Previewing)
                {
                    return(await CompilerResultFactory.GenerateResult(sourceFileName, targetFileName, string.Empty, false, string.Empty, string.Empty, Enumerable.Empty <CompilerError>(), true));
                }

                onlyPreview = true;
            }

            CompilerResult response = await NodeServer.CallServiceAsync(GetPath(sourceFileName, targetFileName));

            return(await ProcessResult(response, onlyPreview, sourceFileName, targetFileName));
        }
コード例 #2
0
 private async Task <CompilerResult> RetryOnce(string path)
 {
     return(await NodeServer.CallServiceAsync(path, true));
 }