Sending messages is as simple as selecting a channel or DM, typing your message in the chat box at the bottom of the stream, and then hitting Enter. Done!
Of course, CodeStream is chat that is connected to your codebase, so there’s a good chance you’ll want to include a code block with your message. How you do this will vary based on which IDE you’re using. In VS Code, after you select your code block you’ll see a light bulb appear at the left side of your selection. Click it and select “Add CodeStream Comment”.
In Atom, highlight the code block in your source file and then click the “+” button that appears at the right side of your selection.
You can also configure a keybinding for adding a CodeStream comment.
You’ll notice that the most recent developer to touch this code is automatically mentioned (assuming that they’re on your team). You can simply delete the mention if not needed.
Editing & Deleting
Click the gear menu that appears when you hover over one of your messages in the stream to either edit or delete it.
TIP: You can also quickly edit your most recent message by pressing the up arrow key when in the chat box (as long as you haven’t already started to type another message).
If you want to call a teammate’s attention to your message you can @mention them so that they get special notification. Type the @ sign and select the appropriate person’s name from the list that pops up.
CodeStream has threaded discussions to help keep things organized. Click on any message in the stream to see all messages from the thread grouped together, and to add your own comment to the thread. Your comments can even include code blocks!
When you add a comment, the message will appear in the thread view (as depicted above), but it will also appear when you’re viewing the main chat stream. In this view, you’ll see that a snippet of the original message in the thread is included so that everyone is immediately aware that it’s a comment in an existing thread.
Adding comments to a thread instead of just posting in the main chat stream helps provide context, especially if there’s cross-talk going on. Keeping discussions about code organized in threads is also extremely important when it comes to building up your team’s knowledge base and allowing those discussions to be leveraged in the future.
TIP: Your discussions can span source files, or even repos. For example, a teammate may post a code block depicting an API call they’re struggling with, and you could post an example of the proper way to make the call from a different source file.
Show Diff & Apply Patch
Although multiple developers may be working in the same repo, there are many reasons why they may each be looking at different version of the same files. Different branches. Local changes. You name it. It’s important to know that on CodeStream you can discuss ANY line of code and ANY time, even if it’s code that you literally just typed into your local buffer and has yet to be committed.
CodeStream recognizes when the code being discussed doesn’t match what you have locally. In these cases, you’ll see two options below the code block.
- Show Diff - Viewing the code block as a diff against what you have locally is a great way to visualize the differences.
- Apply Patch - If the code block represents a suggestion from a teammate, you can apply the change to your buffer with a single click. Or maybe you just want to view the changes in the context of your own local changes, rather than as a diff. You can easily revert by clicking Revert once you’ve applied the patch.