Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Suggest multi-line changes in Pull Requests

I'm attempting to use the feature called out in the Bitbucket Server 6.6 release notes to suggest changes directly in pull requests, via the suggestion block syntax.

Given the following in a pull request (as a trivial example):

   val first = pair.first
val second = pair.second

I want to make a suggestion to replace both these lines with

```suggestion
val (first, second) = pair
``` 

however, I'm not finding any information on how to make it clear that this suggestion should be applied to both of the source lines.

I've used a similar feature in GitLab pull requests, and was able to provide an argument to indicate (say I clicked on the line containing the second line in the example given) - I don't recall the exact syntax, but something like `suggestion-2+1`. Is there any syntax like this that will allow multi-line snippets of code to be changed directly in a pull request via this feature?

1 answer

1 accepted

0 votes
Answer accepted

Hi @Kajsa Anderson the multiline suggestions are not yet supported by Bitbucket. What you can do is to try to add suggestions to both lines individually.

We do have a feature request for adding support for multiline suggestions: https://jira.atlassian.com/browse/BSERV-12219 

You can vote on that ticket and add yourself as a watcher. 

Thanks,
Maciej

So in the example I gave, would that require commenting on the first line with an empty suggestion?

Yes, the first suggestion would update the first line and an empty suggestion like this one below would remove the second line:

```suggestion
```

Here is the example

Screen Shot 2020-06-17 at 08.58.45.png

This is highly annoying for code suggestions that are more than 2-3 lines long.

Like Kajsa Anderson likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

456 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you