-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quoting with double $-sign ($$) turns the rest of sql-code visual as text, till corresponding close $$ #7294
Comments
Plain dollar-quoting now treats the content as string constant. Dollar-quotes with nested token are transparent so that code highlighting works for function bodies et al. I consider this helpful. |
I have raised this to upstream - https://discuss.codemirror.net/t/code-inside-do-block-treated-as-string-postgresql-dialect/8005 |
@casparsch As per the docs - https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING, it is in fact a string. And so it is treated as string only. |
@adityatoshniwal Furthermore if there is a single quote within the nested dollar-quoted-text (like in the documentation: " I would suggest following:
|
@casparsch I will raise the bug to upstream CodeMirror repo. But I'm afraid it won't change the fact how $ quotes will be treated(as strings). You can follow the discussion with CodeMirror team here - https://discuss.codemirror.net/t/code-inside-do-block-treated-as-string-postgresql-dialect/8005 |
I'm raising this to CM team again if we have option to disable this somehow. |
CM allows to disable $$ string but it was not working because of some bug in upstream. It is fixed and pgAdmin is changed accordingly. |
Fixed with the latest code. |
@khushboovashi and others as well of course. |
I am not sure how this was "fixed" exactly. Have to see in v8.6. But treating dollar-quoted strings as plain strings (while technically correct) is unhelpful. In the absolute majority of cases, dollar-quoting (with a token) is used for function bodies and other code blocks, which benefit from syntax-highlighting. The best practice would be to treat simple strings ( Related post making the same point: #7276 (comment) |
My verification on version 8.6 gets my approval ✔️ |
Describe the bug$anything$ ... $anything$ as it was before release 8,4
Since release 8.4 I experience following:
The text for writing a function, procedure or anonymous block is visualized as text when it comes across a "$$"-token
This textual visualization remains till the corresponding $$ at the end. This obstructs e.g. the highlighting of keywords and texts.
If there is anything in between the two $-characters (opening and closing) the keywords and texts are again highlighted
I would like to revert to the $$ ... $$ to have a similar visualization as
To Reproduce
Steps to reproduce the behavior:
Expected behavior$x$ ... $x$ when using $$ ... $$
I would like to have the visualization of
Error message
No technical error but visual "error"
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
It is on a: "rocky-linux 9" operating system.
pgAdmin Runtime Environment
Python Path: "/usr/pgadmin4/venv/bin/python3"
Runtime Config File: "/home/splendid/.config/pgadmin/runtime_config.json"
pgAdmin Config File: "/usr/pgadmin4/web/config.py"
Webapp Path: "/usr/pgadmin
(https://github.com/pgadmin-org/pgadmin4/assets/121792923/50f52290-0509-4dcd-b018-f8d2b04ccf62)
4/web/pgAdmin4.py"
pgAdmin Command: "/usr/pgadmin4/venv/bin/python3 -s /usr/pgadmin4/web/pgAdmin4.py"
Environment:
Additional context
-- None yet
The text was updated successfully, but these errors were encountered: