示例#1
0
 private bool isDotNetItem(string s, ref Position position)
 {
     /*if (!File.Exists(DotNetHelpFileName))
         return false;*/
     switch (s.ToLower())
     {
         case "integer":
         case "real":
         case "byte":
         case "shortint":
         case "smallint":
         case "boolean":
         case "single":
         case "word":
         case "longword":
         case "uint64":
         case "longint":
         case "int64":
         case "char":
         case "string":
             return false;
     }
     if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false;
     List<Position> poses = CodeCompletionActionsManager.GetDefinitionPosition(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea, true);
     if (poses == null || poses.Count == 0) return false;
     foreach (Position pos in poses)
         if (pos.from_metadata)
         {
             position = pos;
             return true;
         }
     return false;
 }
        public string GetRealizationTextToAdd(string fileName, int line, int col, ref PascalABCCompiler.Parsers.Position pos, TextArea textArea)
        {
            CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName];
            if (dconv == null)
            {
                return(null);
            }
            CodeCompletion.ProcScope[] procs = dconv.GetNotImplementedMethods(line, col, ref pos);
            if (procs == null)
            {
                return(null);
            }
            System.Text.StringBuilder sb = new StringBuilder();
            sb.Append("\n\n");
            for (int i = 0; i < procs.Length; i++)
            {
                int    off  = textArea.Document.PositionToOffset(new TextLocation(procs[i].GetPosition().column - 1, procs[i].GetPosition().line - 1));
                string meth = textArea.Document.GetText(off, textArea.Document.PositionToOffset(new TextLocation(procs[i].GetPosition().end_column - 1, procs[i].GetPosition().end_line - 1)) - off + 1);
                meth = construct_header(meth, procs[i], VisualPABCSingleton.MainForm.UserOptions.CursorTabCount);

                if (i < procs.Length - 1)
                {
                    sb.Append(meth);
                    sb.Append('\n');
                }
                else
                {
                    sb.Append(meth.Trim());
                }
            }
            return(sb.ToString());
        }
        private List <SymbolsViewerSymbol> InternalFindReferences(string fname, PascalABCCompiler.SyntaxTree.expression expr, int line, int col, bool for_refact)
        {
            List <PascalABCCompiler.Parsers.Position> lst = new List <PascalABCCompiler.Parsers.Position>();
            List <SymbolsViewerSymbol> svs_lst            = new List <SymbolsViewerSymbol>();

            try
            {
                CodeCompletion.DomConverter dc = CodeCompletion.CodeCompletionController.comp_modules[fname] as CodeCompletion.DomConverter;
                IBaseScope fnd_scope           = null;
                IBaseScope cur_sc = null;
                if (dc != null)
                {
                    fnd_scope = dc.GetSymDefinition(expr, line, col, keyword);
                    cur_sc    = dc.FindScopeByLocation(line, col);
                }
                if (fnd_scope != null)
                {
                    foreach (string FileName in CodeCompletionParserController.open_files.Keys)
                    {
                        CodeCompletion.CodeCompletionController controller = new CodeCompletion.CodeCompletionController();
                        string text = VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.SourceFilesProvider(FileName, PascalABCCompiler.SourceFileOperation.GetText) as string;
                        PascalABCCompiler.SyntaxTree.compilation_unit cu = controller.ParseOnlySyntaxTree(FileName, text);
                        if (cu != null)
                        {
                            dc = CodeCompletion.CodeCompletionController.comp_modules[FileName] as CodeCompletion.DomConverter;
                            CodeCompletion.ReferenceFinder rf = null;
                            if (dc != null && dc.visitor.entry_scope != null)
                            {
                                rf = new CodeCompletion.ReferenceFinder(fnd_scope, dc.visitor.entry_scope, cu, FileName, for_refact);
                                lst.AddRange(rf.FindPositions());
                            }
                        }
                    }
                    PascalABCCompiler.Parsers.Position p = fnd_scope.GetPosition();
                    bool need_add_def = !for_refact; // true
                    if (p.file_name != null && need_add_def)
                    {
                        svs_lst.Add(new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(p.file_name, p.line, p.column, p.end_line, p.end_column), ImagesProvider.GetPictureNum(fnd_scope.SymbolInfo)));
                    }
                    foreach (PascalABCCompiler.Parsers.Position pos in lst)
                    {
                        if (pos.file_name != null)
                        {
                            svs_lst.Add(new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(pos.file_name, pos.line, pos.column, pos.end_line, pos.end_column), ImagesProvider.IconNumberGotoText));
                        }
                    }
                }
            }
            catch (Exception e)
            {
            }
            GC.Collect();
            return(svs_lst);
            //return svs_lst.ToArray();
        }
