SQL quote color syntax issue
-
Hello,
First congratulations for this excellent software.
I have a bug with SQL selected as the script language:
SELECT [ID Equipement], [Famille d’installation]
FROM MaTable;After the quote in the [Famille d’installation] column name, everything is considered as text until the next quote.
However this quote should not be considered as text beginning, because the field name is enclosed in square brackets.
-
I cannot reproduce your issue. I am using v7.5.8 32bit (see ?-menu’s Debug Info):
Notepad++ v7.5.8 (32-bit) Build time : Jul 23 2018 - 02:03:53 Path : C:\Program Files (x86)\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : OFF OS : Windows 10 (64-bit) Plugins : ComparePlugin.dll dbgpPlugin.dll DSpellCheck.dll MarkdownViewerPlusPlus.dll NppConverter.dll NppExec.dll NppFTP.dll PluginManager.dll PreviewHTML.dll PythonScript.dll XMLTools.dll mimeTools.dll NppExport.dll
I am using the default theme (Settings > Style Configurator, select theme:
Default (stylers.xml)
.With that setup, I get …
-
@PeterJones, I think we have some BBS shenanigans going on here. The way the board is showing the quote mark from @Emmanuel-Gorand is a U+2019 RIGHT SINGLE QUOTATION MARK. I think he’s having issues with a non-directional single quote (apostrophe I guess?). If you replace the right quote with an apostrophe, the highlighting fails.
@Emmanuel-Gorand, there are a few bugs with the SQL lexer that comes with the version of Scintilla that NPP is currently built with. Many of them have been patched in the latest version of Scintilla, but the Scintilla portion of NPP doesn’t get updated very often. You can wait for NPP to update the version of Scintilla and hope your particular bug was fixed, or you could try installing “Poor Man’s T-Sql Formatter” from the plugin manager and use the T-SQL lexer that the plugin installs. The T-SQL lexer correctly highlights your example.
-
You’re right. I hadn’t noticed it was a curly-quote. When I change it to an normal ASCII single-quote/apostrophe, then the highlighting is wrong.
Sorry about the mis-interpretation.
-
Thank you @PeterJones and @cipher-1024 for your quick answers.
@cipher-1024 , I understand why this quite old bug is still there. I have installed Poor Man’s T-Sql Formatter following your advice. Not found at the time how to use only it’s lexer as I am not familiar with these components. But I’ll find how to do this.
Thanks again and have a nice day.
Emmanuel -
I think to permanently associate .sql files with the T-SQL User Defined Language, you have to go to
Language->Define Your Language
Select T-SQL from the User Language drop-down
and type “sql” into the Ext: input box.
Good Luck! -
Thanks.
Unfortunately I have nothing but User Defined Language is that drop-down…
Maybe something is missing with the plugin (located in C:\Program Files\Notepad++\plugins\PoorMansTSqlFormatterNppPlugin).