示例#1
0
        private static void CreateStdLibModel(ProbeAppSettings appSettings)
        {
            var tempStore   = new FileStore();
            var includeFile = tempStore.GetIncludeFile(appSettings, null, "stdlib.i", false, new string[0]);

            if (includeFile != null)
            {
                _stdLibModel = tempStore.CreatePreprocessedModel(appSettings, includeFile.GetSource(appSettings),
                                                                 includeFile.FullPathName, false, "stdlib.i model", null);
            }
            else
            {
                var blankSource = new CodeSource();
                blankSource.Flush();

                _stdLibModel = tempStore.CreatePreprocessedModel(appSettings, blankSource, "stdlib.i", false,
                                                                 "stdlib.i model (blank)", null);
            }

            _stdLibDefines = _stdLibModel.PreprocessorModel.Preprocessor.Defines.ToArray();
        }
示例#2
0
            public static void ShowPreprocessor()
            {
                ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
                {
                    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                    var appSettings = ProbeEnvironment.CurrentAppSettings;

                    string fileName;
                    var codeSource = GetCodeSourceForActiveView(out fileName);
                    if (codeSource == null)
                    {
                        return;
                    }

                    var store = new CodeModel.FileStore();
                    var model = store.CreatePreprocessedModel(appSettings, codeSource, fileName, false,
                                                              "Commands.Debug.ShowPreprocessor()", null);

                    Shell.OpenTempContent(model.Source.Text, Path.GetFileName(fileName), ".preprocessor.txt");
                });
            }