Previously there was a request on the Microsoft Teams UserVoice site that read:
Code snippets
I would like code snippets with highlighting based on code language. And for snippets longer than X lines, a “show more” button (like slack)
Well, the other day, a response was posted:
AdminWarren (Microsoft Teams, Microsoft Teams) responded · July 30, 2018
This feature request has been completed and is available to the public. Thank you for the suggestion and feedback!
-Warren
INTRODUCING CODE SNIPPETS FOR MICROSOFT TEAMS
This has been a long awaited feature and i’m excited to see the 1.0 of it available in Microsoft Teams. It was somewhat quietly announced here:
- July 17, 2018 – What’s new in Microsoft Teams
https://support.office.com/en-us/article/What-s-new-in-Microsoft-Teams-d7092a6d-c896-424c-b362-a472d5f105de
HOW IT WORKS
In order to include code snippets in messages you send within Microsoft Teams, follow the steps below:
- Click FORMAT in the message text box toolbar.
- In the FORMAT toolbar, click the Code Snippet icon.
- In the dialog window, select the programming language you’re using from the list down box.
- Paste your code.
Supported features:
- syntax highlighting
- auto-indentation
- text wrapping control
- support for 45+ programming languages like C#, Go, Dart, Swift, F#, etc.
The only documentation on the feature appears to be here:
- SUPPORT: Send code snippets in a message in Teams
https://support.office.com/en-us/article/Send-code-snippets-in-a-message-in-Teams-5406fe2b-2771-4b9a-bd73-656914f6ab3c
A blogger named “Dennis” wrote a quick post and a video on Expiscornovus demonstrating the code snippets feature here: