Пример #1
0
 public void AddSnippets(ref PythonDeclarations declarations)
 {
     if (null == this.ExpansionsList)
     {
         return;
     }
     foreach (VsExpansion expansionInfo in this.ExpansionsList)
     {
         declarations.AddDeclaration(new Declaration(expansionInfo));
     }
 }
Пример #2
0
        public override Declarations GetDeclarations(IVsTextView view, int line, int col, TokenInfo info, ParseReason reason)
        {
            System.Diagnostics.Debug.Print("GetDeclarations line({0}), col({1}), TokenInfo(type {2} at {3}-{4} triggers {5}), reason({6})",
                                           line, col, info.Type, info.StartIndex, info.EndIndex, info.Trigger, reason);

            IList <Declaration> declarations       = module.GetAttributesAt(line + 1, info.StartIndex);
            PythonDeclarations  pythonDeclarations = new PythonDeclarations(declarations, language);

            //Show snippets according to current language context
            if (IsContextRightForSnippets(line, info))
            {
                ((PythonLanguage)language).AddSnippets(ref pythonDeclarations);
            }

            //Sort statement completion items in alphabetical order
            pythonDeclarations.Sort();
            return(pythonDeclarations);
        }
        public override Declarations GetDeclarations(IVsTextView view, int line, int col, TokenInfo info, ParseReason reason)
        {
            System.Diagnostics.Debug.Print("GetDeclarations line({0}), col({1}), TokenInfo(type {2} at {3}-{4} triggers {5}), reason({6})",
                line, col, info.Type, info.StartIndex, info.EndIndex, info.Trigger, reason);

            IList<Declaration> declarations = module.GetAttributesAt(line + 1, info.StartIndex);
            PythonDeclarations pythonDeclarations = new PythonDeclarations(declarations, language);

            //Show snippets according to current language context
            if (IsContextRightForSnippets(line, info)) {
                ((PythonLanguage)language).AddSnippets(ref pythonDeclarations);
            }

            //Sort statement completion items in alphabetical order
            pythonDeclarations.Sort();
            return pythonDeclarations;
        }
 public void AddSnippets(ref PythonDeclarations declarations)
 {
     if (null == this.ExpansionsList) {
         return;
     }
     foreach (VsExpansion expansionInfo in this.ExpansionsList) {
         declarations.AddDeclaration(new Declaration(expansionInfo));
     }
 }