示例#4
0
 private string getMSDNUrlByName(string s, Position pos)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append("http://msdn.microsoft.com/ru-ru/library/");
     string title = pos.full_metadata_title;
     if (pos.full_metadata_title.IndexOf('`') != -1 && pos.full_metadata_title.IndexOf('.') != -1)
         title = pos.full_metadata_title.Substring(0, pos.full_metadata_title.LastIndexOf('.'));
     sb.Append(title);
     sb.Append("(v=vs.100).aspx");
     return sb.ToString();
 }
 public string GetMethodImplementationTextToAdd(string fileName, int line, int col, ref PascalABCCompiler.Parsers.Position pos, TextArea textArea)
 {
     CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName];
     if (dconv == null)
     {
         return(null);
     }
     CodeCompletion.ProcScope[] procs = dconv.GetNotImplementedMethodHeaders(line, col, ref pos);
     if (procs == null || procs.Length == 0)
     {
         return(null);
     }
     System.Text.StringBuilder sb = new StringBuilder();
     for (int i = 0; i < procs.Length; i++)
     {
         string meth = construct_header(procs[i] as CodeCompletion.ProcRealization, VisualPABCSingleton.MainForm.UserOptions.CursorTabCount);
         sb.Append(meth);
         //sb.Append('\n');
     }
     return(sb.ToString());
 }
			public ComboBoxItem(SymScope item, string text, int iconIndex, bool isInCurrentPart, bool is_global)
			{
				this.item = item;
				if (item != null)
				pos = item.GetPosition();
				this.text = text;
				this.iconIndex = iconIndex;
				this.isInCurrentPart = true;
				this.is_global = is_global;
			}
示例#7
0
 public Position GetBodyPosition()
 {
     Position pos = new Position();
     if (body_loc != null)
     {
         pos.file_name = body_loc.doc.file_name;
         pos.line = body_loc.begin_line_num;
         pos.column = body_loc.begin_column_num;
         pos.end_line = body_loc.end_line_num;
         pos.end_column = body_loc.end_column_num;
     }
     return pos;
 }
示例#8
0
 public Position GetHeaderPosition()
 {
     Position pos = new Position();
     if (head_loc != null)
     {
         pos.file_name = head_loc.doc.file_name;
         pos.line = head_loc.begin_line_num;
         pos.column = head_loc.begin_column_num;
         pos.end_line = head_loc.end_line_num;
         pos.end_column = head_loc.end_column_num;
     }
     return pos;
 }
