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

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ImportSymbolHandler.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
                        
82
82
                        foreach (IUsing u in unit.Usings.Where (u => u.ValidRegion.Contains (location))) {
83
83
                                foreach (string ns in u.Namespaces) {
84
 
                                        if (dom.SearchType (unit, unit.GetTypeAt (location), unit.GetMemberAt (location), ns + "." + name) != null) {
 
84
                                        if (dom.SearchType (unit, unit.GetTypeAt (location), location, ns + "." + name) != null) {
85
85
                                                result.GenerateUsing = false;
86
86
                                                result.InsertNamespace = true;
87
87
                                                return result;
111
111
                        this.doc = doc;
112
112
                        this.cache = cache;
113
113
                        this.dom = dom;
114
 
                        this.data = doc.TextEditorData;
 
114
                        this.data = doc.Editor;
115
115
                        this.ambience = doc.Project != null ? doc.Project.Ambience : AmbienceService.GetAmbienceForFile (doc.FileName);
116
116
                        this.type = type;
117
117
                        this.unit = doc.CompilationUnit;
137
137
                {
138
138
                        Initialize ();
139
139
                        string text = insertNamespace ? type.Namespace + "." + type.Name : type.Name;
140
 
                        if (text != GetCurrentWord (window)) 
 
140
                        if (text != GetCurrentWord (window)) {
 
141
                                if (window.WasShiftPressed && generateUsing) 
 
142
                                        text = type.Namespace + "." + text;
141
143
                                window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, GetCurrentWord (window), text);
142
 
                        if (generateUsing) {
 
144
                        }
 
145
                        
 
146
                        if (!window.WasShiftPressed && generateUsing) {
143
147
                                CodeRefactorer refactorer = IdeApp.Workspace.GetCodeRefactorer (IdeApp.ProjectOperations.CurrentSelectedSolution);
144
148
                                refactorer.AddGlobalNamespaceImport (dom, data.Document.FileName, type.Namespace);
145
149
                                // add using to compilation unit (this way the using is valid before the parser thread updates)