Last Updated: 08 Oct 2021 10:15 by ADMIN
Release R3 2021 SP1
Created on: 15 Sep 2021 06:16
Category: SyntaxEditor
Type: Bug Report
RadSyntaxEditor: SQLTagger CURRENT_DATE and CURRENT_TIMESTAMP are not hightlighted
1 comment
Dess | Tech Support Engineer, Principal
Posted on: 15 Sep 2021 06:18

Hello, Steve,

The possible solution that I can suggest is to create your own SQLTagger and control how the content is split into words:

    Sub New()

        ' This call is required by the designer.

        Dim currentLanguageTagger As CustomSqlTagger = New CustomSqlTagger(Me.RadSyntaxEditor1.SyntaxEditorElement)

    End Sub

    Public Class CustomSqlTagger
        Inherits Telerik.WinForms.Controls.SyntaxEditor.Taggers.SqlTagger

        Public Sub New(editor As RadSyntaxEditorElement)

        End Sub
        Protected Overrides Function SplitIntoWords(value As String) As IList(Of String)
            Dim words As List(Of String) = New List(Of String)()
            Dim word As String
            Dim lastCharType As Integer = -1
            Dim startIndex As Integer = 0

            For i As Integer = 0 To value.Length - 1
                Dim charType As Integer = GetCharType(value(i))

                If charType <> lastCharType Then
                    word = value.Substring(startIndex, i - startIndex)
                    startIndex = i
                    lastCharType = charType
                End If

            word = value.Substring(startIndex, value.Length - startIndex)
            Return words
        End Function
        Friend Shared Function GetCharType(ByVal c As Char) As Integer
            If c = "#"c Then
                Return 0
            End If
            If c = "_"c Then
                Return 0
            End If

            If Char.IsWhiteSpace(c) Then
                Return 1
            End If

            If Char.IsPunctuation(c) OrElse Char.IsSymbol(c) Then
                Return 2
            End If

            Return 0
        End Function
    End Class

I hope this information helps. 

Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at