How can we make Microsoft Teams better?

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)

3,043 votes
Sign in
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Nils Ree shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Comments are closed
  • Jonathon Wyza commented  ·   ·  Flag as inappropriate

    Snippets would be good for larger code pastes. (and pasting in general). Not quite a file that needs to be downloaded, but not necessarily something that goes into a full chat message. Though those should be syntax highlighted too.

  • Anonymous commented  ·   ·  Flag as inappropriate

    @Ilya, at 200 lines you should be pasting that in a text file instead of a chat message...

    IMO, I would much rather see other features implemented before syntax highlighting. With plain code snippets we can get by, but other things such as compact views, meeting integrations, etc should take precedence. However, this would be a very nice feature.

  • Ilya Ratner commented  ·   ·  Flag as inappropriate

    I think a clone of Slack would be great as far as code snippets are concerned. You should also consider allowing for longer messages. For instance, I tried pasting in a 200 line JSON string, and it said the message was too long. Maybe the longer strings can just apply to code snippets, and maybe they automatically get thrown into a code snipped tab for quick review of all Team, or PM conversations.

  • David Cheeseman commented  ·   ·  Flag as inappropriate

    We are currently migrating to Office 365 and this is a huge feature request from our staff already. Hope it's implemented soon!

  • Jon commented  ·   ·  Flag as inappropriate

    Sorry if this was already mentioned but having option to show line numbers, specified line numbers. Basically being able to reference the line numbers from the code file itself so that the code is displayed like a screenshot.
    If possible that would be a nice option.

  • Brydon DeWitt commented  ·   ·  Flag as inappropriate

    Runnable snippets was mentioned and I'd just like to second that - I think it would give you a bit of an edge. Something like StackOverflow's snippets or JSFiddle, but it might also be nice to be able to extend that functionality to non web code too. Maybe via a later feature like plugins/extensions - if that's a possibility.

  • Jim Peluso commented  ·   ·  Flag as inappropriate

    It should allow for full pasting of code, it should recognize the code being pasted. It should have line numbers and be in a readable format.

  • commented  ·   ·  Flag as inappropriate

    Two things:

    (1) Wish that you could just insert a code snippet and then see people's cursors on it, type together and quickly debug a code snippet like you could if it was in Google Docs. Co-coding like this is not ideal for big things, but would be awesome for quick debugs / seeing obvious issues. Build it out like this: Could enable ability to see beginning state from end state and mark as green-check-fixed.

    (2) We own Visual Studio: Look at what we could easily internalize into Microsoft Teams with colorization, intellisense, etc. in a lightweight way.

  • Will Green commented  ·   ·  Flag as inappropriate

    Just implement GitHub flavored markdown, complete with the fenced code blocks specifying the language. I'm sure there's more than a couple libraries on multiple platforms out there that do this already.

  • commented  ·   ·  Flag as inappropriate

    We own Visual Studio: Be sure to look at what we could easily internalize into Microsoft Teams with colorization, intellisense, etc. in a lightweight way.

    Also, though you'd need to make sure to maintain history (problem, solution), snippets are, in my opinion, a rare place where you could actually implement a 'Google Docs' of coding where you could actually show multiple cursors at once. Shoot someone a message and watch as they can fix code right inline in front of you. Show a green check once fixed and make it easy to see the original issue with comments in a module underneath...

    Oh, how I wish we'd just go the route of doing type would be so much more powerful than fluffy inserts. :(

  • Jono commented  ·   ·  Flag as inappropriate

    I'd love to see some sort of integration with VSCode. Perhaps snippets could have an "Open in Code" option, or better yet a configurable editor. Formatting and coloring based on language chosen is a must.

Feedback and Knowledge Base