Author Topic: Rust language syntax highlighting issue  (Read 1279 times)

Teknomancer

  • Community Member
  • Posts: 28
  • Hero Points: 1
Rust language syntax highlighting issue
« on: October 18, 2019, 02:29:00 pm »
Function definitions does not get proper syntax highlighting when lifetime parameters are specified using < and >.

I'm using SlickEdit Pro 2018 (v23.0.2.0 64-bit)

Attached a picture that shows this problem (see "parse_number" vs "parse_operator" in the pic).
« Last Edit: October 18, 2019, 02:47:20 pm by Teknomancer »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3078
  • Hero Points: 449
Re: Rust language syntax highlighting issue
« Reply #1 on: October 18, 2019, 07:22:25 pm »
This is a known limitation of the color coding.  parse_operator is not followed by an open paren (it is followed by a '<' character).  "Function" color is simply an identifier followed by a paren.

You can customize the color coding for Rust to handle this case.  Document > Rust Options... > Color Coding > Tokens > Add Other

   Type:  Function
   Start Delimeter:  :v(#= *\<[^>]*\> *\()            SlickEdit regex

This expression does not handle nested angle brackets.  I leave that as an exercise for the reader.

Teknomancer

  • Community Member
  • Posts: 28
  • Hero Points: 1
Re: Rust language syntax highlighting issue
« Reply #2 on: October 19, 2019, 04:16:57 am »
Thanks, that worked! Will look at nesting later.