Exemplo n.º 1
0
        // ParseReason.CompleteWord
        // ParseReason.DisplayMemberList
        // ParseReason.MemberSelect
        // ParseReason.MemberSelectAndHilightBraces
        public override Declarations GetDeclarations(IVsTextView view, int line, int col, TokenInfo info, ParseReason reason)
        {
            string tokenText;
            var    hr = view.GetTextStream(line, info.StartIndex, line, col, out tokenText);

            IList <Declaration> declarations;

            switch (reason)
            {
            case ParseReason.CompleteWord:
                declarations = resolver.FindCompletions(tokenText, line, col);
                break;

            case ParseReason.DisplayMemberList:
            case ParseReason.MemberSelect:
            case ParseReason.MemberSelectAndHighlightBraces:
                declarations = resolver.FindMembers(parseResult, line, col);
                break;

            default:
                throw new ArgumentException("reason");
            }

            return(new PuppetDeclarations(declarations));
        }
Exemplo n.º 2
0
        // ParseReason.CompleteWord
        // ParseReason.DisplayMemberList
        // ParseReason.MemberSelect
        // ParseReason.MemberSelectAndHilightBraces
        public override Microsoft.VisualStudio.Package.Declarations GetDeclarations(IVsTextView view, int line, int col, TokenInfo info, ParseReason reason)
        {
            IList <Declaration> declarations;

            switch (reason)
            {
            case ParseReason.CompleteWord:
                declarations = resolver.FindCompletions(parseResult, line, col);
                break;

            case ParseReason.DisplayMemberList:
            case ParseReason.MemberSelect:
            case ParseReason.MemberSelectAndHighlightBraces:
                declarations = resolver.FindMembers(parseResult, line, col);
                break;

            default:
                throw new ArgumentException("reason");
            }

            return(new Declarations(declarations));
        }