Beispiel #1
0
        public override void InsertCompletionText(CompletionListWindow window)
        {
            Initialize();
            string text = insertNamespace ? type.Namespace + "." + type.Name : type.Name;

            if (text != GetCurrentWord(window))
            {
                window.CompletionWidget.SetCompletionText(window.CodeCompletionContext, GetCurrentWord(window), text);
            }
            if (generateUsing)
            {
                CodeRefactorer refactorer = IdeApp.Workspace.GetCodeRefactorer(IdeApp.ProjectOperations.CurrentSelectedSolution);
                refactorer.AddGlobalNamespaceImport(dom, data.Document.FileName, type.Namespace);
                // add using to compilation unit (this way the using is valid before the parser thread updates)
                ((MonoDevelop.Projects.Dom.CompilationUnit)doc.CompilationUnit).AddAtTop(new DomUsing(new DomRegion(1, 1, int.MaxValue, 1), type.Namespace));
            }
        }