The code inside DO $$ block is treated as string. Because of which, syntax highlighting doesn’t work. This used to work in CM5. Screenshot from CM5:
https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQgeyBzcWwsIFBvc3RncmVTUUwgfSBmcm9tICdAY29kZW1pcnJvci9sYW5nLXNxbCc7CgpuZXcgRWRpdG9yVmlldyh7CiAgZG9jOiBgRE8gJCRcbkRFQ0xBUkVcbiAgICBfdHh0IHRleHQgOj0gJ3NvbWUgdGV4dCc7XG5CRUdJTlxuRU5EO1xuJCQ7YCwKICBleHRlbnNpb25zOiBbYmFzaWNTZXR1cCwKICAgICAgICAgICAgICAgIHNxbCh7CiAgICBkaWFsZWN0OiBQb3N0Z3JlU1FMLAogIH0pLAogICAgICAgICAgICAgIF0sCiAgcGFyZW50OiBkb2N1bWVudC5ib2R5LAp9KQo=
Screenshot from CM6:
Hi
@marijn
,
I revisited this and want to know why $x$ tagged(with name in between dollars) are not treated as strings?
Secondly, if there is a single quote in between then highlighting looks incorrect.
Hi
@marijn
,
I understand the code is implemented based on PostgreSQL docs. But it is not helpful in many cases for example a PostgreSQL function. A lot of pgAdmin users are raising this issue of syntax highlighting.
I’m wondering if there is a way to disable it?
Hi
@marijn
,
Will you accept a PR to make this optional?
People are not liking that a complete code is treated as string with no syntax highlighting.
github.com/pgadmin-org/pgadmin4
**Describe the bug**
Since release 8.4 I experience following:
The text for wr
…
iting 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 $anything$ ... $anything$ as it was before release 8,4
**To Reproduce**
Steps to reproduce the behavior:
1. Open a "Query Tool"
2. Type:
DO $$
DECLARE
_txt text := 'some text';
BEGIN
3. See the visualization of the code
4. Put for example a: "x" between the adjacent $-characters. Both at the start and at the end.
5. Look at the visual difference.
**Expected behavior**
I would like to have the visualization of $x$ ... $x$ when using $$ ... $$
**Error message**
No technical error but visual "error"
**Screenshots**
![Screenshot from 2024-03-18 17-01-48](https://github.com/pgadmin-org/pgadmin4/assets/121792923/767a5219-ab84-4b6f-8c81-2ed80221f1f1)
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:
- SHELL: /bin/bash
- SESSION_MANAGER: local/unix:@/tmp/.ICE-unix/11696,unix/unix:/tmp/.ICE-unix/11696
- HISTCONTROL: ignoredups
- XDG_MENU_PREFIX: gnome-
- GTK_IM_MODULE: ibus
- HOSTNAME: localhost
- HISTSIZE: 1000
- GNOME_SHELL_SESSION_MODE: classic
- SSH_AUTH_SOCK: /run/user/1000/keyring/ssh
- XMODIFIERS: @im=ibus
- DESKTOP_SESSION: gnome-classic
- PWD: /home/splendid
- XDG_SESSION_DESKTOP: gnome-classic
- LOGNAME: splendid
- XDG_SESSION_TYPE: wayland
- MODULESHOME: /usr/share/Modules
- MANPATH: /usr/share/man:
- SYSTEMD_EXEC_PID: 11712
- XAUTHORITY: /run/user/1000/.mutter-Xwaylandauth.GET0K2
- GJS_DEBUG_TOPICS: JS ERROR;JS LOG
- GDM_LANG: en_US.UTF-8
- __MODULES_SHARE_MANPATH: :1
- HOME: /home/splendid
- USERNAME: splendid
- LANG: en_US.UTF-8
- XDG_CURRENT_DESKTOP: GNOME-Classic:GNOME
- WAYLAND_DISPLAY: wayland-0
- INVOCATION_ID: b82749762f1242048070bd2902ece73a
- MANAGERPID: 11585
- GJS_DEBUG_OUTPUT: stderr
- GNOME_SETUP_DISPLAY: :1
- XDG_SESSION_CLASS: user
- LESSOPEN: ||/usr/bin/lesspipe.sh %s
- USER: splendid
- MODULES_RUN_QUARANTINE: LD_LIBRARY_PATH LD_PRELOAD
- LOADEDMODULES:
- DISPLAY: :0
- SHLVL: 0
- QT_IM_MODULE: ibus
- XDG_RUNTIME_DIR: /run/user/1000
- __MODULES_LMINIT: module use --append /usr/share/Modules/modulefiles:module use --append /etc/modulefiles:module use --append /usr/share/modulefiles
- DEBUGINFOD_URLS: https://debuginfod.centos.org/
- which_declare: declare -f
- JOURNAL_STREAM: 8:41178
- XDG_DATA_DIRS: /home/splendid/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
- PATH: /usr/pgsql-15/bin/:/home/splendid/.local/bin:/home/splendid/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
- MODULEPATH: /etc/scl/modulefiles:/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles
- GDMSESSION: gnome-classic
- DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
- MAIL: /var/spool/mail/splendid
- GIO_LAUNCHED_DESKTOP_FILE_PID: 15863
- GIO_LAUNCHED_DESKTOP_FILE: /usr/share/applications/pgadmin4.desktop
- MODULES_CMD: /usr/share/Modules/libexec/modulecmd.tcl
- GDK_BACKEND: x11
- NO_AT_BRIDGE: 1
- PGADMIN_INT_PORT: 36651
- PGADMIN_INT_KEY: c030d167-616e-4308-b728-7beaf3b7f79c
- PGADMIN_SERVER_MODE: OFF
--------------------------------------------------------
**Additional context**
-- None yet