示例#1
0
        public SourceDocument(SyntaxNode sourceRoot, SemanticModel semanticModel)
        {
            NamespaceFinder finder = new NamespaceFinder();

            finder.Visit(sourceRoot);

            if (finder.Namespace != null)
            {
                _sourceItems = SourceItem.CreateNestedItems(finder.Namespace.Members, semanticModel);
                _usings      = finder.Usings;
                _namespace   = finder.Namespace;
            }
        }
示例#2
0
        private Declarations GetImportIntellisenseDeclarations(string line)
        {
            NamespaceFinder availableNamespaces = new NamespaceFinder();

            // get any namespace already written (i.e. "Boo.Lang.")
            string namespaceContinuation = line.Trim();
            namespaceContinuation = namespaceContinuation.Remove(0, ImportKeyword.Length).Trim();

            // get project references for the project that the current file is in
            ProjectHierarchy projects = new ProjectHierarchy(service);
            VSProject project = projects.GetContainingProject(fileName);
            IList<ProjectReference> references = projects.GetReferences(project);

            return new BooDeclarations(availableNamespaces.QueryNamespacesFromReferences(references, namespaceContinuation));
        }
示例#3
0
 public void SetData(Solution solution)
 {
     _finder = new NamespaceFinder(solution);
 }