コード例 #1
0
        private static IEnumerable<CompletionItem> GetGlobalCompletions(SemanticModel semanticModel, SourceLocation position)
        {
            var symbols = semanticModel.LookupSymbols(position)
                .Where(x => !(x is SemanticSymbol))
                .Where(x => !(x is AttributeSymbol));

            if (!semanticModel.SyntaxTree.PossiblyInTypeName(position))
                symbols = symbols.Where(x => !(x is TypeSymbol));

            return CreateSymbolCompletions(symbols);
        }
コード例 #2
0
 private static IEnumerable<CompletionItem> GetTypeCompletions(SemanticModel semanticModel, SourceLocation position)
 {
     var symbols = semanticModel.LookupSymbols(position).OfType<TypeSymbol>();
     return CreateSymbolCompletions(symbols);
 }