Bug 5677 - insert method not implemented the right way
Summary: insert method not implemented the right way
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: Trunk
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-06-15 16:16 UTC by Marcel Hellwig
Modified: 2012-06-20 06:00 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Marcel Hellwig 2012-06-15 16:16:39 UTC
monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs line 1700 is not implemented right, because it simply ignores the anchor.
Fix this please.


Marcel Hellwig
Comment 1 Mike Krüger 2012-06-16 02:02:50 UTC
That's just for compatibility with the NRefactory interface.

We don't support the anchor type, nor do I plan to do so. That's SharpDevelop specfic.
They use this option to have more control how the caret and certain anchors move - I don't see any use case for refactoring commands using that.
Comment 2 Mike Krüger 2012-06-16 02:10:22 UTC
Ok that method was part of the public API - that wasn't intended. It now explicitly implements the IDocument interface.

 - again only needed as NRefactory bridge.
Comment 3 Marcel Hellwig 2012-06-16 16:32:40 UTC
but why don't you implement that? I mean, it is that difficult? I don't think so. E.g. the MagicKeyCompletion (main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs line 289) inserts the following "</" + tag + ">".
But, the cursor will be set behind the closing > bracket. It would be better to place the cursor between the two tags <a>|</a> where | is the cursor.

I hope you know what I mean.

Comment 4 Mike Krüger 2012-06-17 00:38:28 UTC
It would require many changes I suppose. Difficult - not really, but it would be required to change the whole API to support that.

It's easier to just place the caret manually in the 2-3 cases where that's required.
Comment 5 Mike Krüger 2012-06-20 05:50:37 UTC
I just added it to our API - and implemented the basic case.

Let's see how it works out ...
Comment 6 Marcel Hellwig 2012-06-20 06:00:56 UTC
Thanks a lot.

The reason I wanted that method implemented was becuase of Bug 6744, that you implemented as well. ;) Nice work