示例#9
0
 private Position get_position(syntax_tree_node stn)
 {
     Position pos = new Position();
     if (stn != null && stn.source_context != null)
     {
         pos.line = stn.source_context.begin_position.line_num;
         pos.column = stn.source_context.begin_position.column_num;
         pos.end_line = stn.source_context.end_position.line_num;
         pos.end_column = stn.source_context.end_position.column_num;
         pos.file_name = FileName;
     }
     return pos;
 }
 /// <summary>
 /// Получить определение expr
 /// </summary>
 public List<Position> GetDefinition(expression expr, int line, int col, PascalABCCompiler.Parsers.KeywordKind keyword, bool only_check)
 {
 	List<Position> poses = new List<Position>();
 	Position pos = new Position(); pos.line = -1; pos.column = -1;
 	try
 	{
 	    if (stv.cur_scope == null) return poses;
 	    SymScope ss = stv.FindScopeByLocation(line+1,col+1);//stv.cur_scope;
 	    if (ss == null) return poses;
 	    bool on_proc = false;
         SetCurrentUsedAssemblies();
 	    if (keyword == PascalABCCompiler.Parsers.KeywordKind.Function || keyword == PascalABCCompiler.Parsers.KeywordKind.Constructor || keyword == PascalABCCompiler.Parsers.KeywordKind.Destructor)
 	    {
 		    if (ss is ProcRealization)
 		    {
 			    if (expr is ident)
 			    {
 				    if ((expr as ident).name == (ss as ProcRealization).def_proc.si.name) 
                         on_proc = true;
 			    }
 			    else 
                     on_proc = true;
 		    }
 		    else if (ss is ProcScope)
 		    {
 			    if (expr is ident)
 			    {
 				    if ((expr as ident).name == (ss as ProcScope).si.name) 
                         on_proc = true;
 			    }
 			    else 
                     on_proc = true;
 		    }
 	    }
 	    //if (!((keyword == KeywordKind.kw_proc || keyword == KeywordKind.kw_constr || keyword == KeywordKind.kw_destr) && ss is ProcScope))
 	    if (!on_proc)
 	    //if (!((keyword == KeywordKind.kw_proc || keyword == KeywordKind.kw_constr || keyword == KeywordKind.kw_destr) && ss is ProcRealization))
 	    {
 		    ExpressionVisitor ev = new ExpressionVisitor(expr, ss, stv);
 		    ss = ev.GetScopeOfExpression();
 	    }
 	    else 
 	    if (ss is ProcRealization)
 		    ss = (ss as ProcRealization).def_proc;
 	    if (ss != null)
 	    {
             if (ss.loc != null)
             {
                 pos.line = ss.loc.begin_line_num;
                 pos.column = ss.loc.begin_column_num;
                 pos.file_name = ss.loc.doc.file_name;
                 poses.Add(pos);
             }
             else if (ss is ProcScope && (ss as ProcScope).is_constructor)
             {
                 ss = (ss as ProcScope).declaringType;
                 if (ss.loc != null)
                 {
                     pos.line = ss.loc.begin_line_num;
                     pos.column = ss.loc.begin_column_num;
                     pos.file_name = ss.loc.doc.file_name;
                     poses.Add(pos);
                 }
             }
             else if (ss is CompiledScope)
             {
                 pos.from_metadata = true;
                 pos.line = 1;
                 pos.column = 1;
                 CompiledScope cs = ss as CompiledScope;
                 pos.metadata_title = prepare_file_name(cs.CompiledType.Name);
                 pos.full_metadata_title = cs.CompiledType.FullName;
                 if (cs.CompiledType.IsInterface)
                     pos.metadata_type = MetadataType.Interface;
                 else if (cs.CompiledType.BaseType == typeof(Delegate) || cs.CompiledType.BaseType == typeof(MulticastDelegate))
                     pos.metadata_type = MetadataType.Delegate;
                 else if (cs.CompiledType.IsEnum)
                     pos.metadata_type = MetadataType.Enumeration;
                 else if (cs.CompiledType.IsValueType)
                     pos.metadata_type = MetadataType.Struct;
                 else
                     pos.metadata_type = MetadataType.Class;
                 if (!only_check)
                 {
                     pos.metadata = CodeCompletionController.CurrentParser.LanguageInformation.GetCompiledTypeRepresentation(cs.CompiledType, cs.CompiledType, ref pos.line, ref pos.column);
                     Type t = cs.CompiledType;
                     int lines = 0;
                     int ind = pos.metadata.IndexOf('\n');
                     pos.metadata = pos.metadata.Insert(ind + 1, get_references(t, out lines));
                     pos.line += lines;
                 }
                 poses.Add(pos);
             }
             else if (ss is CompiledFieldScope)
             {
                 pos.from_metadata = true;
                 pos.line = 1;
                 pos.column = 1;
                 CompiledFieldScope cfs = ss as CompiledFieldScope;
                 if (cfs.CompiledField.DeclaringType.IsEnum)
                     pos.metadata_type = MetadataType.EnumerationMember;
                 else
                     pos.metadata_type = MetadataType.Field;
                 pos.metadata_title = prepare_file_name(cfs.CompiledField.DeclaringType.Name);
                 if (!only_check)
                 {
                     pos.metadata = CodeCompletionController.CurrentParser.LanguageInformation.GetCompiledTypeRepresentation(cfs.CompiledField.DeclaringType, cfs.CompiledField, ref pos.line, ref pos.column);
                     Type t = cfs.CompiledField.DeclaringType;
                     int lines = 0;
                     int ind = pos.metadata.IndexOf('\n');
                     pos.metadata = pos.metadata.Insert(ind + 1, get_references(t, out lines));
                     pos.line += lines;
                 }
                 pos.full_metadata_title = cfs.CompiledField.DeclaringType.FullName + "." + cfs.CompiledField.Name;
                 poses.Add(pos);
             }
             else if (ss is CompiledMethodScope)
             {
                 pos.from_metadata = true;
                 pos.line = 1;
                 pos.column = 1;
                 CompiledMethodScope cms = ss as CompiledMethodScope;
                 pos.metadata_title = prepare_file_name(cms.CompiledMethod.DeclaringType.Name);
                 pos.metadata_type = MetadataType.Method;
                 if (!only_check)
                 {
                     pos.metadata = CodeCompletionController.CurrentParser.LanguageInformation.GetCompiledTypeRepresentation(cms.CompiledMethod.DeclaringType, cms.CompiledMethod, ref pos.line, ref pos.column);
                     Type t = cms.CompiledMethod.DeclaringType;
                     int lines = 0;
                     int ind = pos.metadata.IndexOf('\n');
                     pos.metadata = pos.metadata.Insert(ind + 1, get_references(t, out lines));
                     pos.line += lines;
                 }
                 pos.full_metadata_title = cms.CompiledMethod.DeclaringType.FullName + "." + cms.CompiledMethod.Name;
                 poses.Add(pos);
             }
             else if (ss is CompiledPropertyScope)
             {
                 pos.from_metadata = true;
                 CompiledPropertyScope cps = ss as CompiledPropertyScope;
                 pos.metadata_title = prepare_file_name(cps.CompiledProperty.DeclaringType.Name);
                 pos.line = 1;
                 pos.column = 1;
                 pos.metadata_type = MetadataType.Property;
                 if (!only_check)
                 {
                     pos.metadata = CodeCompletionController.CurrentParser.LanguageInformation.GetCompiledTypeRepresentation((ss as CompiledPropertyScope).CompiledProperty.DeclaringType, (ss as CompiledPropertyScope).CompiledProperty, ref pos.line, ref pos.column);
                     Type t = cps.CompiledProperty.DeclaringType;
                     int lines = 0;
                     int ind = pos.metadata.IndexOf('\n');
                     pos.metadata = pos.metadata.Insert(ind + 1, get_references(t, out lines));
                     pos.line += lines;
                 }
                 pos.full_metadata_title = cps.CompiledProperty.DeclaringType.FullName + "." + cps.CompiledProperty.Name;
                 poses.Add(pos);
             }
             else if (ss is CompiledConstructorScope)
             {
                 CompiledConstructorScope ccs = ss as CompiledConstructorScope;
                 pos.from_metadata = true;
                 pos.line = 1;
                 pos.column = 1;
                 pos.metadata_title = prepare_file_name(ccs.CompiledConstructor.DeclaringType.Name);
                 pos.metadata_type = MetadataType.Constructor;
                 if (!only_check)
                 {
                     pos.metadata = CodeCompletionController.CurrentParser.LanguageInformation.GetCompiledTypeRepresentation(ccs.CompiledConstructor.DeclaringType, ccs.CompiledConstructor, ref pos.line, ref pos.column);
                     Type t = ccs.CompiledConstructor.DeclaringType;
                     int lines = 0;
                     int ind = pos.metadata.IndexOf('\n');
                     pos.metadata = pos.metadata.Insert(ind + 1, get_references(t, out lines));
                     pos.line += lines;
                 }
                 pos.full_metadata_title = ccs.CompiledConstructor.DeclaringType.FullName + "." + ccs.CompiledConstructor.DeclaringType.Name;
                 poses.Add(pos);
             }
             else if (ss is CompiledEventScope)
             {
                 CompiledEventScope ces = ss as CompiledEventScope;
                 pos.from_metadata = true;
                 pos.line = 1;
                 pos.column = 1;
                 pos.metadata_title = prepare_file_name(ces.CompiledEvent.DeclaringType.Name);
                 pos.metadata_type = MetadataType.Event;
                 if (!only_check)
                 {
                     pos.metadata = CodeCompletionController.CurrentParser.LanguageInformation.GetCompiledTypeRepresentation(ces.CompiledEvent.DeclaringType, ces.CompiledEvent, ref pos.line, ref pos.column);
                     Type t = ces.CompiledEvent.DeclaringType;
                     int lines = 0;
                     int ind = pos.metadata.IndexOf('\n');
                     pos.metadata = pos.metadata.Insert(ind + 1, get_references(t, out lines));
                     pos.line += lines;
                 }
                 pos.full_metadata_title = ces.CompiledEvent.DeclaringType.FullName + "." + ces.CompiledEvent.Name;
                 poses.Add(pos);
             }
             else if (ss is NamespaceScope)
             {
                 pos.from_metadata = true;
                 pos.line = 1;
                 pos.column = 1;
                 pos.metadata_title = prepare_file_name((ss as NamespaceScope).name);
                 pos.metadata_type = MetadataType.Event;
                 pos.full_metadata_title = (ss as NamespaceScope).GetFullName();
                 poses.Add(pos);
             }
 	    }
 	}
 	catch(Exception e)
 	{
 		
 	}
     RestoreCurrentUsedAssemblies();
 	return poses; 
 }
 /// <summary>
 /// Получить реализацию expr
 /// </summary>
 public List<Position> GetRealization(expression expr, int line, int col, PascalABCCompiler.Parsers.KeywordKind keyword)
 {
 	List<Position> poses = new List<Position>();
 	Position pos = new Position(); pos.line = -1; pos.column = -1;
 	try
 	{
 	    if (stv.cur_scope == null) return poses;
 	    SymScope ss = stv.FindScopeByLocation(line+1,col+1);//stv.cur_scope;
 	    if (ss == null) return poses;
 	    //if (!(expr is ident && string.Compare((expr as ident).name,ss.si.name) == 0))
 	    bool on_proc = false;
         SetCurrentUsedAssemblies();
 	    if (keyword == PascalABCCompiler.Parsers.KeywordKind.Function || keyword == PascalABCCompiler.Parsers.KeywordKind.Constructor || keyword == PascalABCCompiler.Parsers.KeywordKind.Destructor)
 	    {
 		    if (ss is ProcRealization)
 		    {
 			    if (expr is ident)
 			    {
 				    if ((expr as ident).name == (ss as ProcRealization).def_proc.si.name) 
                         on_proc = true;
 			    }
 			    else 
                     on_proc = true;
 		    }
 		    else if (ss is ProcScope)
 		    {
 			    if (expr is ident)
 			    {
 				    if ((expr as ident).name == (ss as ProcScope).si.name) 
                         on_proc = true;
 			    }
 			    else 
                     on_proc = true;
 		    }
 	    }
 	    //if (!((keyword == KeywordKind.kw_proc || keyword == KeywordKind.kw_constr || keyword == KeywordKind.kw_destr) && ss is ProcScope))
 	    if (!on_proc)
 	    //if (keyword != KeywordKind.kw_proc && keyword != KeywordKind.kw_constr && keyword != KeywordKind.kw_destr)
 	    {
 		    ExpressionVisitor ev = new ExpressionVisitor(expr, ss, stv);
 		    ss = ev.GetScopeOfExpression();
 	    }
 	    while (ss != null && ss is ProcScope && (ss as ProcScope).proc_realization != null && (ss as ProcScope).proc_realization.loc != null)
 	    {
 		    ProcRealization pr = (ss as ProcScope).proc_realization;
 		    pos.line = pr.loc.begin_line_num;
 		    pos.column = pr.loc.begin_column_num;
 		    pos.file_name = pr.loc.doc.file_name;
 		    poses.Add(pos);
 		    if (on_proc) break;
 		    //ss = (ss as ProcScope).nextProc;
 		    ss = null;
 	    }
 	}
 	catch (Exception e)
 	{
 		
 	}
     RestoreCurrentUsedAssemblies();
 	return poses; 
 }
        /// <summary>
        /// Получение списка нереализованных методов
        /// </summary>
        public ProcScope[] GetNotImplementedMethods(int line, int col, ref Position pos)
        {
            try
            {
                if (stv.cur_scope == null) return null;
                SymScope ss = stv.FindScopeByLocation(line + 1, col + 1);//stv.cur_scope;
                if (ss == null) return null;
                List<ProcScope> meths = new List<ProcScope>();
                pos.file_name = this.stv.doc.file_name;
                SetCurrentUsedAssemblies();
                if (ss is TypeScope && ((ss as TypeScope).kind == SymbolKind.Class || (ss as TypeScope).kind == SymbolKind.Struct))
                {
                    TypeScope ts = ss as TypeScope;

                    if (ts.topScope is InterfaceUnitScope)
                    {
                        SymScope impl_scope = (ts.topScope as InterfaceUnitScope).impl_scope;
                        if (impl_scope != null)
                        {
                            pos.line = impl_scope.loc.end_line_num;
                            pos.column = impl_scope.loc.end_column_num + 2;
                        }
                        else
                        {
                            pos.line = ts.loc.end_line_num;
                            pos.column = ts.loc.end_column_num + 2;
                        }
                    }
                    else
                    {
                        pos.line = ts.loc.end_line_num;
                        pos.column = ts.loc.end_column_num + 2;
                    }
                    foreach (SymScope symsc in ts.members)
                    {
                        if (symsc is ProcScope && !(symsc as ProcScope).already_defined && symsc.loc != null)
                        {
                            meths.Add(symsc as ProcScope);
                        }
                    }
                }
                else if (ss is ProcScope)
                {
                    TypeScope ts = (ss as ProcScope).topScope as TypeScope;
                    if (ts != null && (ts.kind == SymbolKind.Class || ts.kind == SymbolKind.Struct))
                    {
                        if (ts.topScope is InterfaceUnitScope)
                        {
                            SymScope impl_scope = (ts.topScope as InterfaceUnitScope).impl_scope;
                            if (impl_scope != null)
                            {
                                pos.line = impl_scope.loc.end_line_num;
                                pos.column = impl_scope.loc.end_column_num + 2;
                            }
                            else
                            {
                                pos.line = ts.loc.end_line_num;
                                pos.column = ts.loc.end_column_num + 2;
                            }
                        }
                        else
                        {
                            pos.line = ts.loc.end_line_num;
                            pos.column = ts.loc.end_column_num + 2;
                        }
                        foreach (SymScope symsc in ts.members)
                        {
                            if (symsc is ProcScope && !(symsc as ProcScope).already_defined && symsc.loc != null)
                            {
                                meths.Add(symsc as ProcScope);
                            }
                        }
                    }
                    else if (ts == null && (ss as ProcScope).topScope is InterfaceUnitScope)
                    {
                        SymScope impl_scope = ((ss as ProcScope).topScope as InterfaceUnitScope).impl_scope;
                        if (impl_scope != null)
                        {
                            pos.line = impl_scope.loc.end_line_num;
                            pos.column = impl_scope.loc.end_column_num + 2;
                            if (!(ss as ProcScope).already_defined && ss.loc != null)
                                meths.Add(ss as ProcScope);
                        }
                        /*else
                        {
                            pos.line = ss.loc.end_line_num;
                            pos.column = ss.loc.end_column_num+2;
                        }*/

                    }
                }
                RestoreCurrentUsedAssemblies();
                if (meths.Count > 0) return meths.ToArray();
            }
            catch
            {

            }
            RestoreCurrentUsedAssemblies();
        	return null;
        }
 public ProcScope[] GetNotImplementedMethodHeaders(int line, int col, ref Position pos)
 {
 	if (stv.cur_scope == null) return null;
 	SymScope ss = stv.FindScopeByLocation(line+1,col+1);//stv.cur_scope;
 	if (ss == null) return null;
 	List<ProcScope> meths = new List<ProcScope>();
 	pos.file_name = this.stv.doc.file_name;
     SetCurrentUsedAssemblies();
 	if (ss is TypeScope && (ss as TypeScope).kind == SymbolKind.Class)
 	{
 		TypeScope ts = ss as TypeScope;
 		pos.line = ts.real_body_loc.begin_line_num;
 		pos.column = ts.real_body_loc.begin_column_num;
 		if (ts.baseScope != null)
 		{
 			List<ProcScope> procs = ts.baseScope.GetAbstractMethods();
 			for (int i=0; i<procs.Count; i++)
 			{
 				SymScope elem = ts.FindNameOnlyInThisType(procs[i].Name);
 				if (elem == null || !(elem is ProcScope))
 				{
 					meths.Add(new ProcRealization(procs[i],ts));
 				}
 			}
 		}
 		if (ts.implemented_interfaces != null)
 		{
 			for (int i=0; i<ts.implemented_interfaces.Count; i++)
 			{
 				List<ProcScope> procs = ts.implemented_interfaces[i].GetAbstractMethods();
 				for (int j=0; j<procs.Count; j++)
 				{
 					SymScope elem = ts.FindNameOnlyInThisType(procs[j].Name);
 					if (elem == null || !(elem is ProcScope))
 					{
 						meths.Add(new ProcRealization(procs[j],ts));
 					}
 					else if (elem is ProcScope)
 					{
 						ProcScope ps = elem as ProcScope;
 						bool is_impl = false;
 						while (ps != null)
 						if (ps.IsEqual(elem))
 						{
 							is_impl = true;
 							break;
 						}
 						else ps = ps.nextProc;
 						if (!is_impl)
 							meths.Add(new ProcRealization(procs[j],ts));
 					}
 				}
 			}
 		}
 	}
     RestoreCurrentUsedAssemblies();
 	return meths.ToArray();
 }
 public static void GenerateClassOrMethodRealization(TextArea textArea)
 {
     if (CodeCompletion.CodeCompletionController.CurrentParser == null) return;
     ccp = new CodeCompletionProvider();
     Position pos = new Position();
     //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos);
     string text = ccp.GetRealizationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea);
     if (text != null && pos.file_name != null)
     {
         textArea.Caret.Line = pos.line - 1;
         textArea.Caret.Column = pos.column - 1;
         textArea.InsertString(text);
         textArea.Caret.Line = pos.line + 4 - 1;
         textArea.Caret.Column = VisualPABCSingleton.MainForm.UserOptions.CursorTabCount + 1;
     }
 }
        public static void GenerateMethodImplementationHeaders(TextArea textArea)
        {
            try
            {
                if (CodeCompletion.CodeCompletionController.CurrentParser == null) return;
                ccp = new CodeCompletionProvider();
                Position pos = new Position();
                //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos);
                string text = ccp.GetMethodImplementationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea);
                if (!string.IsNullOrEmpty(text) && pos.file_name != null)
                {
                    textArea.Caret.Line = pos.line - 1;
                    textArea.Caret.Column = 0;
                    textArea.InsertString(text);
                    textArea.Caret.Line = pos.line - 1;
                    textArea.Caret.Column = 0;
                }
            }
            catch (System.Exception e)
            {

            }
        }
 public static bool CanGenerateRealization(TextArea textArea)
 {
     try
     {
         if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false;
         ccp = new CodeCompletionProvider();
         Position pos = new Position();
         //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos);
         string text = ccp.GetRealizationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea);
         return text != null && pos.file_name != null;
     }
     catch (Exception e)
     {
         return false;
     }
 }