Пример #1
0
        public void OnParseComplete(ParseResult result)
        {
            lock(_lock)
            {
                if(_parsedVersions.ContainsKey(result.Path))
                {
                    _parsedVersions[result.Path] = result.GetFileVersion(result.Path);
                }
                else
                {
                    _parsedVersions.Add(result.Path, result.GetFileVersion(result.Path));
                }
            }

            Task.Factory.StartNew(() =>
            {
                //    lock (_lock)
                {
                    ParseEventHandler handler = TranslationUnitParsed;
                    if (handler != null)
                    {
                        handler(result);
                    }

                    //begin indexing
                    ProjectIndexBuilder.IndexTranslationUnit(result);
                    OnIndexingComplete(result);

                }
            }, CancellationToken.None, TaskCreationOptions.None, JadeCore.Services.Provider.GuiScheduler);

            
        }
Пример #2
0
        static public void IndexTranslationUnit(ParseResult parseResult)
        {
            parseResult.Index.UpdateParseResult(parseResult);

            System.Diagnostics.Debug.WriteLine("**Indexing " + parseResult.Path.FileName + " version:" + parseResult.GetFileVersion(parseResult.Path));
            IndexTranslationUnit(parseResult.Index, parseResult.TranslationUnit);
        }
Пример #3
0
 public void UpdateParseResult(ParseResult result)
 {
     lock (_lock)
     {
         if(_parseResults.ContainsKey(result.Path))
         {
             _parseResults[result.Path] = result;
         }
         else
         {
             _parseResults.Add(result.Path, result);
         }
     }
     return;
 }
Пример #4
0
 public void OnIndexingComplete(ParseResult result)
 {
     ParseEventHandler handler = TranslationUnitIndexed;
     if (handler != null)
     {
         handler(result);
     }
 }