Vscode-restclient: Show Response Preview in Right Editor

Created on 2 Jun 2018  路  13Comments  路  Source: Huachao/vscode-restclient

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.

enhancement

All 13 comments

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

@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

@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.

@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. 馃槃

@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.

@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.

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

@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.

@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.

@Huachao Thanks, works great. :-}

@Huachao Yup, that works perfectly. Thanks.

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

@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",

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Odonno picture Odonno  路  22Comments

akalcik picture akalcik  路  15Comments

codepunkt picture codepunkt  路  29Comments

svenax picture svenax  路  13Comments

ryan-ju picture ryan-ju  路  17Comments