From a2add0b62ec288c12330b57e550a60d22cd243ff Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 14 Aug 2011 15:10:47 +0200 Subject: [PATCH] WIP --- TODOnewNR.txt | 17 +- .../Project/CSharpBinding.csproj | 10 + .../AvalonEdit.AddIn/AvalonEdit.AddIn.csproj | 10 + .../Src/AvalonEditEditorUIService.cs | 1 + .../Src/AvalonEditViewContent.cs | 9 +- .../Src/CaretReferencesRenderer.cs | 18 +- .../Src/ChangeMarkerMargin.cs | 2 +- .../AvalonEdit.AddIn/Src/CodeEditor.cs | 36 +-- .../AvalonEdit.AddIn/Src/CodeEditorView.cs | 52 ++-- .../AvalonEdit.AddIn/Src/CodeManipulation.cs | 3 +- .../Src/Commands/FoldingCommands.cs | 4 +- .../Src/Commands/SortSelectionCommand.cs | 9 +- .../Src/ContextActionsRenderer.cs | 2 + .../Src/DefaultChangeWatcher.cs | 47 ++-- .../Src/ExpressionHighlightRenderer.cs | 2 + .../AvalonEdit.AddIn/Src/IconBarManager.cs | 10 +- .../Src/InlineUIElementGenerator.cs | 1 + .../AvalonEdit.AddIn/Src/LineChangeInfo.cs | 60 ++-- .../Src/MyersDiff/DocumentSequence.cs | 1 + .../Src/NewLineConsistencyCheck.cs | 2 +- .../Src/ParserFoldingStrategy.cs | 16 +- .../AvalonEdit.AddIn/Src/QuickClassBrowser.cs | 38 +-- .../Src/SharpDevelopCompletionWindow.cs | 1 + .../Src/SharpDevelopTextEditor.cs | 1 - .../Src/Snippets/CodeSnippet.cs | 12 +- .../AvalonEdit.AddIn/Src/TextMarkerService.cs | 14 +- .../DirectoryDocumentIterator.cs | 2 +- .../WholeProjectDocumentIterator.cs | 2 +- .../WholeSolutionDocumentIterator.cs | 2 +- .../GitAddIn/Src/OverlayIconManager.cs | 2 +- .../OverlayIconManager.cs | 2 +- .../SubversionAddIn/SubversionAddIn.csproj | 5 - .../CSharp/Parser/ParsedFile.cs | 4 +- .../TypeSystem/ExtensionMethods.cs | 2 +- .../TypeSystem/IParsedFile.cs | 2 +- .../Project/ICSharpCode.SharpDevelop.csproj | 13 +- .../Project/Src/Commands/AutostartCommands.cs | 2 +- .../Project/Src/Gui/Dialogs/GotoDialog.cs | 3 +- .../Project/Src/Gui/Dialogs/NewFileDialog.cs | 1 + .../IDEOptions/TaskListOptions.cs | 2 +- .../ProjectOptions/ApplicationSettings.cs | 1 + .../ReferenceDialog/GacReferencePanel.cs | 1 + .../Src/Gui/Dialogs/WordCountDialog.cs | 2 +- .../Commands/ReferenceFolderNodeCommands.cs | 2 +- .../Src/Gui/Pads/PropertyPad/PropertyPad.cs | 1 + .../Src/Gui/Pads/TaskList/TaskListPad.cs | 3 +- .../Project/Src/Gui/Workbench/WpfWorkbench.cs | 1 + .../Project/Src/Gui/WorkbenchSingleton.cs | 1 + .../Templates/Project/ProjectDescriptor.cs | 2 +- .../Base/Project/Src/Project/CustomTool.cs | 3 +- .../Src/Project/Items/ReferenceProjectItem.cs | 2 +- .../Project/Src/Project/MSBuildInternals.cs | 2 +- .../Project/Src/Services/File/FileService.cs | 2 +- .../Project/Src/Services/File/OpenedFile.cs | 3 +- .../NavigationService/NavigationService.cs | 1 + .../ParserService/AssemblyParserService.cs | 2 +- .../ParserService/CodeCompletionOptions.cs | 2 + .../Services/ParserService/DomAssemblyName.cs | 2 +- .../ParserService/Doozer/ParserDescriptor.cs | 2 +- .../ParserService/Doozer/ParserDoozer.cs | 2 +- .../Src/Services/ParserService/Fusion.cs | 2 +- .../Src/Services/ParserService/GacInterop.cs | 3 +- .../ParserService}/IParser.cs | 21 +- .../ParserService/LoadSolutionProjects.cs | 2 +- .../ParserService/ParseInformation.cs | 34 ++- .../ParseInformationEventArgs.cs | 2 +- .../ParserService/ParseProjectContent.cs | 2 +- .../Services/ParserService/ParserService.cs | 256 ++++++++---------- .../ParseableFileContentFinder.cs | 1 + .../Services/ProjectService/ProjectService.cs | 2 +- .../Project/Src/Services/Tasks/TaskService.cs | 4 +- .../Base/Project/Src/Util/ExtensionMethods.cs | 37 ++- .../ICSharpCode.SharpDevelop.Sda.csproj | 10 +- .../Src/CallHelper.cs | 5 +- .../Src/Document.cs | 3 +- src/Main/StartUp/Project/StartUp.csproj | 4 - 76 files changed, 429 insertions(+), 418 deletions(-) rename src/Main/Base/Project/Src/{Project => Services/ParserService}/IParser.cs (72%) diff --git a/TODOnewNR.txt b/TODOnewNR.txt index 919327e636..3b7cb7e57c 100644 --- a/TODOnewNR.txt +++ b/TODOnewNR.txt @@ -14,14 +14,29 @@ Commented code, needs to be ported and re-enabled: NamespaceRefactoringsService RefactoringMenuBuilder TaskService.UpdateCommentTags + CodeManipulation.cs (btw, I think this doesn't belong into AvalonEdit.AddIn - more a job for a language binding) Stuff that was renamed/moved: ICSharpCode.SharpDevelop.Dom -> the type system and resolvers now are part of ICSharpCode.NRefactory IDocument, ITextEditor -> moved to ICSharpCode.Editor assembly IClass -> ITypeDefinition - ParseInformation -> IParsedFile ICompilationUnit -> IParsedFile ITextBuffer -> ITextSource (in ICSharpCode.Editor assembly) IReturnType -> ITypeReference (unresolved) or IType (resolved) Location -> TextLocation or AstLocation. Use AstLocation only when directly working with the AST, and TextLocation otherwise. TextLocation -> moved to ICSharpCode.Editor assembly + +Functionality changes: + The result of a parser run (ParseInformation) now may contain a fully parsed AST. + The ParserService may cache such full ASTs, but may also drop them from memory at any time. + This is implemented by keeping the last N accessed files in the cache. + Every parse information also contains an IParsedFile instance with the type system information. + The IParsedFile is stored permanently (both in ParserService and in the IProjectContents). + + +Context Actions vs. Member Context Menu: + Members context menu should include refactoring options that can be applied from the outside, + for example in the classes pad when the code file isn't open. + Refactorings that don't make sense without opening the file shouldn't be in the member menu. + + The context actions menu should show all refactorings (even those that are also in the members context menu). diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj index c66f3976c4..c46d7acc8c 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj @@ -88,6 +88,16 @@ ICSharpCode.AvalonEdit False + + {F054A788-B591-4561-A8BA-AE745BBEB817} + ICSharpCode.Editor + False + + + {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} + ICSharpCode.NRefactory + False + {2748AD25-9C63-4E12-877B-4DCE96FBED54} ICSharpCode.SharpDevelop diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj index c73a4278a0..75aa864ed1 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj @@ -197,6 +197,16 @@ Mono.Cecil False + + {F054A788-B591-4561-A8BA-AE745BBEB817} + ICSharpCode.Editor + False + + + {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} + ICSharpCode.NRefactory + False + {2748AD25-9C63-4E12-877B-4DCE96FBED54} ICSharpCode.SharpDevelop diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditEditorUIService.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditEditorUIService.cs index 3553e6b1dd..383ece0d79 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditEditorUIService.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditEditorUIService.cs @@ -5,6 +5,7 @@ using System; using System.Windows; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs index 0f6e95a0aa..395c7a8300 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs @@ -11,11 +11,12 @@ using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Utils; using ICSharpCode.Core; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Bookmarks; -using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.AvalonEdit.AddIn @@ -175,7 +176,7 @@ namespace ICSharpCode.AvalonEdit.AddIn codeEditor.FileName = newFileName; - ParserService.BeginParse(file.FileName, codeEditor.DocumentAdapter); + ParserService.ParseAsync(file.FileName, codeEditor.Document); } } @@ -277,9 +278,9 @@ namespace ICSharpCode.AvalonEdit.AddIn } #region IEditable - public ITextBuffer CreateSnapshot() + public ITextSource CreateSnapshot() { - return codeEditor.DocumentAdapter.CreateSnapshot(); + return codeEditor.Document.CreateSnapshot(); } /// diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs index f8b4a9b5f0..60d8225ad9 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs @@ -9,14 +9,13 @@ using System.Windows.Threading; using ICSharpCode.AvalonEdit.AddIn.Options; using ICSharpCode.Core; using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Refactoring; namespace ICSharpCode.AvalonEdit.AddIn { - /// + /* /// /// In the code editor, highlights all references to the expression under the caret (for better code readability). /// public class CaretReferencesRenderer @@ -142,7 +141,7 @@ namespace ICSharpCode.AvalonEdit.AddIn delegate { LoggingService.Debug("Aborting FindReferencesInCurrentFile due to timeout"); cancellationTokenSource.Cancel(); - }, null, findReferencesTimeoutMs, Timeout.Infinite)) + }, null, findReferencesTimeoutMs, Timeout.Infinite)) { var progressMonitor = new DummyProgressMonitor(); progressMonitor.CancellationToken = cancellationTokenSource.Token; @@ -159,12 +158,12 @@ namespace ICSharpCode.AvalonEdit.AddIn /// bool SameResolveResult(ResolveResult resolveResult, ResolveResult resolveResult2) { - /*if (resolveResult == null && resolveResult2 == null) - return true; - if (resolveResult == null && resolveResult2 != null) - return false; - if (resolveResult != null && resolveResult2 == null) - return false;*/ + //if (resolveResult == null && resolveResult2 == null) + // return true; + //if (resolveResult == null && resolveResult2 != null) + // return false; + //if (resolveResult != null && resolveResult2 == null) + // return false; // TODO determine if 2 ResolveResults refer to the same symbol return false; } @@ -178,4 +177,5 @@ namespace ICSharpCode.AvalonEdit.AddIn timer.Start(); } } + */ } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs index 7f2730df6a..5194d50900 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs @@ -198,7 +198,7 @@ namespace ICSharpCode.AvalonEdit.AddIn if (added) delimiter = l.DelimiterLength; if (length == 0) - oldText += DocumentUtilitites.GetLineTerminator(new AvalonEditDocumentAdapter(Document, null), l.LineNumber); + oldText += DocumentUtilitites.GetLineTerminator(this.Document, l.LineNumber); Document.Replace(offset, length + delimiter, oldText); tooltip.IsOpen = false; } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs index dc66da99af..7c737bb4d3 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs @@ -13,7 +13,6 @@ using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; using System.Windows.Threading; - using ICSharpCode.AvalonEdit.AddIn.Options; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Editing; @@ -22,24 +21,16 @@ using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Utils; using ICSharpCode.Core; using ICSharpCode.Core.Presentation; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Bookmarks; -using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.AvalonEdit; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.AvalonEdit.AddIn { - public interface ICodeEditor - { - TextDocument Document { get; } - - void Redraw(ISegment segment, DispatcherPriority priority); - - event EventHandler DocumentChanged; - } - /// /// Integrates AvalonEdit with SharpDevelop. /// Also provides support for Split-View (showing two AvalonEdit instances using the same TextDocument) @@ -93,8 +84,9 @@ namespace ICSharpCode.AvalonEdit.AddIn public event EventHandler DocumentChanged; + [Obsolete("Use CodeEditor.Document instead; TextDocument now directly implements IDocument")] public IDocument DocumentAdapter { - get { return primaryTextEditorAdapter.Document; } + get { return this.Document; } } public ITextEditor PrimaryTextEditorAdapter { @@ -126,7 +118,7 @@ namespace ICSharpCode.AvalonEdit.AddIn } else { this.errorPainter.UpdateErrors(); } - changeWatcher.Initialize(this.DocumentAdapter); + changeWatcher.Initialize(this.Document, fileName); FetchParseInformation(); } @@ -375,7 +367,7 @@ namespace ICSharpCode.AvalonEdit.AddIn void HandleCaretPositionChange() { if (quickClassBrowser != null) { - quickClassBrowser.SelectItemAtCaretPosition(this.ActiveTextEditorAdapter.Caret.Position); + quickClassBrowser.SelectItemAtCaretPosition(this.ActiveTextEditor.TextArea.Caret.Location); } CaretPositionChanged.RaiseEvent(this, EventArgs.Empty); @@ -470,7 +462,7 @@ namespace ICSharpCode.AvalonEdit.AddIn // Immediately parse on enter. // This ensures we have up-to-date CC info about the method boundary when a user // types near the end of a method. - ParserService.BeginParse(this.FileName, this.DocumentAdapter.CreateSnapshot()); + ParserService.ParseAsync(this.FileName, this.DocumentAdapter.CreateSnapshot()); } } } @@ -526,10 +518,10 @@ namespace ICSharpCode.AvalonEdit.AddIn void FetchParseInformation() { - ParseInformation parseInfo = ParserService.GetExistingParseInformation(this.FileName); + ParseInformation parseInfo = ParserService.GetExistingParsedFile(this.FileName); if (parseInfo == null) { // if parse info is not yet available, start parsing on background - ParserService.BeginParse(this.FileName, primaryTextEditorAdapter.Document); + ParserService.ParseAsync(this.FileName, primaryTextEditorAdapter.Document); // we'll receive the result using the ParseInformationUpdated event } ParseInformationUpdated(parseInfo); @@ -544,7 +536,7 @@ namespace ICSharpCode.AvalonEdit.AddIn this.VerifyAccess(); // When parse information is updated quickly in succession, only do a single update // to the latest version. - updateParseInfoTo = e.NewParsedFile; + updateParseInfoTo = e.NewParseInformation; this.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action( @@ -561,15 +553,15 @@ namespace ICSharpCode.AvalonEdit.AddIn if (parseInfo != null && CodeEditorOptions.Instance.EnableQuickClassBrowser) { // don't create quickClassBrowser for files that don't have any classes // (but do keep the quickClassBrowser when the last class is removed from a file) - if (quickClassBrowser != null || parseInfo.CompilationUnit.Classes.Count > 0) { + if (quickClassBrowser != null || parseInfo.ParsedFile.TopLevelTypeDefinitions.Count > 0) { if (quickClassBrowser == null) { quickClassBrowser = new QuickClassBrowser(); quickClassBrowser.JumpAction = (line, col) => ActiveTextEditor.JumpTo(line, col); SetRow(quickClassBrowser, 0); this.Children.Add(quickClassBrowser); } - quickClassBrowser.Update(parseInfo.CompilationUnit); - quickClassBrowser.SelectItemAtCaretPosition(this.ActiveTextEditorAdapter.Caret.Position); + quickClassBrowser.Update(parseInfo.ParsedFile); + quickClassBrowser.SelectItemAtCaretPosition(this.ActiveTextEditor.TextArea.Caret.Location); } } else { if (quickClassBrowser != null) { @@ -577,7 +569,7 @@ namespace ICSharpCode.AvalonEdit.AddIn quickClassBrowser = null; } } - iconBarManager.UpdateClassMemberBookmarks(parseInfo); + iconBarManager.UpdateClassMemberBookmarks(parseInfo.ParsedFile); primaryTextEditor.UpdateParseInformationForFolding(parseInfo); if (secondaryTextEditor != null) secondaryTextEditor.UpdateParseInformationForFolding(parseInfo); diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs index 84fcc5a492..6a358e091e 100755 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs @@ -14,21 +14,18 @@ using System.Windows.Controls.Primitives; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Threading; - using ICSharpCode.AvalonEdit.AddIn.Options; using ICSharpCode.AvalonEdit.AddIn.Snippets; using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Rendering; -using ICSharpCode.NRefactory; using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.AvalonEdit; using ICSharpCode.SharpDevelop.Editor.Commands; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Refactoring; -using Ast = ICSharpCode.NRefactory.Ast; namespace ICSharpCode.AvalonEdit.AddIn { @@ -42,8 +39,8 @@ namespace ICSharpCode.AvalonEdit.AddIn public ITextEditor Adapter { get; set; } BracketHighlightRenderer bracketRenderer; - CaretReferencesRenderer caretReferencesRenderer; - ContextActionsRenderer contextActionsRenderer; + //CaretReferencesRenderer caretReferencesRenderer; + //ContextActionsRenderer contextActionsRenderer; HiddenDefinition.HiddenDefinitionRenderer hiddenDefinitionRenderer; public CodeEditorView() @@ -51,8 +48,8 @@ namespace ICSharpCode.AvalonEdit.AddIn this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Help, OnHelpExecuted)); this.bracketRenderer = new BracketHighlightRenderer(this.TextArea.TextView); - this.caretReferencesRenderer = new CaretReferencesRenderer(this); - this.contextActionsRenderer = new ContextActionsRenderer(this); + //this.caretReferencesRenderer = new CaretReferencesRenderer(this); + //this.contextActionsRenderer = new ContextActionsRenderer(this); this.hiddenDefinitionRenderer = new HiddenDefinition.HiddenDefinitionRenderer(this); UpdateCustomizedHighlighting(); @@ -76,7 +73,7 @@ namespace ICSharpCode.AvalonEdit.AddIn public virtual void Dispose() { - contextActionsRenderer.Dispose(); + //contextActionsRenderer.Dispose(); hiddenDefinitionRenderer.Dispose(); } @@ -92,8 +89,8 @@ namespace ICSharpCode.AvalonEdit.AddIn else if (e.PropertyName == "EnableFolding") UpdateParseInformationForFolding(); else if (e.PropertyName == "HighlightSymbol") { - if (this.caretReferencesRenderer != null) - this.caretReferencesRenderer.ClearHighlight(); + //if (this.caretReferencesRenderer != null) + // this.caretReferencesRenderer.ClearHighlight(); } } @@ -204,6 +201,8 @@ namespace ICSharpCode.AvalonEdit.AddIn public void ShowHelp() { // Resolve expression at cursor and show help + #warning Reimplement ShowHelp() + /* TextArea textArea = this.TextArea; IExpressionFinder expressionFinder = ParserService.GetExpressionFinder(this.Adapter.FileName); if (expressionFinder == null) @@ -221,7 +220,7 @@ namespace ICSharpCode.AvalonEdit.AddIn if (mrr != null) { HelpProvider.ShowHelp(mrr.ResolvedMember); } - } + }*/ } #endregion @@ -236,12 +235,12 @@ namespace ICSharpCode.AvalonEdit.AddIn var pos = GetPositionFromPoint(e.GetPosition(this)); args.InDocument = pos.HasValue; if (pos.HasValue) { - args.LogicalPosition = AvalonEditDocumentAdapter.ToLocation(pos.Value); + args.LogicalPosition = pos.Value; } TextMarkerService textMarkerService = this.Adapter.GetService(typeof(ITextMarkerService)) as TextMarkerService; if (args.InDocument && textMarkerService != null) { - var markersAtOffset = textMarkerService.GetMarkersAtOffset(args.Editor.Document.PositionToOffset(args.LogicalPosition.Line, args.LogicalPosition.Column)); + var markersAtOffset = textMarkerService.GetMarkersAtOffset(args.Editor.Document.GetOffset(args.LogicalPosition)); ITextMarker markerWithToolTip = markersAtOffset.FirstOrDefault(marker => marker.ToolTip != null); @@ -386,16 +385,6 @@ namespace ICSharpCode.AvalonEdit.AddIn #endregion #region Ctrl+Click Go To Definition - GoToDefinition goToDefinitionCommand; - protected GoToDefinition GotoDefinitionCommand { - get - { - if (goToDefinitionCommand == null) - goToDefinitionCommand = new GoToDefinition(); - return goToDefinitionCommand; - } - } - void TextViewMouseDown(object sender, MouseButtonEventArgs e) { // close existing debugger popup immediately on text editor mouse down @@ -406,8 +395,10 @@ namespace ICSharpCode.AvalonEdit.AddIn var position = GetPositionFromPoint(e.GetPosition(this)); if (position == null) return; - Core.AnalyticsMonitorService.TrackFeature(typeof(GoToDefinition).FullName, "Ctrl+Click"); - this.GotoDefinitionCommand.Run(this.Adapter, this.Document.GetOffset(position.Value)); + throw new NotImplementedException(); + //Core.AnalyticsMonitorService.TrackFeature(typeof(GoToDefinition).FullName, "Ctrl+Click"); + //var goToDefinitionCommand = new GoToDefinition(); + //goToDefinitionCommand.Run(this.Adapter, this.Document.GetOffset(position.Value)); e.Handled = true; } } @@ -418,6 +409,9 @@ namespace ICSharpCode.AvalonEdit.AddIn { base.OnKeyUp(e); if (e.Handled) return; + #warning Reimplement CodeManipulation + // TODO put these in some menu so that they are discoverable + /* if (e.Key == Key.W && Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) { CodeManipulation.ExtendSelection(this.Adapter); } @@ -428,7 +422,7 @@ namespace ICSharpCode.AvalonEdit.AddIn if (e.SystemKey == Key.Down && Keyboard.Modifiers.HasFlag(ModifierKeys.Alt)) { // Left Alt + Down (probably will have different shortcut) CodeManipulation.MoveStatementDown(this.Adapter); - } + }*/ } #endregion @@ -456,13 +450,13 @@ namespace ICSharpCode.AvalonEdit.AddIn CaretHighlightAdorner adorner = new CaretHighlightAdorner(textArea); layer.Add(adorner); - WorkbenchSingleton.CallLater(TimeSpan.FromSeconds(1), (Action)(() => layer.Remove(adorner))); + WorkbenchSingleton.CallLater(TimeSpan.FromSeconds(1), () => layer.Remove(adorner)); } #region UpdateParseInformation - Folding void UpdateParseInformationForFolding() { - UpdateParseInformationForFolding(ParserService.GetExistingParseInformation(this.Adapter.FileName)); + UpdateParseInformationForFolding(ParserService.GetExistingParsedFile(this.Adapter.FileName)); } bool disableParseInformationFolding; diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeManipulation.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeManipulation.cs index a6bed52ca0..3c831fe03f 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeManipulation.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeManipulation.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; - +/* using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Ast; using ICSharpCode.SharpDevelop; @@ -288,3 +288,4 @@ namespace ICSharpCode.AvalonEdit.AddIn } } } +*/ \ No newline at end of file diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs index 6ee83c1c44..db9c792c6a 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs @@ -20,8 +20,8 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands if (strategy != null) { // look for folding on this line: - FoldingSection folding = strategy.FoldingManager.GetNextFolding(editor.Document.PositionToOffset(editor.Caret.Line, 1)); - if (folding == null || editor.Document.GetLineForOffset(folding.StartOffset).LineNumber != editor.Caret.Line) { + FoldingSection folding = strategy.FoldingManager.GetNextFolding(editor.Document.GetOffset(editor.Caret.Line, 1)); + if (folding == null || editor.Document.GetLineByOffset(folding.StartOffset).LineNumber != editor.Caret.Line) { // no folding found on current line: find innermost folding containing the caret folding = strategy.FoldingManager.GetFoldingsContaining(editor.Caret.Offset).LastOrDefault(); } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/SortSelectionCommand.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/SortSelectionCommand.cs index 98ffffedf4..330acd339d 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/SortSelectionCommand.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/SortSelectionCommand.cs @@ -4,6 +4,7 @@ using System; using System.Linq; using ICSharpCode.Core; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui; using System.Collections.Generic; @@ -27,11 +28,11 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands if (provider != null) { ITextEditor editor = provider.TextEditor; if (editor.SelectionLength > 0) { - int start = editor.Document.GetLineForOffset(editor.SelectionStart).LineNumber; - int end = editor.Document.GetLineForOffset(editor.SelectionStart + editor.SelectionLength).LineNumber; + int start = editor.Document.GetLineByOffset(editor.SelectionStart).LineNumber; + int end = editor.Document.GetLineByOffset(editor.SelectionStart + editor.SelectionLength).LineNumber; SortLines(editor.Document, start, end, comparer, SortOptions.RemoveDuplicates); } else { - SortLines(editor.Document, 1, editor.Document.TotalNumberOfLines, comparer, SortOptions.RemoveDuplicates); + SortLines(editor.Document, 1, editor.Document.LineCount, comparer, SortOptions.RemoveDuplicates); } } } @@ -41,7 +42,7 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands { List lines = new List(); for (int i = startLine; i <= endLine; ++i) { - IDocumentLine line = document.GetLine(i); + IDocumentLine line = document.GetLineByNumber(i); lines.Add(document.GetText(line.Offset, line.Length)); } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActionsRenderer.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActionsRenderer.cs index 1cc38a369d..d502716598 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActionsRenderer.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActionsRenderer.cs @@ -15,6 +15,7 @@ using ICSharpCode.SharpDevelop.Refactoring; namespace ICSharpCode.AvalonEdit.AddIn { + /* /// /// Renders Popup with context actions on the left side of the current line in the editor. /// @@ -154,4 +155,5 @@ namespace ICSharpCode.AvalonEdit.AddIn ClosePopup(); } } + */ } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs index b46890e08d..ee1f9c60e2 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs @@ -11,6 +11,8 @@ using System.Text; using ICSharpCode.AvalonEdit.AddIn.MyersDiff; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Utils; +using ICSharpCode.Core; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.AvalonEdit; @@ -20,9 +22,8 @@ namespace ICSharpCode.AvalonEdit.AddIn public class DefaultChangeWatcher : IChangeWatcher, ILineTracker { CompressingTreeList changeList; - IDocument document; - TextDocument textDocument; - IDocument baseDocument; + TextDocument document; + ReadOnlyDocument baseDocument; public event EventHandler ChangeOccurred; @@ -38,33 +39,31 @@ namespace ICSharpCode.AvalonEdit.AddIn return changeList[lineNumber]; } - public void Initialize(IDocument document) + public void Initialize(TextDocument document, FileName fileName) { if (changeList != null && changeList.Any()) return; this.document = document; - this.textDocument = (TextDocument)document.GetService(typeof(TextDocument)); this.changeList = new CompressingTreeList((x, y) => x.Equals(y)); - Stream baseFileStream = GetBaseVersion(); + Stream baseFileStream = GetBaseVersion(fileName); // TODO : update baseDocument on VCS actions if (baseFileStream != null) { // ReadAll() is taking care of closing the stream - baseDocument = DocumentUtilitites.LoadReadOnlyDocumentFromBuffer(new StringTextBuffer(ReadAll(baseFileStream))); + baseDocument = new ReadOnlyDocument(ReadAll(baseFileStream)); } else { if (baseDocument == null) { // if the file is not under subversion, the document is the opened document - var doc = new TextDocument(textDocument.Text); - baseDocument = new AvalonEditDocumentAdapter(doc, null); + baseDocument = new ReadOnlyDocument(document); } } SetupInitialFileState(false); - this.textDocument.LineTrackers.Add(this); - this.textDocument.UndoStack.PropertyChanged += UndoStackPropertyChanged; + this.document.LineTrackers.Add(this); + this.document.UndoStack.PropertyChanged += UndoStackPropertyChanged; } LineChangeInfo TransformLineChangeInfo(LineChangeInfo info) @@ -81,7 +80,7 @@ namespace ICSharpCode.AvalonEdit.AddIn if (update) changeList.Transform(TransformLineChangeInfo); else - changeList.InsertRange(0, document.TotalNumberOfLines + 1, LineChangeInfo.Empty); + changeList.InsertRange(0, document.LineCount + 1, LineChangeInfo.Empty); } else { changeList.Clear(); @@ -110,7 +109,7 @@ namespace ICSharpCode.AvalonEdit.AddIn lastEndLine = endLine; } - changeList.InsertRange(changeList.Count, textDocument.LineCount - lastEndLine, LineChangeInfo.Empty); + changeList.InsertRange(changeList.Count, document.LineCount - lastEndLine, LineChangeInfo.Empty); } OnChangeOccurred(EventArgs.Empty); @@ -123,10 +122,8 @@ namespace ICSharpCode.AvalonEdit.AddIn } } - Stream GetBaseVersion() + Stream GetBaseVersion(FileName fileName) { - string fileName = ((ITextEditor)document.GetService(typeof(ITextEditor))).FileName; - foreach (IDocumentVersionProvider provider in VersioningServices.Instance.DocumentVersionProviders) { var result = provider.OpenBaseVersion(fileName); if (result != null) @@ -136,9 +133,9 @@ namespace ICSharpCode.AvalonEdit.AddIn return null; } - void UndoStackPropertyChanged(object sender, PropertyChangedEventArgs e) + void UndoStackPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { - if (e.PropertyName == "IsOriginalFile" && textDocument.UndoStack.IsOriginalFile) + if (e.PropertyName == "IsOriginalFile" && document.UndoStack.IsOriginalFile) SetupInitialFileState(true); } @@ -167,7 +164,7 @@ namespace ICSharpCode.AvalonEdit.AddIn void ILineTracker.RebuildDocument() { changeList.Clear(); - changeList.InsertRange(0, document.TotalNumberOfLines + 1, new LineChangeInfo(ChangeType.Unsaved, 1, 1, baseDocument.TotalNumberOfLines, document.TotalNumberOfLines)); + changeList.InsertRange(0, document.LineCount + 1, new LineChangeInfo(ChangeType.Unsaved, 1, 1, baseDocument.LineCount, document.LineCount)); } bool disposed = false; @@ -175,8 +172,8 @@ namespace ICSharpCode.AvalonEdit.AddIn public void Dispose() { if (!disposed) { - this.textDocument.LineTrackers.Remove(this); - this.textDocument.UndoStack.PropertyChanged -= UndoStackPropertyChanged; + this.document.LineTrackers.Remove(this); + this.document.UndoStack.PropertyChanged -= UndoStackPropertyChanged; disposed = true; } } @@ -193,8 +190,8 @@ namespace ICSharpCode.AvalonEdit.AddIn if (info.Change == ChangeType.Added) return ""; - var startDocumentLine = baseDocument.GetLine(info.OldStartLineNumber + 1); - var endLine = baseDocument.GetLine(info.OldEndLineNumber); + var startDocumentLine = baseDocument.GetLineByNumber(info.OldStartLineNumber + 1); + var endLine = baseDocument.GetLineByNumber(info.OldEndLineNumber); return baseDocument.GetText(startDocumentLine.Offset, endLine.EndOffset - startDocumentLine.Offset); } @@ -208,8 +205,8 @@ namespace ICSharpCode.AvalonEdit.AddIn LineChangeInfo info = changeList[lineNumber]; if (info.Change != ChangeType.None && info.Change != ChangeType.Unsaved) { - var startLine = document.GetLine(info.NewStartLineNumber + 1); - var endLine = document.GetLine(info.NewEndLineNumber); + var startLine = document.GetLineByNumber(info.NewStartLineNumber + 1); + var endLine = document.GetLineByNumber(info.NewEndLineNumber); offset = startLine.Offset; length = endLine.EndOffset - startLine.Offset; diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ExpressionHighlightRenderer.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ExpressionHighlightRenderer.cs index 925d18ecfe..68740ba463 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ExpressionHighlightRenderer.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ExpressionHighlightRenderer.cs @@ -13,6 +13,7 @@ using ICSharpCode.SharpDevelop.Refactoring; namespace ICSharpCode.AvalonEdit.AddIn { + /* /// /// Highlights expressions (references to expression under current caret). /// @@ -77,4 +78,5 @@ namespace ICSharpCode.AvalonEdit.AddIn } } } + */ } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/IconBarManager.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/IconBarManager.cs index 9ec975baa9..fbc3fc0898 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/IconBarManager.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/IconBarManager.cs @@ -1,11 +1,11 @@ // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) -using ICSharpCode.SharpDevelop.Dom; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; +using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Bookmarks; namespace ICSharpCode.AvalonEdit.AddIn @@ -40,7 +40,7 @@ namespace ICSharpCode.AvalonEdit.AddIn public event EventHandler RedrawRequested; - public void UpdateClassMemberBookmarks(ParseInformation parseInfo) + public void UpdateClassMemberBookmarks(IParsedFile parseInfo) { for (int i = bookmarks.Count - 1; i >= 0; i--) { if (IsClassMemberBookmark(bookmarks[i])) @@ -48,18 +48,18 @@ namespace ICSharpCode.AvalonEdit.AddIn } if (parseInfo == null) return; - foreach (IClass c in parseInfo.CompilationUnit.Classes) { + foreach (ITypeDefinition c in parseInfo.TopLevelTypeDefinitions) { AddClassMemberBookmarks(c); } } - void AddClassMemberBookmarks(IClass c) + void AddClassMemberBookmarks(ITypeDefinition c) { if (c.IsSynthetic) return; if (!c.Region.IsEmpty) { bookmarks.Add(new ClassBookmark(c)); } - foreach (IClass innerClass in c.InnerClasses) { + foreach (ITypeDefinition innerClass in c.NestedTypes) { AddClassMemberBookmarks(innerClass); } foreach (IMethod m in c.Methods) { diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/InlineUIElementGenerator.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/InlineUIElementGenerator.cs index 285dd78f00..8431a2200d 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/InlineUIElementGenerator.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/InlineUIElementGenerator.cs @@ -5,6 +5,7 @@ using System; using System.Windows; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop.Editor; namespace ICSharpCode.AvalonEdit.AddIn diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/LineChangeInfo.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/LineChangeInfo.cs index 99551b6755..577f8baf46 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/LineChangeInfo.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/LineChangeInfo.cs @@ -3,6 +3,9 @@ using System; using System.Collections.Generic; +using ICSharpCode.AvalonEdit.Document; +using ICSharpCode.Core; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop.Editor; namespace ICSharpCode.AvalonEdit.AddIn @@ -16,7 +19,7 @@ namespace ICSharpCode.AvalonEdit.AddIn /// Pass 0 to get the changes before the first line. /// LineChangeInfo GetChange(int lineNumber); - void Initialize(IDocument document); + void Initialize(TextDocument document, FileName fileName); string GetOldVersionFromLine(int lineNumber, out int newStartLine, out bool added); bool GetNewVersionFromLine(int lineNumber, out int offset, out int length); IDocument CurrentDocument { get; } @@ -43,41 +46,18 @@ namespace ICSharpCode.AvalonEdit.AddIn set { change = value; } } - int oldStartLineNumber; - - public int OldStartLineNumber { - get { return oldStartLineNumber; } - set { oldStartLineNumber = value; } - } - - int newStartLineNumber; - - public int NewStartLineNumber { - get { return newStartLineNumber; } - set { newStartLineNumber = value; } - } - - int oldEndLineNumber; - - public int OldEndLineNumber { - get { return oldEndLineNumber; } - set { oldEndLineNumber = value; } - } - - int newEndLineNumber; - - public int NewEndLineNumber { - get { return newEndLineNumber; } - set { newEndLineNumber = value; } - } + public readonly int OldStartLineNumber; + public readonly int NewStartLineNumber; + public readonly int OldEndLineNumber; + public readonly int NewEndLineNumber; public LineChangeInfo(ChangeType change, int oldStartLineNumber, int newStartLineNumber, int oldEndLineNumber, int newEndLineNumber) { this.change = change; - this.oldStartLineNumber = oldStartLineNumber; - this.newStartLineNumber = newStartLineNumber; - this.oldEndLineNumber = oldEndLineNumber; - this.newEndLineNumber = newEndLineNumber; + this.OldStartLineNumber = oldStartLineNumber; + this.NewStartLineNumber = newStartLineNumber; + this.OldEndLineNumber = oldEndLineNumber; + this.NewEndLineNumber = newEndLineNumber; } #region Equals and GetHashCode implementation @@ -89,10 +69,10 @@ namespace ICSharpCode.AvalonEdit.AddIn public bool Equals(LineChangeInfo other) { return this.change == other.change && - this.oldEndLineNumber == other.oldEndLineNumber && - this.newStartLineNumber == other.newStartLineNumber && - this.oldStartLineNumber == other.oldStartLineNumber && - this.newEndLineNumber == other.newEndLineNumber; + this.OldEndLineNumber == other.OldEndLineNumber && + this.NewStartLineNumber == other.NewStartLineNumber && + this.OldStartLineNumber == other.OldStartLineNumber && + this.NewEndLineNumber == other.NewEndLineNumber; } public override int GetHashCode() @@ -100,10 +80,10 @@ namespace ICSharpCode.AvalonEdit.AddIn int hashCode = 0; unchecked { hashCode += 1000000007 * change.GetHashCode(); - hashCode += 1000000009 * oldStartLineNumber.GetHashCode(); - hashCode += 1000000021 * newStartLineNumber.GetHashCode(); - hashCode += 1000000033 * oldEndLineNumber.GetHashCode(); - hashCode += 1000000087 * newEndLineNumber.GetHashCode(); + hashCode += 1000000009 * OldStartLineNumber.GetHashCode(); + hashCode += 1000000021 * NewStartLineNumber.GetHashCode(); + hashCode += 1000000033 * OldEndLineNumber.GetHashCode(); + hashCode += 1000000087 * NewEndLineNumber.GetHashCode(); } return hashCode; } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/MyersDiff/DocumentSequence.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/MyersDiff/DocumentSequence.cs index 89f8850197..2f37b44ce3 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/MyersDiff/DocumentSequence.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/MyersDiff/DocumentSequence.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop.Editor; namespace ICSharpCode.AvalonEdit.AddIn.MyersDiff diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/NewLineConsistencyCheck.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/NewLineConsistencyCheck.cs index 45eef882bf..7a0c0985ff 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/NewLineConsistencyCheck.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/NewLineConsistencyCheck.cs @@ -5,9 +5,9 @@ using System; using System.Threading; using System.Windows; using System.Windows.Controls; - using ICSharpCode.AvalonEdit.Document; using ICSharpCode.Core; +using ICSharpCode.Editor; namespace ICSharpCode.AvalonEdit.AddIn { diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ParserFoldingStrategy.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ParserFoldingStrategy.cs index 43419154b0..3e84c2fa49 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ParserFoldingStrategy.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ParserFoldingStrategy.cs @@ -5,10 +5,10 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; - using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.AvalonEdit.Folding; -using ICSharpCode.SharpDevelop.Dom; +using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.AvalonEdit.AddIn { @@ -52,10 +52,10 @@ namespace ICSharpCode.AvalonEdit.AddIn { List newFoldMarkers = new List(); if (parseInfo != null) { - foreach (IClass c in parseInfo.CompilationUnit.Classes) { + foreach (ITypeDefinition c in parseInfo.ParsedFile.TopLevelTypeDefinitions) { AddClassMembers(c, newFoldMarkers); } - foreach (FoldingRegion foldingRegion in parseInfo.CompilationUnit.FoldingRegions) { + foreach (FoldingRegion foldingRegion in parseInfo.FoldingRegions) { NewFolding f = new NewFoldingDefinition(GetOffset(foldingRegion.Region.BeginLine, foldingRegion.Region.BeginColumn), GetOffset(foldingRegion.Region.EndLine, foldingRegion.Region.EndColumn)); f.DefaultClosed = isFirstUpdate; @@ -76,9 +76,9 @@ namespace ICSharpCode.AvalonEdit.AddIn public NewFoldingDefinition(int start, int end) : base(start, end) {} } - void AddClassMembers(IClass c, List newFoldMarkers) + void AddClassMembers(ITypeDefinition c, List newFoldMarkers) { - if (c.ClassType == ClassType.Delegate) { + if (c.Kind == TypeKind.Delegate) { return; } DomRegion cRegion = c.BodyRegion; @@ -88,11 +88,11 @@ namespace ICSharpCode.AvalonEdit.AddIn newFoldMarkers.Add(new NewFolding(GetOffset(cRegion.BeginLine, cRegion.BeginColumn), GetOffset(cRegion.EndLine, cRegion.EndColumn))); } - foreach (IClass innerClass in c.InnerClasses) { + foreach (ITypeDefinition innerClass in c.NestedTypes) { AddClassMembers(innerClass, newFoldMarkers); } - foreach (IMember m in c.AllMembers) { + foreach (IMember m in c.Members) { if (m.Region.EndLine < m.BodyRegion.EndLine) { newFoldMarkers.Add(new NewFoldingDefinition(GetOffset(m.Region.EndLine, m.Region.EndColumn), GetOffset(m.BodyRegion.EndLine, m.BodyRegion.EndColumn))); diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.cs index 1dc3dffb6b..e24b15b96c 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.cs @@ -6,9 +6,11 @@ using System.Collections.Generic; using System.Windows.Controls; using System.Windows.Media; using ICSharpCode.Core; +using ICSharpCode.Editor; using ICSharpCode.NRefactory; +using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Dom; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.AvalonEdit.AddIn { @@ -44,8 +46,8 @@ namespace ICSharpCode.AvalonEdit.AddIn this.IsInSamePart = true; this.entity = entity; this.typeCode = typeCode; - IAmbience ambience = entity.ProjectContent.Language.GetAmbience(); - if (entity is IClass) + IAmbience ambience = entity.ProjectContent.GetAmbience(); + if (entity is ITypeDefinition) ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList | ConversionFlags.UseFullyQualifiedMemberNames; else ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList | ConversionFlags.ShowParameterList | ConversionFlags.ShowParameterNames; @@ -116,7 +118,7 @@ namespace ICSharpCode.AvalonEdit.AddIn /// This causes the classes combo box to lose its current selection, /// so the members combo box will be cleared. /// - public void Update(ICompilationUnit compilationUnit) + public void Update(IParsedFile compilationUnit) { runUpdateWhenDropDownClosed = true; runUpdateWhenDropDownClosedCU = compilationUnit; @@ -129,11 +131,11 @@ namespace ICSharpCode.AvalonEdit.AddIn List classItems = new List(); List memberItems = new List(); - void DoUpdate(ICompilationUnit compilationUnit) + void DoUpdate(IParsedFile compilationUnit) { classItems = new List(); if (compilationUnit != null) { - AddClasses(compilationUnit.Classes); + AddClasses(compilationUnit.TopLevelTypeDefinitions); } classItems.Sort(); classComboBox.ItemsSource = classItems; @@ -145,9 +147,9 @@ namespace ICSharpCode.AvalonEdit.AddIn // Delayed execution - avoid changing combo boxes while the user is browsing the dropdown list. bool runUpdateWhenDropDownClosed; - ICompilationUnit runUpdateWhenDropDownClosedCU; + IParsedFile runUpdateWhenDropDownClosedCU; bool runSelectItemWhenDropDownClosed; - Location runSelectItemWhenDropDownClosedLocation; + TextLocation runSelectItemWhenDropDownClosedLocation; void ComboBox_DropDownClosed(object sender, EventArgs e) { @@ -162,18 +164,18 @@ namespace ICSharpCode.AvalonEdit.AddIn } } - void AddClasses(IEnumerable classes) + void AddClasses(IEnumerable classes) { - foreach (IClass c in classes) { + foreach (ITypeDefinition c in classes) { classItems.Add(new EntityItem(c, TYPE_CLASS)); - AddClasses(c.InnerClasses); + AddClasses(c.NestedTypes); } } /// /// Selects the class and member closest to the specified location. /// - public void SelectItemAtCaretPosition(Location location) + public void SelectItemAtCaretPosition(TextLocation location) { runSelectItemWhenDropDownClosed = true; runSelectItemWhenDropDownClosedLocation = location; @@ -181,14 +183,14 @@ namespace ICSharpCode.AvalonEdit.AddIn ComboBox_DropDownClosed(null, null); } - void DoSelectItem(Location location) + void DoSelectItem(TextLocation location) { EntityItem matchInside = null; EntityItem nearestMatch = null; int nearestMatchDistance = int.MaxValue; foreach (EntityItem item in classItems) { if (item.IsInSamePart) { - IClass c = (IClass)item.Entity; + ITypeDefinition c = (ITypeDefinition)item.Entity; if (c.Region.IsInside(location.Line, location.Column)) { matchInside = item; // when there are multiple matches inside (nested classes), use the last one @@ -236,10 +238,10 @@ namespace ICSharpCode.AvalonEdit.AddIn // The selected class was changed. // Update the list of member items to be the list of members of the current class. EntityItem item = classComboBox.SelectedItem as EntityItem; - IClass selectedClass = item != null ? item.Entity as IClass : null; + ITypeDefinition selectedClass = item != null ? item.Entity as ITypeDefinition : null; memberItems = new List(); if (selectedClass != null) { - IClass compoundClass = selectedClass.GetCompoundClass(); + ITypeDefinition compoundClass = selectedClass.GetDefinition(); foreach (var m in compoundClass.Methods) { AddMember(selectedClass, m, m.IsConstructor ? TYPE_CONSTRUCTOR : TYPE_METHOD); } @@ -261,7 +263,7 @@ namespace ICSharpCode.AvalonEdit.AddIn membersComboBox.ItemsSource = memberItems; } - void AddMember(IClass selectedClass, IMember member, int typeCode) + void AddMember(ITypeDefinition selectedClass, IMember member, int typeCode) { bool isInSamePart = (member.DeclaringType == selectedClass); memberItems.Add(new EntityItem(member, typeCode) { IsInSamePart = isInSamePart }); @@ -287,7 +289,7 @@ namespace ICSharpCode.AvalonEdit.AddIn if (item.IsInSamePart && jumpAction != null) { jumpAction(region.BeginLine, region.BeginColumn); } else { - FileService.JumpToFilePosition(item.Entity.CompilationUnit.FileName, region.BeginLine, region.BeginColumn); + FileService.JumpToFilePosition(region.FileName, region.BeginLine, region.BeginColumn); } } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs index 8143e975a6..fb48de0d66 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs @@ -12,6 +12,7 @@ using ICSharpCode.AvalonEdit.CodeCompletion; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.Core; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopTextEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopTextEditor.cs index bbf540b21d..e8d110714d 100755 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopTextEditor.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopTextEditor.cs @@ -24,7 +24,6 @@ using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.Core.Presentation; using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.AvalonEdit; using ICSharpCode.SharpDevelop.Editor.Commands; diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/CodeSnippet.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/CodeSnippet.cs index df0ecb0de1..df764ed9f6 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/CodeSnippet.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/CodeSnippet.cs @@ -6,13 +6,13 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text.RegularExpressions; - using ICSharpCode.AvalonEdit.Snippets; +using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.AvalonEdit; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.AvalonEdit.AddIn.Snippets { @@ -185,18 +185,18 @@ namespace ICSharpCode.AvalonEdit.AddIn.Snippets static string GetValue(ITextEditor editor, string propertyName) { if ("ClassName".Equals(propertyName, StringComparison.OrdinalIgnoreCase)) { - IClass c = GetCurrentClass(editor); + ITypeDefinition c = GetCurrentClass(editor); if (c != null) return c.Name; } return Core.StringParser.GetValue(propertyName); } - static IClass GetCurrentClass(ITextEditor editor) + static ITypeDefinition GetCurrentClass(ITextEditor editor) { - var parseInfo = ParserService.GetExistingParseInformation(editor.FileName); + var parseInfo = ParserService.GetExistingParsedFile(editor.FileName); if (parseInfo != null) { - return parseInfo.CompilationUnit.GetInnermostClass(editor.Caret.Line, editor.Caret.Column); + return parseInfo.GetInnermostClass(editor.Caret.Line, editor.Caret.Column); } return null; } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/TextMarkerService.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/TextMarkerService.cs index 83a5ce5208..22dd11f7e4 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/TextMarkerService.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/TextMarkerService.cs @@ -7,14 +7,26 @@ using System.Linq; using System.Windows; using System.Windows.Media; using System.Windows.Threading; - using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; +using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; namespace ICSharpCode.AvalonEdit.AddIn { + /// + /// Interface the text marker service uses to access the code editor. + /// + public interface ICodeEditor + { + TextDocument Document { get; } + + void Redraw(ISegment segment, DispatcherPriority priority); + + event EventHandler DocumentChanged; + } + /// /// Handles the text markers for a code editor. /// diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/DirectoryDocumentIterator.cs b/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/DirectoryDocumentIterator.cs index 2fb5891594..985f112473 100644 --- a/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/DirectoryDocumentIterator.cs +++ b/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/DirectoryDocumentIterator.cs @@ -4,13 +4,13 @@ using System; using System.Collections.Generic; using System.IO; - using ICSharpCode.Core; using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.Search; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; namespace SearchAndReplace { diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/WholeProjectDocumentIterator.cs b/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/WholeProjectDocumentIterator.cs index 17914189b6..539db43ee4 100644 --- a/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/WholeProjectDocumentIterator.cs +++ b/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/WholeProjectDocumentIterator.cs @@ -4,13 +4,13 @@ using System; using System.Collections; using System.IO; - using ICSharpCode.Core; using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.Search; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace SearchAndReplace diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/WholeSolutionDocumentIterator.cs b/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/WholeSolutionDocumentIterator.cs index 6a4abc9ff1..6ad9fc4c75 100644 --- a/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/WholeSolutionDocumentIterator.cs +++ b/src/AddIns/Misc/SearchAndReplace/Project/Engine/DocumentIterator/WholeSolutionDocumentIterator.cs @@ -4,13 +4,13 @@ using System; using System.Collections; using System.IO; - using ICSharpCode.Core; using ICSharpCode.Editor; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.Search; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace SearchAndReplace diff --git a/src/AddIns/VersionControl/GitAddIn/Src/OverlayIconManager.cs b/src/AddIns/VersionControl/GitAddIn/Src/OverlayIconManager.cs index b1e8e88ed6..e3661c402c 100644 --- a/src/AddIns/VersionControl/GitAddIn/Src/OverlayIconManager.cs +++ b/src/AddIns/VersionControl/GitAddIn/Src/OverlayIconManager.cs @@ -83,7 +83,7 @@ namespace ICSharpCode.GitAddIn // sleep a tiny bit to give main thread time to add more jobs to the queue Thread.Sleep(100); while (true) { - if (ICSharpCode.SharpDevelop.ParserService.LoadSolutionProjectsThreadRunning) { + if (ICSharpCode.SharpDevelop.Parser.ParserService.LoadSolutionProjectsThreadRunning) { // Run OverlayIconManager much more slowly while solution is being loaded. // This prevents the disk from seeking too much Thread.Sleep(100); diff --git a/src/AddIns/VersionControl/SubversionAddIn/Src/Gui/ProjectBrowserVisitor/OverlayIconManager.cs b/src/AddIns/VersionControl/SubversionAddIn/Src/Gui/ProjectBrowserVisitor/OverlayIconManager.cs index 4fb827e0dc..19c5c92f41 100644 --- a/src/AddIns/VersionControl/SubversionAddIn/Src/Gui/ProjectBrowserVisitor/OverlayIconManager.cs +++ b/src/AddIns/VersionControl/SubversionAddIn/Src/Gui/ProjectBrowserVisitor/OverlayIconManager.cs @@ -139,7 +139,7 @@ namespace ICSharpCode.Svn // sleep a tiny bit to give main thread time to add more jobs to the queue Thread.Sleep(2); while (true) { - if (ICSharpCode.SharpDevelop.ParserService.LoadSolutionProjectsThreadRunning) { + if (ICSharpCode.SharpDevelop.Parser.ParserService.LoadSolutionProjectsThreadRunning) { // Run OverlayIconManager much more slowly while solution is being loaded. // This prevents the disk from seeking too much Thread.Sleep(100); diff --git a/src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj b/src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj index 1cbee352fd..2e8b15d272 100644 --- a/src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj +++ b/src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj @@ -107,11 +107,6 @@ ICSharpCode.Core.WinForms False - - {924EE450-603D-49C1-A8E5-4AFAA31CE6F3} - ICSharpCode.SharpDevelop.Dom - False - \ No newline at end of file diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/CSharp/Parser/ParsedFile.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/CSharp/Parser/ParsedFile.cs index b009dde7df..78bdceefed 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/CSharp/Parser/ParsedFile.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/CSharp/Parser/ParsedFile.cs @@ -111,7 +111,7 @@ namespace ICSharpCode.NRefactory.CSharp return FindEntity(topLevelTypeDefinitions, location); } - public ITypeDefinition GetTypeDefinition(AstLocation location) + public ITypeDefinition GetInnerMostTypeDefinition(AstLocation location) { ITypeDefinition parent = null; ITypeDefinition type = GetTopLevelTypeDefinition(location); @@ -124,7 +124,7 @@ namespace ICSharpCode.NRefactory.CSharp public IMember GetMember(AstLocation location) { - ITypeDefinition type = GetTypeDefinition(location); + ITypeDefinition type = GetInnerMostTypeDefinition(location); if (type == null) return null; return FindEntity(type.Methods, location) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs index 1e43b982b9..262338b66c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs @@ -255,7 +255,7 @@ namespace ICSharpCode.NRefactory.TypeSystem /// public static ITypeDefinition GetTypeDefinition (this IParsedFile file, int line, int column) { - return file.GetTypeDefinition (new AstLocation (line, column)); + return file.GetInnerMostTypeDefinition (new AstLocation (line, column)); } /// diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IParsedFile.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IParsedFile.cs index 3e459257ae..d428e7cdaa 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IParsedFile.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IParsedFile.cs @@ -67,7 +67,7 @@ namespace ICSharpCode.NRefactory.TypeSystem /// Gets the type (potentially a nested type) defined at the specified location. /// Returns null if no type is defined at that location. /// - ITypeDefinition GetTypeDefinition(AstLocation location); + ITypeDefinition GetInnerMostTypeDefinition(AstLocation location); /// /// Gets the member defined at the specified location. diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj index e59f7dae72..268eccfbe3 100644 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj @@ -203,16 +203,9 @@ - - Src\Services\RefactoringService\ExtractInterfaceDialog.cs - ExtractInterfaceDialog.cs - - Src\Services\RefactoringService\ExtractInterfaceDialog.Designer.cs - ExtractInterfaceDialog.cs - Form @@ -337,6 +330,7 @@ + @@ -762,7 +756,6 @@ - @@ -782,10 +775,6 @@ ExtractInterfaceDialog.cs - - Src\Services\RefactoringService\ExtractInterfaceDialog.resx - ExtractInterfaceDialog.cs - NewProjectDialog.cs diff --git a/src/Main/Base/Project/Src/Commands/AutostartCommands.cs b/src/Main/Base/Project/Src/Commands/AutostartCommands.cs index a517f94365..cb87c89868 100644 --- a/src/Main/Base/Project/Src/Commands/AutostartCommands.cs +++ b/src/Main/Base/Project/Src/Commands/AutostartCommands.cs @@ -80,7 +80,7 @@ namespace ICSharpCode.SharpDevelop.Commands NavigationService.ResumeLogging(); - ParserService.StartParserThread(); + Parser.ParserService.StartParserThread(); // finally run the workbench window ... app.Run(WorkbenchSingleton.MainWindow); diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/GotoDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/GotoDialog.cs index ffba08c1c9..4fd6e7ee2d 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/GotoDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/GotoDialog.cs @@ -18,6 +18,7 @@ using ICSharpCode.Editor; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop.Gui @@ -166,7 +167,7 @@ namespace ICSharpCode.SharpDevelop.Gui { ITextEditor editor = GetEditor(); if (editor != null) { - IParsedFile parseInfo = ParserService.GetExistingParseInformation(editor.FileName); + IParsedFile parseInfo = ParserService.GetExistingParsedFile(editor.FileName); if (parseInfo != null) { foreach (ITypeDefinition c in parseInfo.TopLevelTypeDefinitions) { AddAllMembersMatchingText(c, text); diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs index 01fb0a7f51..a994985d08 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs @@ -15,6 +15,7 @@ using ICSharpCode.Editor; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui.XmlForms; using ICSharpCode.SharpDevelop.Internal.Templates; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop.Gui diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/TaskListOptions.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/TaskListOptions.cs index 73e31839e3..3e6e716d56 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/TaskListOptions.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/TaskListOptions.cs @@ -4,8 +4,8 @@ using System; using System.Collections.Generic; using System.Windows.Forms; - using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop.Gui.OptionPanels { diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs index eee8808fef..7e9bd9f279 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs @@ -9,6 +9,7 @@ using System.Windows.Forms; using ICSharpCode.Core; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Editor; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop.Gui.OptionPanels diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs index 3b0c1ac28d..b004276833 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Windows.Forms; +using ICSharpCode.SharpDevelop.Parser; using Mono.Cecil; using ICSharpCode.Build.Tasks; using ICSharpCode.Core; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs index bb66b174ac..52a1f08792 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using System.Drawing; using System.IO; using System.Windows.Forms; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui.XmlForms; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop.Gui diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs index 054041854c..0c9140eea7 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs @@ -5,9 +5,9 @@ using System; using System.Net; using System.Web.Services.Discovery; using System.Windows.Forms; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop.Project.Commands { diff --git a/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs b/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs index 8e9f171678..e4ee0918cd 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs @@ -12,6 +12,7 @@ using System.Windows.Forms; using ICSharpCode.Core; using ICSharpCode.Core.WinForms; using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop.Gui diff --git a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs index 09422978ba..a33a4d62f5 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs @@ -8,6 +8,7 @@ using ICSharpCode.Core; using ICSharpCode.Core.WinForms; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Editor; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop.Gui @@ -226,7 +227,7 @@ namespace ICSharpCode.SharpDevelop.Gui // Tasks are created by parsing, so the parse information for item.FileName should already be present. // If they aren't, that's because the file might have been deleted/renamed in the meantime. // We use GetExistingParseInformation to avoid trying to parse a file that might have been deleted/renamed. - IParsedFile parseInfo = ParserService.GetExistingParseInformation(item.FileName); + IParsedFile parseInfo = ParserService.GetExistingParsedFile(item.FileName); if (parseInfo != null) { ITypeDefinition c = parseInfo.GetTypeDefinition(item.Line, item.Column); if (c != null) return c; diff --git a/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs index 6207ba9ce0..3a7d77f6b6 100644 --- a/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs +++ b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs @@ -18,6 +18,7 @@ using System.Windows.Media; using System.Windows.Navigation; using ICSharpCode.Core; using ICSharpCode.Core.Presentation; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop.Gui diff --git a/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs b/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs index 4a63cdad64..3d7e6ce6d1 100644 --- a/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs +++ b/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs @@ -8,6 +8,7 @@ using System.Windows; using System.Windows.Forms; using ICSharpCode.Core; using ICSharpCode.Core.WinForms; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop.Gui { diff --git a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs index b5e73ec36c..3687d20b45 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs @@ -7,10 +7,10 @@ using System.IO; using System.Linq; using System.Text; using System.Xml; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; using Microsoft.Build.Exceptions; using Import = System.Collections.Generic.KeyValuePair; diff --git a/src/Main/Base/Project/Src/Project/CustomTool.cs b/src/Main/Base/Project/Src/Project/CustomTool.cs index 42fa0654ff..06798e8d9d 100644 --- a/src/Main/Base/Project/Src/Project/CustomTool.cs +++ b/src/Main/Base/Project/Src/Project/CustomTool.cs @@ -13,6 +13,7 @@ using System.Text.RegularExpressions; using ICSharpCode.Core; using ICSharpCode.Editor; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop.Project { @@ -200,7 +201,7 @@ namespace ICSharpCode.SharpDevelop.Project }, outputFileName, FileErrorPolicy.Inform); EnsureOutputFileIsInProject(baseItem, outputFileName); - ParserService.BeginParse(outputFileName, new StringTextSource(codeOutput)); + ParserService.ParseAsync(outputFileName, new StringTextSource(codeOutput)); } public void GenerateCodeDomAsync(FileProjectItem baseItem, string outputFileName, Func func) diff --git a/src/Main/Base/Project/Src/Project/Items/ReferenceProjectItem.cs b/src/Main/Base/Project/Src/Project/Items/ReferenceProjectItem.cs index 2fa9dd9696..d8e1df06d5 100644 --- a/src/Main/Base/Project/Src/Project/Items/ReferenceProjectItem.cs +++ b/src/Main/Base/Project/Src/Project/Items/ReferenceProjectItem.cs @@ -6,9 +6,9 @@ using System.ComponentModel; using System.IO; using System.Reflection; using System.Text; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop.Project { diff --git a/src/Main/Base/Project/Src/Project/MSBuildInternals.cs b/src/Main/Base/Project/Src/Project/MSBuildInternals.cs index d4f6ac9cc6..cda8dd5c68 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildInternals.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildInternals.cs @@ -5,8 +5,8 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; - using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Parser; using Microsoft.Build.Construction; using Microsoft.Build.Execution; using Microsoft.Build.Framework; diff --git a/src/Main/Base/Project/Src/Services/File/FileService.cs b/src/Main/Base/Project/Src/Services/File/FileService.cs index 45160870ba..e854298e3e 100644 --- a/src/Main/Base/Project/Src/Services/File/FileService.cs +++ b/src/Main/Base/Project/Src/Services/File/FileService.cs @@ -9,9 +9,9 @@ using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop diff --git a/src/Main/Base/Project/Src/Services/File/OpenedFile.cs b/src/Main/Base/Project/Src/Services/File/OpenedFile.cs index 64ab618b46..e0b6f2cbc0 100644 --- a/src/Main/Base/Project/Src/Services/File/OpenedFile.cs +++ b/src/Main/Base/Project/Src/Services/File/OpenedFile.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.IO; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop { @@ -455,7 +456,7 @@ namespace ICSharpCode.SharpDevelop // We discarded some information when closing the file, // so we need to re-parse it. if (File.Exists(this.FileName)) - ParserService.BeginParse(this.FileName); + ParserService.ParseAsync(this.FileName); else ParserService.ClearParseInformation(this.FileName); } diff --git a/src/Main/Base/Project/Src/Services/NavigationService/NavigationService.cs b/src/Main/Base/Project/Src/Services/NavigationService/NavigationService.cs index c0e35f0c86..2e99b424fd 100644 --- a/src/Main/Base/Project/Src/Services/NavigationService/NavigationService.cs +++ b/src/Main/Base/Project/Src/Services/NavigationService/NavigationService.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using ICSharpCode.Core; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; using Mono.Cecil; diff --git a/src/Main/Base/Project/Src/Services/ParserService/AssemblyParserService.cs b/src/Main/Base/Project/Src/Services/ParserService/AssemblyParserService.cs index 0f4393c6b6..3aaa0b5418 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/AssemblyParserService.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/AssemblyParserService.cs @@ -15,7 +15,7 @@ using ICSharpCode.SharpDevelop.Project; using Microsoft.Build.Tasks; using Mono.Cecil; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { /// /// Portions of parser service that deal with loading external assemblies for code completion. diff --git a/src/Main/Base/Project/Src/Services/ParserService/CodeCompletionOptions.cs b/src/Main/Base/Project/Src/Services/ParserService/CodeCompletionOptions.cs index d9a88ef992..c4bbb66256 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/CodeCompletionOptions.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/CodeCompletionOptions.cs @@ -6,6 +6,8 @@ using ICSharpCode.Core; namespace ICSharpCode.SharpDevelop { + // TODO: what is this class doing in the ParserService ?? + /// /// Class containing static properties for the code completion options. /// diff --git a/src/Main/Base/Project/Src/Services/ParserService/DomAssemblyName.cs b/src/Main/Base/Project/Src/Services/ParserService/DomAssemblyName.cs index 76e8792a2e..cee0edd61d 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/DomAssemblyName.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/DomAssemblyName.cs @@ -3,7 +3,7 @@ using System; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { /// /// Similar to System.Reflection.AssemblyName, but does not raise an exception diff --git a/src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDescriptor.cs b/src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDescriptor.cs index ee2b45b13b..fd6e025b06 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDescriptor.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDescriptor.cs @@ -6,7 +6,7 @@ using System.IO; using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Project; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { public sealed class ParserDescriptor { diff --git a/src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDoozer.cs b/src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDoozer.cs index 3dbd6ef350..47218aff90 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDoozer.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDoozer.cs @@ -5,7 +5,7 @@ using System; using System.Collections; using ICSharpCode.Core; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { /// /// Creates ParserDescriptor objects for the parsing service. diff --git a/src/Main/Base/Project/Src/Services/ParserService/Fusion.cs b/src/Main/Base/Project/Src/Services/ParserService/Fusion.cs index edb24af48a..5f27980d5b 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/Fusion.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/Fusion.cs @@ -8,7 +8,7 @@ using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Text; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { // .NET Fusion COM interfaces [ComImport(), Guid("E707DCDE-D1CD-11D2-BAB9-00C04F8ECEAE"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] diff --git a/src/Main/Base/Project/Src/Services/ParserService/GacInterop.cs b/src/Main/Base/Project/Src/Services/ParserService/GacInterop.cs index c7d8a47645..875771032c 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/GacInterop.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/GacInterop.cs @@ -7,10 +7,9 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; - using Mono.Cecil; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { /// /// Interop with the .NET GAC. diff --git a/src/Main/Base/Project/Src/Project/IParser.cs b/src/Main/Base/Project/Src/Services/ParserService/IParser.cs similarity index 72% rename from src/Main/Base/Project/Src/Project/IParser.cs rename to src/Main/Base/Project/Src/Services/ParserService/IParser.cs index 36e6ff6a77..e52da544d4 100644 --- a/src/Main/Base/Project/Src/Project/IParser.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/IParser.cs @@ -5,15 +5,19 @@ using ICSharpCode.Editor; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Editor; using System; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop.Project { /// - /// Represents a language parser that produces ICompilationUnit instances - /// for code files. + /// Represents a language parser that produces ParseInformation + /// and IParsedFile instances for code files. /// public interface IParser { + /// + /// Gets/Sets the tags used to identify tasks. + /// string[] LexerTags { get; set; @@ -26,24 +30,23 @@ namespace ICSharpCode.SharpDevelop.Project /// bool CanParse(string fileName); - /// - /// Gets if the parser can parse the specified project. - /// Only when no parser for a project is found, the assembly is loaded. - /// - bool CanParse(IProject project); - /// /// Parses a file. /// /// The parent project of the file. /// The name of the file being parsed. /// The content of the file. + /// + /// Specifies whether full parse information were requested for this file. + /// If this parameter is false, only the ParsedFile and TagComments on the parse information need to be set. + /// /// The parse information representing the parse results. /// /// SharpDevelop may call IParser.Parse in parallel. This will be done on the same IParser instance /// if there are two parallel parse requests for the same file. Parser implementations must be thread-safe. /// - ParseInformation Parse(IProjectContent projectContent, string fileName, ITextSource fileContent); + ParseInformation Parse(IProjectContent projectContent, string fileName, ITextSource fileContent, + bool fullParseInformationRequested); //IResolver CreateResolver(); } diff --git a/src/Main/Base/Project/Src/Services/ParserService/LoadSolutionProjects.cs b/src/Main/Base/Project/Src/Services/ParserService/LoadSolutionProjects.cs index 2917f8a164..092202de03 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/LoadSolutionProjects.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/LoadSolutionProjects.cs @@ -11,7 +11,7 @@ using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { /// /// The background task that initializes the projects in the solution. diff --git a/src/Main/Base/Project/Src/Services/ParserService/ParseInformation.cs b/src/Main/Base/Project/Src/Services/ParserService/ParseInformation.cs index 00e5d2e2c7..8c0997f92d 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/ParseInformation.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/ParseInformation.cs @@ -7,7 +7,7 @@ using ICSharpCode.Core; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.TypeSystem; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { /// /// Represents the result of a parser operation. @@ -15,16 +15,40 @@ namespace ICSharpCode.SharpDevelop /// The extra information is only provided to listeners of the ParseInformationUpdated event. /// Those listeners may then decide to store the extra information (e.g. the TaskService stores TagComments). /// - public class ParseInformation : AbstractAnnotatable + public class ParseInformation : AbstractAnnotatable, IFreezable { readonly IParsedFile parsedFile; - readonly List tagComments = new List(); + IList tagComments = new List(); + readonly bool isFullParseInformation; + bool isFrozen; - public ParseInformation(IParsedFile parsedFile) + public ParseInformation(IParsedFile parsedFile, bool isFullParseInformation) { if (parsedFile == null) throw new ArgumentNullException("parsedFile"); this.parsedFile = parsedFile; + this.isFullParseInformation = isFullParseInformation; + } + + public bool IsFrozen { + get { return isFrozen; } + } + + public void Freeze() + { + if (!isFrozen) { + + isFrozen = true; + } + } + + /// + /// Gets whether this parse information contains 'extra' data. + /// True = extra data is provided (e.g. folding information). + /// False = Only ParsedFile and TagComments are provided. + /// + public bool IsFullParseInformation { + get { return isFullParseInformation; } } public IParsedFile ParsedFile { @@ -39,7 +63,7 @@ namespace ICSharpCode.SharpDevelop get { return parsedFile.ProjectContent; } } - public IEnumerable TagComments { + public IList TagComments { get { return tagComments; } } } diff --git a/src/Main/Base/Project/Src/Services/ParserService/ParseInformationEventArgs.cs b/src/Main/Base/Project/Src/Services/ParserService/ParseInformationEventArgs.cs index 4e18dcff4b..9f4417479a 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/ParseInformationEventArgs.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/ParseInformationEventArgs.cs @@ -7,7 +7,7 @@ using ICSharpCode.Core; using ICSharpCode.Editor; using ICSharpCode.NRefactory.TypeSystem; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { public class ParseInformationEventArgs : EventArgs { diff --git a/src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs b/src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs index 817223cfe1..bd5500fb94 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs @@ -12,7 +12,7 @@ using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; /* -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { public sealed class ParseProjectContent : DefaultProjectContent { diff --git a/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs b/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs index 8f0f399635..3b18dea81d 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs @@ -18,7 +18,7 @@ using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; -namespace ICSharpCode.SharpDevelop +namespace ICSharpCode.SharpDevelop.Parser { /// /// Stores the compilation units for files. @@ -259,7 +259,7 @@ namespace ICSharpCode.SharpDevelop else snapshot = GetParseableFileContent(viewContent.PrimaryFileName); - lastParseRun = BeginParse(fileName, snapshot).ContinueWith( + lastParseRun = ParseAsync(fileName, snapshot).ContinueWith( delegate(Task backgroundTask) { IParsedFile parseInfo = backgroundTask.Result; RaiseParserUpdateStepFinished(new ParserUpdateStepEventArgs(fileName, snapshot, parseInfo)); @@ -532,6 +532,7 @@ namespace ICSharpCode.SharpDevelop public Task BeginParse(ITextSource fileContent) { + // TODO: don't use background task if fileContent was specified and up-to-date parse info is available return System.Threading.Tasks.Task.Factory.StartNew( delegate { try { @@ -545,40 +546,38 @@ namespace ICSharpCode.SharpDevelop } } - static FileEntry GetFileEntry(string fileName, bool createOnDemand) + static FileEntry GetFileEntry(FileName fileName, bool createOnDemand) { if (fileName == null) throw new ArgumentNullException("fileName"); - FileName f = new FileName(fileName); FileEntry entry; lock (syncLock) { - if (!fileEntryDict.TryGetValue(f, out entry)) { + if (!fileEntryDict.TryGetValue(fileName, out entry)) { if (!createOnDemand) return null; - entry = new FileEntry(f); - fileEntryDict.Add(f, entry); + entry = new FileEntry(fileName); + fileEntryDict.Add(fileName, entry); } } return entry; } /// - /// Removes all parse information stored for the specified file. + /// Removes all parse information (both IParsedFile and ParseInformation) for the specified file. /// This method is thread-safe. /// - public static void ClearParseInformation(string fileName) + public static void ClearParseInformation(FileName fileName) { if (fileName == null) throw new ArgumentNullException("fileName"); - FileName f = new FileName(fileName); - LoggingService.Info("ClearParseInformation: " + f); + LoggingService.Info("ClearParseInformation: " + fileName); FileEntry entry; lock (syncLock) { - if (fileEntryDict.TryGetValue(f, out entry)) { - fileEntryDict.Remove(f); + if (fileEntryDict.TryGetValue(fileName, out entry)) { + fileEntryDict.Remove(fileName); } } if (entry != null) @@ -586,141 +585,166 @@ namespace ICSharpCode.SharpDevelop } /// - /// Gets parse information for the specified file. - /// Blocks if the file wasn't parsed yet, but may return an old parsed version. - /// This method is thread-safe. This method involves waiting for the main thread, so using it while - /// holding a lock can lead to deadlocks. You might want to use instead. + /// This is the old method returning potentially-stale parse information. + /// Use Parse()/ParseFile() instead if you need fresh parse info; otherwise use GetExistingParsedFile(). /// - /// Returns the ParseInformation for the specified file, or null if the file cannot be parsed. - /// The returned ParseInformation might be stale (re-parse is not forced). - public static IParsedFile GetParseInformation(string fileName) + [Obsolete("Use Parse()/ParseFile() instead if you need fresh parse info; otherwise use GetExistingParsedFile().")] + public static ParseInformation GetParseInformation(string fileName) { if (string.IsNullOrEmpty(fileName)) return null; - return GetFileEntry(fileName, true).GetParseInformation(null); + return ParseFile(FileName.Create(fileName)); } /// - /// Gets parse information for the specified file. - /// This method is thread-safe. + /// Gets full parse information for the specified file, if it is available. /// - /// Returns the ParseInformation for the specified file, or null if the file has not been parsed already. - public static IParsedFile GetExistingParseInformation(string fileName) + /// + /// Returns the ParseInformation for the specified file, + /// or null if it is not in the parse information cache. + /// + /// If only the IParsedFile is available (non-full parse information), this method + /// returns null. + /// + /// + /// This method is thread-safe. + /// + /// The ParserService may drop elements from the cache at any moment, + /// only IParsedFile will be stored for a longer time. + /// + public static ParseInformation GetCachedParseInformation(FileName fileName) { if (string.IsNullOrEmpty(fileName)) return null; FileEntry entry = GetFileEntry(fileName, false); if (entry != null) - return entry.GetExistingParseInformation(null); + return entry.GetCachedParseInformation(null); else return null; } /// - /// Gets parse information for the specified file in the context of the - /// specified project content. - /// This method is thread-safe. + /// Gets parse information for the specified file. /// - /// Returns the ParseInformation for the specified file, or null if the file has not been parsed for that project content. - public static IParsedFile GetExistingParseInformation(IProjectContent content, string fileName) + /// + /// Returns the IParsedFile for the specified file, + /// or null if the file has not been parsed yet. + /// + /// This method is thread-safe. + public static IParsedFile GetExistingParsedFile(FileName fileName) { if (string.IsNullOrEmpty(fileName)) return null; FileEntry entry = GetFileEntry(fileName, false); if (entry != null) - return entry.GetExistingParseInformation(content); + return entry.GetExistingParsedFile(null); else return null; } /// - /// Gets parse information for the specified file. - /// Blocks until a recent copy of the parse information is available. - /// This method is thread-safe. This method involves waiting for the main thread, so using it while - /// holding a lock can lead to deadlocks. You might want to use the overload taking ITextBuffer instead. + /// Gets parse information for the specified file in the context of the + /// specified project content. /// - /// Returns the ParseInformation for the specified file, or null if the file cannot be parsed. - /// The returned ParseInformation will not be stale (re-parse is forced if required). - public static IParsedFile ParseFile(string fileName) + /// + /// Project content to use as a parent project for the parse run. + /// Specifying the project content explicitly can be useful when a file is used in multiple projects. + /// + /// Name of the file. + /// + /// Returns the IParsedFile for the specified file, + /// or null if the file has not been parsed for that project content. + /// + /// This method is thread-safe. + public static IParsedFile GetExistingParsedFile(IProjectContent parentProjectContent, FileName fileName) { - return GetFileEntry(fileName, true).ParseFile(null, null); + if (string.IsNullOrEmpty(fileName)) + return null; + FileEntry entry = GetFileEntry(fileName, false); + if (entry != null) + return entry.GetExistingParsedFile(parentProjectContent); + else + return null; } /// - /// Gets parse information for the specified file. - /// The fileContent is taken as a hint - if a newer version than it is already available, that will be used instead. - /// This method is thread-safe. + /// Parses the specified file. + /// Produces full parse information. /// - /// Returns the ParseInformation for the specified file, or null if the file cannot be parsed. - /// The returned ParseInformation will not be stale (re-parse is forced if required). - public static IParsedFile ParseFile(string fileName, ITextSource fileContent) - { - if (fileContent == null) - throw new ArgumentNullException("fileContent"); - return GetFileEntry(fileName, true).ParseFile(null, fileContent); - } - - /// - /// Gets parse information for the specified file. + /// Name of the file to parse + /// Optional: Content of the file to parse. /// The fileContent is taken as a hint - if a newer version than it is already available, that will be used instead. - /// This method is thread-safe. - /// - /// Returns the ParseInformation for the specified file, or null if the file cannot be parsed. - /// The returned ParseInformation will not be stale (re-parse is forced if required). - public static IParsedFile ParseFile(IProjectContent parentProjectContent, string fileName, ITextSource fileContent) + /// + /// + /// Returns the ParseInformation for the specified file, or null if the file cannot be parsed. + /// For files currently open in an editor, this method does not necessary reparse, but may return + /// an existing cached parse information (but only if it's still up-to-date). + /// + /// + /// This method is thread-safe. This parser being used may involve locking or waiting for the main thread, + /// so using this method while holding a lock can lead to deadlocks. + /// + public static ParseInformation Parse(FileName fileName, ITextSource fileContent = null) { - if (fileContent == null) - throw new ArgumentNullException("fileContent"); - return GetFileEntry(fileName, true).ParseFile(parentProjectContent, fileContent); + return GetFileEntry(fileName, true).Parse(null, fileContent); } /// - /// Begins an asynchronous reparse. - /// This method is thread-safe. The returned task might wait for the main thread to be ready, beware of deadlocks. - /// You might want to use the overload taking ITextBuffer instead. + /// Asynchronous version of . /// + /// Name of the file to parse + /// Optional: Content of the file to parse. + /// The fileContent is taken as a hint - if a newer version than it is already available, that will be used instead. + /// /// - /// Returns a task that will make the parse result available. + /// Returns the ParseInformation for the specified file, or null if the file cannot be parsed. + /// For files currently open in an editor, this method does not necessary reparse, but may return + /// an existing cached parse information (but only if it's still up-to-date). /// /// - /// EnqueueForParsing has been renamed to BeginParse and now provides a future (Task<ParseInformation>) - /// to allow waiting for the result. However, to avoid deadlocks, this should not be done by any - /// thread the parser might be waiting for (especially the main thread). - /// - /// Unlike BeginParse().Wait(), ParseFile() is safe to call from the main thread. + /// This method is thread-safe. This parser being used may involve locking or waiting for the main thread, + /// so using this method while holding a lock can lead to deadlocks. /// - public static Task BeginParse(string fileName) + public static Task ParseAsync(FileName fileName, ITextSource fileContent = null) { - return GetFileEntry(fileName, true).BeginParse(null); + if (fileContent == null) + throw new ArgumentNullException("fileContent"); + // create snapshot (in case someone passes a mutable document to BeginParse) + return GetFileEntry(fileName, true).BeginParse(fileContent.CreateSnapshot()); } + /// - /// Begins an asynchronous reparse. - /// This method is thread-safe. + /// Parses the specified file. + /// This method does not request full parse information /// + /// + /// Project content to use as a parent project for the parse run. + /// Specifying the project content explicitly can be useful when a file is used in multiple projects. + /// + /// Name of the file to parse + /// Optional: Content of the file to parse. + /// The fileContent is taken as a hint - if a newer version than it is already available, that will be used instead. + /// /// - /// Returns a task that will make the parse result available. + /// Returns the ParseInformation for the specified file, or null if the file cannot be parsed. + /// For files currently open in an editor, this method does not necessary reparse, but may return + /// an existing cached parse information (but only if it's still up-to-date). /// /// - /// EnqueueForParsing has been renamed to BeginParse and now provides a future (Task<ParseInformation>) - /// to allow waiting for the result. However, to avoid deadlocks, this should not be done by any - /// thread the parser might be waiting for (especially the main thread). - /// - /// Unlike BeginParse().Wait(), ParseFile() is safe to call from the main thread. + /// This method is thread-safe. This parser being used may involve locking or waiting for the main thread, + /// so using this method while holding a lock can lead to deadlocks. /// - public static Task BeginParse(string fileName, ITextSource fileContent) + public static IParsedFile ParseFile(IProjectContent parentProjectContent, FileName fileName, ITextSource fileContent = null) { - if (fileContent == null) - throw new ArgumentNullException("fileContent"); - // create snapshot (in case someone passes a mutable document to BeginParse) - return GetFileEntry(fileName, true).BeginParse(fileContent.CreateSnapshot()); + return GetFileEntry(fileName, true).Parse(parentProjectContent, fileContent); } /// /// Parses the current view content. /// This method can only be called from the main thread. /// - public static IParsedFile ParseCurrentViewContent() + public static ParseInformation ParseCurrentViewContent() { WorkbenchSingleton.AssertMainThread(); IViewContent viewContent = WorkbenchSingleton.Workbench.ActiveViewContent; @@ -734,7 +758,7 @@ namespace ICSharpCode.SharpDevelop /// Parses the specified view content. /// This method can only be called from the main thread. /// - public static IParsedFile ParseViewContent(IViewContent viewContent) + public static ParseInformation ParseViewContent(IViewContent viewContent) { if (viewContent == null) throw new ArgumentNullException("viewContent"); @@ -748,59 +772,6 @@ namespace ICSharpCode.SharpDevelop return ParseFile(viewContent.PrimaryFileName); } - /// - /// Parses the current view content. - /// This method can only be called from the main thread. - /// - /// - /// EnqueueForParsing has been renamed to BeginParse and now provides a future (Task<ParseInformation>) - /// to allow waiting for the result. However, to avoid deadlocks, this should not be done by any - /// thread the parser might be waiting for (especially the main thread). - /// - /// Unlike BeginParse().Wait(), ParseFile() is safe to call from the main thread. - /// - public static Task BeginParseCurrentViewContent() - { - WorkbenchSingleton.AssertMainThread(); - IViewContent viewContent = WorkbenchSingleton.Workbench.ActiveViewContent; - if (viewContent != null) - return BeginParseViewContent(viewContent); - else - return NullTask(); - } - - /// - /// Begins parsing the specified view content. - /// This method can only be called from the main thread. - /// - /// - /// EnqueueForParsing has been renamed to BeginParse and now provides a future (Task<ParseInformation>) - /// to allow waiting for the result. However, to avoid deadlocks, this should not be done by any - /// thread the parser might be waiting for (especially the main thread). - /// - /// Unlike BeginParse().Wait(), ParseFile() is safe to call from the main thread. - /// - public static Task BeginParseViewContent(IViewContent viewContent) - { - if (viewContent == null) - throw new ArgumentNullException("viewContent"); - WorkbenchSingleton.AssertMainThread(); - if (string.IsNullOrEmpty(viewContent.PrimaryFileName)) - return NullTask(); - IEditable editable = viewContent as IEditable; - if (editable != null) - return BeginParse(viewContent.PrimaryFileName, editable.CreateSnapshot()); - else - return BeginParse(viewContent.PrimaryFileName); - } - - static Task NullTask() - { - var tcs = new TaskCompletionSource(); - tcs.SetResult(null); - return tcs.Task; - } - /// /// Gets the parser instance that is responsible for the specified file. /// Will create a new IParser instance on demand. @@ -815,11 +786,10 @@ namespace ICSharpCode.SharpDevelop /// Registers a compilation unit in the parser service. /// Does not fire the OnParseInformationUpdated event, please use this for unit tests only! /// - public static IParsedFile RegisterParseInformation(string fileName, IParsedFile cu) + public static void RegisterParseInformation(string fileName, IParsedFile cu) { FileEntry entry = GetFileEntry(fileName, true); entry.RegisterParseInformation(cu); - return cu; } /// diff --git a/src/Main/Base/Project/Src/Services/ProjectService/ParseableFileContentFinder.cs b/src/Main/Base/Project/Src/Services/ProjectService/ParseableFileContentFinder.cs index ddc64623c3..47e4264e4c 100644 --- a/src/Main/Base/Project/Src/Services/ProjectService/ParseableFileContentFinder.cs +++ b/src/Main/Base/Project/Src/Services/ProjectService/ParseableFileContentFinder.cs @@ -7,6 +7,7 @@ using System.Linq; using ICSharpCode.Core; using ICSharpCode.Editor; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop.Project { diff --git a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs index 5c24ee43fe..900deb1e0e 100644 --- a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs +++ b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs @@ -8,9 +8,9 @@ using System.Linq; using System.Text; using System.Windows.Input; using System.Xml; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.SharpDevelop.Project { diff --git a/src/Main/Base/Project/Src/Services/Tasks/TaskService.cs b/src/Main/Base/Project/Src/Services/Tasks/TaskService.cs index 6a976a767d..f866b34ff2 100644 --- a/src/Main/Base/Project/Src/Services/Tasks/TaskService.cs +++ b/src/Main/Base/Project/Src/Services/Tasks/TaskService.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; using System.IO; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop @@ -85,7 +85,7 @@ namespace ICSharpCode.SharpDevelop static void ParserService_ParseInformationUpdated(object sender, ParseInformationEventArgs e) { - if (e.NewParsedFile == ParserService.GetExistingParseInformation(e.FileName)) { + if (e.NewParsedFile == ParserService.GetExistingParsedFile(e.FileName)) { // Call UpdateCommentTags only for the main parse information (if a file is in multiple projects), // and only if the results haven't already been replaced with a more recent ParseInformation. if (e.NewParseInformation != null) { diff --git a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs index f5d593140d..37f0440c21 100644 --- a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs +++ b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs @@ -14,11 +14,13 @@ using System.Windows.Forms; using System.Windows.Media; using System.Xml; using System.Xml.Linq; - using ICSharpCode.Core.Presentation; using ICSharpCode.Editor; +using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; +using ICSharpCode.SharpDevelop.Project; using WinForms = System.Windows.Forms; namespace ICSharpCode.SharpDevelop @@ -110,25 +112,7 @@ namespace ICSharpCode.SharpDevelop /// Iterator that enumerates the tree structure in preorder. public static IEnumerable Flatten(this IEnumerable input, Func> recursion) { - Stack> stack = new Stack>(); - try { - stack.Push(input.GetEnumerator()); - while (stack.Count > 0) { - while (stack.Peek().MoveNext()) { - T element = stack.Peek().Current; - yield return element; - IEnumerable children = recursion(element); - if (children != null) { - stack.Push(children.GetEnumerator()); - } - } - stack.Pop().Dispose(); - } - } finally { - while (stack.Count > 0) { - stack.Pop().Dispose(); - } - } + return ICSharpCode.NRefactory.Utils.TreeTraversal.PreOrder(input, recursion); } /// @@ -566,6 +550,19 @@ namespace ICSharpCode.SharpDevelop { editor.Select(editor.Document.GetOffset(editor.Caret.Location), 0); } + + /// + /// Gets the ambience for the specified project content. + /// Never returns null. + /// + public static IAmbience GetAmbience(this IProjectContent pc) + { + IProject p = ParserService.GetProject(pc); + if (p != null) + return p.GetAmbience(); + else + return AmbienceService.GetCurrentAmbience(); + } #endregion } } diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj b/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj index fdc0181527..964ebd8115 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj @@ -88,6 +88,11 @@ + + {F054A788-B591-4561-A8BA-AE745BBEB817} + ICSharpCode.Editor + False + {2748AD25-9C63-4E12-877B-4DCE96FBED54} ICSharpCode.SharpDevelop @@ -113,11 +118,6 @@ ICSharpCode.Core.WinForms False - - {924EE450-603D-49C1-A8E5-4AFAA31CE6F3} - ICSharpCode.SharpDevelop.Dom - False - \ No newline at end of file diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs index ce0218c790..3f3dbf5a74 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs @@ -49,7 +49,8 @@ namespace ICSharpCode.SharpDevelop.Sda if (properties.PropertiesName != null) { startup.PropertiesName = properties.PropertiesName; } - AssemblyParserService.DomPersistencePath = properties.DomPersistencePath; + #warning reimplement DOM persistence, or remove the setting + //AssemblyParserService.DomPersistencePath = properties.DomPersistencePath; if (properties.ApplicationRootPath != null) { FileUtility.ApplicationRootPath = properties.ApplicationRootPath; @@ -92,7 +93,7 @@ namespace ICSharpCode.SharpDevelop.Sda Project.ProjectService.SolutionConfigurationChanged += delegate { this.callback.SolutionConfigurationChanged(); }; FileUtility.FileLoaded += delegate(object sender, FileNameEventArgs e) { this.callback.FileLoaded(e.FileName); }; FileUtility.FileSaved += delegate(object sender, FileNameEventArgs e) { this.callback.FileSaved(e.FileName); }; - + LoggingService.Info("InitSharpDevelop finished"); } diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/Document.cs b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/Document.cs index 894f5f0de2..e11372a5f7 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/Document.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/Document.cs @@ -1,8 +1,9 @@ // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) -using ICSharpCode.SharpDevelop.Editor; using System; +using ICSharpCode.Editor; +using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui; namespace ICSharpCode.SharpDevelop.Sda diff --git a/src/Main/StartUp/Project/StartUp.csproj b/src/Main/StartUp/Project/StartUp.csproj index bca99d3a1b..e498099a9d 100644 --- a/src/Main/StartUp/Project/StartUp.csproj +++ b/src/Main/StartUp/Project/StartUp.csproj @@ -100,10 +100,6 @@ {80318B5F-A25D-45AB-8A95-EF31D2370A4C} ICSharpCode.SharpDevelop.Sda - - {924EE450-603D-49C1-A8E5-4AFAA31CE6F3} - ICSharpCode.SharpDevelop.Dom - \ No newline at end of file