Hi @Dimitry,
From the public docs, this looks more like a limitation of the current VS Code experience.
As you stated, Databricks now defaults notebooks to .ipynb format. However, you can still switch or convert notebooks between Jupyter (.ipynb) and source format if that better fits your workflow (Manage notebook format).
On the VS Code side, Databricks does support running and debugging .ipynb notebooks cell by cell with Databricks Connect, and %sql is supported in the sense that it executes via spark.sql (Run and debug notebook cells with Databricks Connect).
That said, the main extension docs also explicitly say that while the extension supports running R, Scala, and SQL notebooks as jobs, it does not provide deeper support for those languages within VS Code (Databricks extension for Visual Studio Code).
So based on that, I would not expect proper SQL-aware highlighting for %sql cells in Databricks .ipynb notebooks.I did come across references to third-party VS Code extensions, such as python-string-sql, that aim to highlight SQL within Python strings, which may help a bit with spark.sql(...) readability. That said, I would treat those as optional workarounds rather than the main answer here, and they are not a fix for %sql notebook cells.
If the goal is better SQL authoring in VS Code, the public Databricks path is to use SQLTools + the Databricks driver for SQL-centric work rather than relying on the main Databricks extension for SQL editing (Run SQL Queries on Databricks From Visual Studio Code).
Hope this helps.
If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.
Regards,
Ashwin | Delivery Solution Architect @ Databricks
Helping you build and scale the Data Intelligence Platform.
***Opinions are my own***