Beispiel #1
0
 public ParseService(IUnsavedFileProvider unsavedProvider)
 {
     _lock = new object();
     _unsavedFileProvider = unsavedProvider;
     _parseThreads = new ParseThreads();
     _parsedVersions = new Dictionary<FilePath, ulong>();
     _parseThreads.Run = true;
     Services.Provider.WorkspaceController.WorkspaceChanged += OnWorkspaceChanged;
 }
Beispiel #2
0
        public static ParseResult Parse(IProjectIndex index, FilePath path, string[] compilerArgs, IUnsavedFileProvider unsavedFiles)
        {
            TranslationUnit tu = new TranslationUnit(index.LibClangIndex, path.Str);

            //Take a snapshot of the source
            IEnumerable<ParseFile> files = unsavedFiles.UnsavedFiles;
            List<Tuple<string, string>> unsavedList = new List<Tuple<string, string>>();
            foreach (var i in files)
            {
                unsavedList.Add(new Tuple<string, string>(i.Path.Str, i.Content));
            }
            if (tu.Parse(compilerArgs, unsavedList) == false)
            {
                tu.Dispose();
                return null;
            }
            return new ParseResult(index, path, files, tu); ;
        }
Beispiel #3
0
 public IndexingService(IUnsavedFileProvider unsavedProvider)
 {
     _unsavedFileProvider = unsavedProvider;
 }