Code Fragmentation not working

SyntaxEditor for WPF Forum

Posted 10 years ago by Marcus Gabriel
Version: 12.2.0570

I'm using Syntax Editor for WPF implemented using the stock VB language. I'm trying to set code fragments in the editor. I set the header and  footer with SetHeaderAndFooterText. The call to this returns true and when I interrogate the document / code snapshot, the header and footer are set however the text still contains the complete code including the header and footer. The code in the editor is unchanged also. I presume I'm using the call correctly and assume the code in the editor should update to hide the header and footer. Am I understanding the function call correctly?


Comments (2)

Posted 10 years ago by Marcus Gabriel

OK I now realise that I was using the call incorrectly (I included the header and footer in the text -- oops). I now have another issue though, if I include a \n in the header I get the following exception:

System.ArgumentOutOfRangeException was unhandled

Message=StartIndex cannot be less than zero.

Parameter name: startIndex

Source=mscorlib P



at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)

at System.String.Substring(Int32 startIndex, Int32 length)

at #PZc.#VZc.ToString(Int32 startOffset, Int32 endOffset)

at #PZc.#SZc.GetSubstring(Int32 offset, Int32 length)

at ActiproSoftware.Text.Languages.VB.Implementation.VBOutliningSource.#wU(ITextBufferReader reader, ClassDeclaration astNode)

at ActiproSoftware.Text.Languages.VB.Implementation.VBOutliningSource.AddNodesRecursive(ITextBufferReader reader, IAstNode astNode)

at ActiproSoftware.Text.Languages.VB.Implementation.VBOutliningSource.AddNodesFromParseData(IDotNetParseData parseData)

at ActiproSoftware.Text.Languages.VB.Implementation.VBOutliner.GetOutliningSource(ITextSnapshot snapshot)

at #b3b.#a3b.GetOutliningSource(Nullable'1& updateTrigger)

at #b3b.#a3b.#0gc(Nullable'1 updateTrigger, TextSnapshotRange targetSnapshotRange, Boolean autoCollapse)

at #b3b.#a3b.#dgc(Object sender, EventArgs e)

at System.EventHandler'1.Invoke(Object sender, TEventArgs e)

at ActiproSoftware.Text.Implementation.CodeDocument.OnParseDataChanged(ParseDataPropertyChangedEventArgs e)

at ActiproSoftware.Text.Implementation.CodeDocument.set_ParseData(IParseData value)

at ActiproSoftware.Text.Implementation.CodeDocument.NotifyParseComplete(IParseRequest request, IParseData result)

at ActiproSoftware.Text.Implementation.CodeDocument.#bGc(IParseRequest request, IParseData result)

at ActiproSoftware.Text.Parsing.Implementation.ThreadedParseRequestDispatcher.#g.#0Yc.#nXc(IParseRequest request)

at ActiproSoftware.Text.Parsing.Implementation.ThreadedParseRequestDispatcher.#g.#0Yc.#56c()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart() InnerException:  


This doesn't happen if I put the same character in the footer. Has anyone else experienced this?


Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Marcus,

We're waiting on the reply to the support ticket you also submitted on this issue.

Actipro Software Support

The latest build of this product (v22.1.3) was released 23 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.