Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Response Preview in Right Editor #216

Closed
chewlm86 opened this issue Jun 2, 2018 · 14 comments
Closed

Show Response Preview in Right Editor #216

chewlm86 opened this issue Jun 2, 2018 · 14 comments

Comments

@chewlm86
Copy link

chewlm86 commented Jun 2, 2018

Hi,

Currently i am working with 3 editor at the same time(Left, Center, Right).
Would it be possible, to show the response preview in the Right Editor while having the .http in the Center Editor?
Perhaps a configuration to choose where to show the response preview.

@Huachao
Copy link
Owner

Huachao commented Jun 3, 2018

@chewlm86 nice suggestion, I have implemented it and will publish it in next release.

@Huachao Huachao closed this as completed Jun 3, 2018
@Huachao
Copy link
Owner

Huachao commented Jun 28, 2018

@chewlm86 you can use the new setting rest-client.previewColumn to control this behavior in latest version 0.19.0, and available values are

  • left
  • center
  • right
  • current

@chewlm86
Copy link
Author

chewlm86 commented Jun 30, 2018

@Huachao Thanks for the update, it works great with setup where the editor is configured as follow
("rest-client.previewColumn": "right").
| 1 | 2 | 3 |

With the latest update from vs code which allowed splitting the editor vertically & horizontal at the same time now. Still works when i set it up like this as well as long it is placed within the range of the first 3 editor.
("rest-client.previewColumn": "center").
| 1 | 3 | 4 |
| 2 | 3 | 4 |

*Preview column is Bolded.

@Huachao
Copy link
Owner

Huachao commented Jul 2, 2018

@chewlm86 thanks for your information, here I have something to discuss with you, sorry for the late reply. I am thinking about the feature update from VSCode. Do we really need to follow the grid layout of VSCode, that means do we need to expose to our end user for all the column numbers to specify, like One, Two, Three, Four and even to Nine(Which is defined in VSCode API, and in fact the number can be larger as you wish like Ten column). I think it's a bit complex to our users to point out which column they need and even quick know how to count column number. So how about we just expose two options to the rest-client.previewColumn instead of current offerings, current and beside only which applies for the case of current active column and the column next to current view column(the direction of next column depends on your VSCode setting). This seems more clearer for me, and the only concern is that it doesn't fix well for your case, in three columns layout, you need to put your .http in the middle column, and set the setting to beside.

Waiting for your great feedback, thanks in advance. 😄

@chewlm86
Copy link
Author

chewlm86 commented Jul 5, 2018

@Huachao yes i agree that the latest vs code update made positioning the preview column complex with the current implementation.

The new current & beside implementation you describe make sense.
I think it will work well with my current work flow.

Like you said, if i want it display at 3 i would just place the .http in column 2 and the preview will appear in 3.
| 1 | 2 | 3 |

So i have a split in the last column, i would just place the .http in column 3 and the preview will be displayed in 4.
| 1 | 2 | 3 |
| 1 | 2 | 4 |

But i like to suggest that perhaps having previous, current & next would to give a bit more flexibility on where to position the preview column. Work the same way as what you suggested, but having an extra option to place the preview in the column before the .http column.

*.http column is Italic.
*Preview column is Bolded.

@Huachao
Copy link
Owner

Huachao commented Jul 5, 2018

@chewlm86 thanks for your reply, since I can't map the previous value to the actual column number in vscode, since vscode itself only provides the Active and Beside enum value, as well as other concrete column numbers. For current and next are easy to implement and map them to actual enum value of vscode, while the previous is not easy to map. Actually, the new column position of Beside enum value in vscode is controlled by setting workbench.editor.openSideBySideDirection, and this can be either right or below the current editor.

@chewlm86
Copy link
Author

chewlm86 commented Jul 5, 2018

@Huachao So that why didn't know that.
Then that is fine. just keeping it simple. :-)

@Huachao
Copy link
Owner

Huachao commented Jul 6, 2018

@chewlm86 I have updated to code to reflect the latest VSCode update, and new setting value would be current and beside. I still think beside seems more appropriate than next.

@Huachao
Copy link
Owner

Huachao commented Aug 7, 2018

@chewlm86 @svenax I have published a new version 0.19.1, and the setting values of rest-client.previewColumn are beside and current to control the previewing column which reflects the latest VSCode grid layout update.

@chewlm86
Copy link
Author

chewlm86 commented Aug 8, 2018

@Huachao Thanks, works great. :-}

@svenax
Copy link

svenax commented Aug 8, 2018

@Huachao Yup, that works perfectly. Thanks.

@sontd-0882
Copy link

@Huachao How about splitting to bottom or top of the current tab.

@Huachao
Copy link
Owner

Huachao commented Aug 27, 2020

@sontd-0882 top is not supported natively by VS Code, you can open the response tab in the bottom by set "workbench.editor.openSideBySideDirection": "right" and "rest-client.previewColumn": "beside",

@terdong
Copy link

terdong commented Feb 12, 2023

@Huachao How about splitting to bottom or top of the current tab.

It shoud be "workbench.editor.openSideBySideDirection": "down"
In my case, It worked fine, but resulted in a different layout than I had an expectation. So I rolled back again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants