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

Suggest multi-line changes in Pull Requests

Kajsa Anderson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 15, 2020

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?

2 answers

1 accepted

0 votes
Answer accepted
Maciej Adamczak
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 15, 2020

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

Kajsa Anderson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 16, 2020

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

Maciej Adamczak
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 16, 2020

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

Omar Badoolah
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 29, 2021

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

Like # people like this
Artemka
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 31, 2023

 

the multiline suggestions are not yet supported by Bitbucket

 

And when it will be?

Like # people like this
1 vote
Ravi Babu dasari October 20, 2021

Most of the time I have to use multi line suggestions. so this is unusable for me. But glad that it is in progress and will be available soon.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events