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,045 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

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

    128 comments

    Comments are closed
    • Michael commented  ·   ·  Flag as inappropriate

      Is there any update on the status of this feature?

      My team are currently using hipchat, but with the recent announcement the question is will we jump to Slack or Teams?

      Code snippets capability will be a big consideration in discussion.

      Thanks

    • Jim commented  ·   ·  Flag as inappropriate

      Code snippets don't work for python. I get line numbers, but the indents are lost. And, indents are part of the python language. If the indents are wrong, then the code is wrong. What that means is ... NEVER use python and Teams. The block text feature works better than code snippets but still mangles the indents. Microsoft recently pulled Python into SQL Server 2017. Of course, I am just guessing about code snippets and block text. I used the 3 back ticks -- ``` -- for code snippet and right arrow -- > -- for block text.

    • Sean Ellis commented  ·   ·  Flag as inappropriate

      Code snippets are nice!

      I would suggest that better use is made of the space, however. At the moment, the left margin consists of:
      - The left tool bar
      - The left conversation margin (under my user icon)
      - The message box padding
      - The snippet box padding
      - The grey text box padding
      - The line numbers

      The right margin consists of:
      - (Zero grey text box padding - well done!)
      - The snippet box padding
      - The message box padding
      - The completely unused right conversation margin

      In my small-ish window, this means that the space devoted to the text is only about 50% of the window width.

      It should be possible to reduce or reuse some of this space. Removing the right conversation margin completely, reducing or removing the internal padding, and putting the line numbers in the left margin would make a big difference.

    • Greg Petrites commented  ·   ·  Flag as inappropriate

      Love the code snippets. Would like to see support for Pug. If you are using CodeMirror, this looks like it should be easy to add as CodeMirror already supports.

    • Travis commented  ·   ·  Flag as inappropriate

      There is only one real problem I have with code snippets. After clicking "Expand," the code snippet only becomes marginally larger, and scroll bars are added! It makes it pretty useless for looking through even very short code snippets, as one must scroll left and right!

      Look to how Slack does it. Clicking expand makes the code fill the chat area's width. This is really a must!

      Also, it would be nice if indentation were proper after pasting. One must CTRL+TAB to get things right (Okay, so maybe I have 2 issues with snippets...the first is, by far, more important though.

    • Brian Gillett-Smith commented  ·   ·  Flag as inappropriate

      When copy-pasting Python from VS Code, all indentation is removed. So while there is basic formatting it is impossible to read as you cannot tell which lines are nested!

    • Jim commented  ·   ·  Flag as inappropriate

      There is an ugly workaround: start every text with ">" (right arrow, greater than, whatever you want to call it). Staring the line with > kicks the comment into a block text mode. Accidentally came across this feature when trying to separate items with the right arrow. Does not always take the first time ... I have to give it a couple of shots sometimes.

      This does NOT give language level formatting hints, but it does preserve the formatting copied in. That makes Teams rudimentarily useful for sharing code.

      The > trick also works around the copy/paste dilemma where a short piece of text cannot be copied because Teams design hides the text and offers options that do not include copy text.

    • Andrew T. commented  ·   ·  Flag as inappropriate

      While there's some minimal support for this, it's super inconsistent. I like being able to type ``` to start one, but it doesn't always work. Not only does it not always work, but it doesn't work if you go back and add it after. Also, it breaks return to send.

      I should be able to wrap any word or short string with a single tick (`) and it render as code. And I should be able to wrap a multi-line bit of text with triple ticks(```) and it render as code. And it should do that consistently.

      I also personally don't it auto-formatting in the text box before submitting because it makes it hard to edit, and it doesn't work in a sensible manner.

    • Anonymous commented  ·   ·  Flag as inappropriate

      This issue really should be the top priority. Sure the top request has tons more votes but they are still going to use Teams whether or not you implement their features. The almost 3000 of us that voted for this cannot leave slack until this is implemented in Teams.

    • Tim Black commented  ·   ·  Flag as inappropriate

      This feature should also make the fixed-width code text box large enough in the teams window to allow at least 80 columns. Using the current ``` fixed-width formatting, code is commonly very unreadable due to all the unnecessary line wrapping.

    • Chris commented  ·   ·  Flag as inappropriate

      Sadly I'm not in charge of which software we use, but on my team of developers, I would not choose to use Teams because of the absence of this feature. Typing ``` is a start, but it's not good enough. This ought to be one of the #1 priorities for Teams. Devs are often the early-adopters, so the faster you can get this feature out, the more you're likely to see Teams grow.

    • David Williams commented  ·   ·  Flag as inappropriate

      I don't know if this has been mentioned yet or is a separate request or the same thing as this request but it would be helpful even just to keep the syntax formatting when pasting from another application... for example... when copying from SQL Server Management Studio it would be cool to see the syntax formatting maintained instead of converting to teams plain text. Maybe that could be implemented before full snippet support.. don't know... just thought I'd mention it. Keeping Source Formatting would be helpful in many cases. Thanks.

    • Adrian commented  ·   ·  Flag as inappropriate

      Please include good support for keyboard navigation when completing. For example, at present if you Type in "This is a `keyworr`{bs}d" there is no way to then add text *after* the snippet, you're forever stuck in the snippet.

    • Stubbe commented  ·   ·  Flag as inappropriate

      Trying to convince people to migrate from Slack to Teams is made more difficult with features such as this lacking.

    ← Previous 1 3 4 5 6 7

    Feedback and Knowledge Base