Page MenuHomePhabricator

Default code block (syntax highlighting) language to file being commented
Closed, DuplicatePublic

Description

When commenting on code in a review and when adding a code block to a comment, by default, the code block has no syntax highlighting.

Would it be possible to either change the default behavior or to add a configuration option that would look at the file's extension and if a (syntax highlighting) language can be guessed, set the language for the comment's code block to that (unless the user explicitly specified 'lang'). For example, if I am commenting on a .js file and I add a code block to a comment, it seems reasonable for that code block to get .js syntax highlighting by default.