コード例 #1
0
        public AnalysisItem AnalyzeTextView(ITextView textView)
        {
            // Get an AnalysisItem for this file, creating one if necessary
            var res = textView.TextBuffer.Properties.GetOrCreateSingletonProperty <AnalysisItem>(() => {
                string path = textView.GetFilePath();
                AnalysisItem item;
                if (path != null && _projectFiles.TryGetValue(path, out item))
                {
                    return(item);
                }

                var initialSnapshot = textView.TextBuffer.CurrentSnapshot;
                var entry           = new ProjectEntry(
                    SnapshotTextContentProvider.Make(_engine, initialSnapshot, path),
                    textView.GetFilePath(),
                    new SnapshotCookie(initialSnapshot)
                    );

                item = new AnalysisItem(entry);
                if (path != null)
                {
                    _projectFiles[path] = item;

                    if (ImplicitProject)
                    {
                        AddImplicitFiles(Path.GetDirectoryName(Path.GetFullPath(path)));
                    }
                }

                return(item);
            });

            // kick off initial processing on the ITextWindow
            _queue.EnqueueBuffer(textView);

            return(res);
        }
コード例 #2
0
 internal AnalysisItem(ProjectEntry entry)
 {
     _entry = entry;
     //_state = ItemState.Prepare;
 }
コード例 #3
0
 public override int GetHashCode()
 {
     return(Line.GetHashCode() ^ ProjectEntry.GetHashCode());
 }
コード例 #4
0
ファイル: AstScopeNode.cs プロジェクト: TerabyteX/main
 public AstScopeNode(SourceUnitTree ast, ProjectEntry projectEntry)
 {
     _ast = ast;
     _projectEntry = projectEntry;
 }
コード例 #5
0
ファイル: AnalysisItem.cs プロジェクト: TerabyteX/main
 internal AnalysisItem(ProjectEntry entry)
 {
     _entry = entry;
     //_state = ItemState.Prepare;
 }