Syntax highlighting doesn't work properly for source files in a few languages (like Groovy, DART, Jypyter, update Shell ) on the Bitbucket UI.
Bitbucket Cloud UI use Monaco-editor which caters to a wide range of languages and is yet to cover a few more and can be found in the link below: https://microsoft.github.io/monaco-editor/.
The source files written in a language not supported by Monaco editor will not do Syntax highlighting in Bitbucket UI.
However, editing the file in Bitbucket UI can do the Syntax highlighting as Editor use CodeMirror - https://codemirror.net/mode/index.html which does support a different set of language than Monaco editor
View file in Bitbucket UI and observe Syntax highlighting
The syntax is not highlighted while checking the source file on the Bitbucket UI
The syntax be highlighted while checking the files on the Bitbucket UI regardless of the page
Check the file whiles using the "edit" mode