akarzazi / SSMSPlus

SSMS Plus is a productivity extension for SQL Server Management Studio 18 /19
76 stars 22 forks source link

Syntax highlighting in search schema object definition #4

Open patelriki13 opened 4 years ago

patelriki13 commented 4 years ago

Hi Akarzazi,

I would like to have Syntax highlighting in SQL object definition of Search schema.

I have made some R&D on that. Following are way we can implement it.

  1. AvalonEdit WPF based control (https://github.com/icsharpcode/AvalonEdit)
  2. Add FastColoredTextBox win form based control (https://github.com/PavelTorgashov/FastColoredTextBox)
  3. Create our custom control which highlight syntax of SQL. (Problem for this option we need to make error/bug free control for that it will take time.)

I would like to contribute on this but give me suggestion, how I can progress or crease basic architecture and we peer it for this implementation.

akarzazi commented 4 years ago

Hi Rikin, The syntax highlighting can be a nice addition, but in "Search schema" the detail is not always SQL as for tables and columns.

Also, i emphasis the primary & secondary text in some cases. see : /src/SSMSPlusCore/Ui/Search/TextFragment.cs

Nonetheless, if you want to give it a try, the window "Execution History" is an easier target to begin with. AvalonEdit seems to be a fair choice. I've tried the nuget package. It seems working ok and it has a "TSQL" syntax support.

<avalonEdit:TextEditor  Grid.Row="1"  Margin="0,10,0,0" 
        Name="textEditor"
                Document="{Binding Doc, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
        FontFamily="Consolas"
                IsReadOnly="True"
        FontSize="10pt"
        SyntaxHighlighting="TSQL">
</avalonEdit:TextEditor>

Now I think, the difficult part is about highlighting the search term efficiently.

patelriki13 commented 4 years ago

Thanks for updates, Let me try with your suggestion ("Execution History"). And for search schema part let me do R&D how we can handle it.