~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric-updates

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
using System.Xml;
35
35
 
36
36
using MonoDevelop.Core;
 
37
using MonoDevelop.Projects.Gui.Completion;
37
38
 
38
39
namespace MonoDevelop.Ide.CodeTemplates
39
40
{
77
78
                        }
78
79
                        return null;
79
80
                }
80
 
 
 
81
                
 
82
                public static void AddCompletionDataForFileName (string fileName, CompletionDataList list)
 
83
                {
 
84
                        AddCompletionDataForExtension (Path.GetExtension (fileName), list);
 
85
                }
 
86
                
 
87
                public static void AddCompletionDataForExtension (string extension, CompletionDataList list)
 
88
                {
 
89
                        CodeTemplateGroup group = GetTemplateGroupPerExtension (extension);
 
90
                        if (group == null)
 
91
                                return;
 
92
                        foreach (CodeTemplate ct in group.Templates) {
 
93
                                if (string.IsNullOrEmpty (ct.Shortcut))
 
94
                                        continue;
 
95
                                list.Remove (ct.Shortcut);
 
96
                                list.Add (new CompletionData (ct.Shortcut, "md-literal", ct.Description));
 
97
                        }
 
98
                }
 
99
                
81
100
#region I/O
82
101
                const string Node             = "CodeTemplates";
83
102
                const string VersionAttribute = "version";