Bug 19363 - A '<' character in an xmldoc comment causes F# syntax highlighting to display incorrectly
Summary: A '<' character in an xmldoc comment causes F# syntax highlighting to display...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 5.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2014-04-29 07:23 UTC by Dave Thomas
Modified: 2014-05-02 02:54 UTC (History)
2 users (show)

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


Attachments
syntax highlighted incorrectly (107.53 KB, image/png)
2014-04-29 07:23 UTC, Dave Thomas
Details


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:
Status:
RESOLVED FIXED

Description Dave Thomas 2014-04-29 07:23:40 UTC
Created attachment 6673 [details]
syntax highlighted incorrectly

Given the following code:

  /// Provide parameter and method overload information when you type '(', '<' or ',' 
  override x.HandleParameterCompletion(context, completionChar) =
    try
      if suppressParameterCompletion then
         suppressParameterCompletion <- false
         null
      else
      let doc = x.Document
      let docText = doc.Editor.Text
      let offset = context.TriggerOffset

      // Parse backwards, skipping (...) and { ... } and [ ... ] to determine the parameter index. 
      // This is an approximation.
      let startOffset =
          let rec loop depth i = 
              if (i <= 0) then i else
              let ch = docText.[i] 
              if ((ch = '(' || ch = '{' || ch = '[') && depth > 0) then loop (depth - 1) (i-1) 
              elif ((ch = ')' || ch = '}' || ch = ']')) then loop (depth+1) (i-1) 


The '<' causes the syntax highlighting to be displayed incorrectly.  See attached screenshot.
Comment 1 Ram Chandra 2014-04-29 08:19:33 UTC
I have checked this issue and I am able to reproduce this issue.

Steps to reproduce:
1. Open a "F# Console application" in XS
2. Place the following line in "Program.fs" file
     ///Problem with angle bracket <

I observed that when I used a "left angle bracket" in xml documentation in F# code the syntax is highlighted incorrectly. However, if I write the "right angle bracket" it's remove the issue.

Screencast: http://www.screencast.com/t/jEKMXPUm0L

Environment Info:

Mac OS X 10.9.2
Xamarin Studio :Version 5.0 (build 782)
Build Information
Release ID: 500000782
Git revision: daf70ea88a90d9b53b3babebc44e78218ad3b190
Build date: 2014-04-29 06:17:48-04
Xamarin addins: 92dcfc8532a8c6d21783289c176417d7c17bf492
Comment 2 Mike Krüger 2014-05-02 02:54:57 UTC
fixed