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

Others enhancements #12

Closed
9 tasks done
StephD opened this issue Jul 12, 2016 · 48 comments
Closed
9 tasks done

Others enhancements #12

StephD opened this issue Jul 12, 2016 · 48 comments

Comments

@StephD
Copy link

StephD commented Jul 12, 2016

  • VSCode Version: 1.3
  • OS Version: Win 7

I don't know if it's better to create different issue but here is some proposition and sorry for the english :).

Enhancement :

  • Create a new document with the response content to avoid the white background. To be homogeneous with the application.
  • The scroll bar isn't display. It appear if I change the file tab and back to the content-preview (into same same editor).
  • The content-preview take some time to appear if I change the tab and back in the preview. Not instant at least.
  • Allow to download file as a browser would do or display the content of the file (if possible :))
  • crlt+alt+r send the current line request or until the next GET/POST
    I create a file with some request on each line to test my code and I have to highlight the whole line to send a request:
    GET http://......
    GET http://.....
  • Display error message if the request is not send due to a malformed request.
  • Add collapsible functionality for json and xml?
  • Display the line number?
  • Make at least three # at the beginning of the line as the delimiter
@Huachao
Copy link
Owner

Huachao commented Jul 12, 2016

@StephD, I think your suggestions are very nice, and I will investigate all of them, and reply in this thread later. And thanks so much @StephD , if you have interest in my project, it would be very appreciate that you can contribute to this code base

@StephD
Copy link
Author

StephD commented Jul 12, 2016

I'm not sure to have time and knowledge to improve the code and pull request. Sorry :(

@Huachao
Copy link
Owner

Huachao commented Jul 12, 2016

@StephD, don't feel sorry. It's really nice that you have already given so many great suggestions, thanks for your contributions 😃

@Huachao
Copy link
Owner

Huachao commented Jul 21, 2016

@StephD , the issue that don't show white background has been fixed in latest version 0.6.0, you can have a try 😄

@StephD
Copy link
Author

StephD commented Aug 2, 2016

Thanks. It's way more friendly like that now

@Huachao
Copy link
Owner

Huachao commented Aug 5, 2016

@StephD for task 2, can you still repro?

@StephD
Copy link
Author

StephD commented Aug 5, 2016

Yes, but now, the scroll bar disappear after a second request and without changing the tab.
example :

  • Open the program
  • Open my http file
  • Execute the rest request, everything is fine (scroll bar)
  • Re-execute the request, scroll bar disappear.

BUT
If I open a file or create a new one in the right column (where "Response" is). It will add a new tab and "hide" 'Response'. If I click on response tab or re-execute the request, it will reload the tab (time before text appear cf task n°3) and scroll will be there.

Something wrong about the text loading maybe

ps: problem is still there after 1.4 update

Hope you understand that :)

@Huachao
Copy link
Owner

Huachao commented Aug 5, 2016

@StephD understand, and This is a known issue in VS Code microsoft/vscode#8256. You can also repro this for markdown preview.

@StephD
Copy link
Author

StephD commented Aug 5, 2016

Well, let see how it will be improved by Microsoft

@Huachao
Copy link
Owner

Huachao commented Aug 8, 2016

@StephD for task 3, can you see the preview result quickly when you switch back to preview tab?

@StephD
Copy link
Author

StephD commented Aug 8, 2016

I don't really know. Hard to compare. I may look like faster...
It's not so annoying.
Because it look like an opened file, I thought that the loading time could be instant, like a file, but if it's another form of file, it's ok like that, for me.

Task 5 is more useful for me

@Huachao
Copy link
Owner

Huachao commented Aug 8, 2016

ok, I will mark task 3 completed, I did some change which I think can improve the loading performance, since previously the style file is loaded from the web, now it's stored in local file.

@StephD
Copy link
Author

StephD commented Aug 8, 2016

Another enhancement :
Display error message if the request is not send due to a malformed request.
Because you ask a blank line between headers and body, nothing appear if I try to execute this request without this blank line.

The execution look like a normal request but the server will never receive something and nothing will happen.

@StephD
Copy link
Author

StephD commented Aug 9, 2016

The new version display an error is there isn't any blank line but I'm not sure that this error is very explicit.
This is just a proposition :). Good works btw
=> Request structure is not valid. Request body must be preceded by a blank line.

2016-08-09 09_26_38-fl http - gateway - visual studio code

@Huachao
Copy link
Owner

Huachao commented Aug 9, 2016

@StephD I currently pass all the lines to be request package, and let it to check whether the headers are valid, I can improve this to check this from my code and show more user friendly error message

@StephD
Copy link
Author

StephD commented Aug 9, 2016

Yes, it's just about the friendliness of the message.

@Huachao
Copy link
Owner

Huachao commented Aug 9, 2016

@StephD I will improve it later, and mark the task not finished

@StephD
Copy link
Author

StephD commented Aug 9, 2016

Is it possible to add a collapsible functionality for json and xml (like a vscode file)?
And the number of lines?
Do you prefere to let me add questions to my post?

@Huachao
Copy link
Owner

Huachao commented Aug 9, 2016

@StephD do you mean add collapsible functionality for request body or response body? I found for request body already has collapsible functionality.

And for number of lines, I found it's a function of VS Code, I can see number line in my VS Code for .http and .rest file

@StephD
Copy link
Author

StephD commented Aug 9, 2016

Both are for the response body.

@Huachao
Copy link
Owner

Huachao commented Aug 9, 2016

@StephD for response tab in my extension is html page actually, I will investigate it. However, they are with low priority since I think this is not a very strong requirement.

@StephD
Copy link
Author

StephD commented Sep 6, 2016

Hello :)

I come back to you about the 5th functionality.
I'd love to push ctrl+alt+r on any line and launch the current line/section/request instead of the first one of the file.

If I have two or more row with different request, I have to highline the full line and do the action if I want to execute the second, third request.
If I just click at the end of a get request and do the action, it's the first request of the file that will be executed.

I hope you understand what I'm trying to explain :)

Maybe add a detection until the next/previous GET/POST word and execute the whole group of line?

Cheers

@Huachao
Copy link
Owner

Huachao commented Sep 6, 2016

@StephD in my implementation, in fact I will have steps to run a request, first is getting request text, second is parsing request. In getting request text step, the logic is quite easy, if highlighted, text is highlighted text, if not, the whole topic. And I will remove all the comment lines in selected text. And pass these text to parsing request step. In parsing request step, I will parse the first request and execute it.

And we can discuss how to improve the whole flow. Any suggestions or ideas are warmly welcomed

@StephD
Copy link
Author

StephD commented Sep 6, 2016

The logic is good and quite easy :)
Is it possible to detect the selected line?
If I click somewhere, vscode highlight (as background color) the whole line (not only the text).
Vscode know where my cursor is so maybe you can detect it and pass this variable to the parsing request step?
You introduce the possibility the have a GET request on multiple line, so I suppose that you can detect blank line.

May be something like

select row = this
Readline as line : number
   If line include GET/POST
       saved req = number
   else 
       next line

   if saved line < select_row
      prev_req = saved_line
   elseif line > select_row
      next_req = savec_line
end readline

parsed_request = whole_text - (size from 0 to prev_req)
// Will remove all the line before the current request
// Parsing request step will execute the first request into the parsed text

@Huachao
Copy link
Owner

Huachao commented Sep 6, 2016

@StephD one scenario I found maybe confusing is that, if we only have one request in file, originally, use can set the cursor anywhere, and just press ctrl+alt+r to send the request, now, he has to move the cursor to first line of the request, right? Will this be a bad user experience?

@StephD
Copy link
Author

StephD commented Sep 6, 2016

I'm confuse about what you are explaining and didn't understand well.
Are you saying that if you make a change, user will have to click on the first line of the file if there is only one request?
If yes, I don't understand the bad user experience or what can be bad about that because with only one request in the file, with the algorithm I propose, it will be always the first request that will be sended

@Huachao
Copy link
Owner

Huachao commented Sep 6, 2016

My question is where the cursor should be placed if user wants to send out a request (The file only contains one request). In the first line of request or any line, of the request? (Don't use highlight way)

@StephD
Copy link
Author

StephD commented Sep 6, 2016

On any line. To let the user click on the second/third line if he use a multi-line GET syntax.
You should be able to click on any line between a request and the next one to send a request. So with only one request in the file, any line should works.
My algorithm was to remove any line before the current request, so one request should remove 0 line.
I'm open to any question, this is just a suggestion :)

@Huachao
Copy link
Owner

Huachao commented Sep 7, 2016

@StephD a trick to highlight current line in VS Code is to double click on the expected line. This doesn't solve the issue, but you can use this trick to easy your operation.

And I found a rest client extension for Emacs provides what you want, but it uses comments as request separate, what do you think this plan?

@StephD
Copy link
Author

StephD commented Sep 7, 2016

It's not a real highlight. It's just a display feature to show user which line is the cursor. Double-click will highlight the last word.

About the other rest client extension, do you think that a comment part can be part of the parsing algorithm to detect which request should be send? Or the comment is just there "like that", without a real function for the parser

Huachao added a commit that referenced this issue Oct 18, 2016
@Huachao
Copy link
Owner

Huachao commented Oct 18, 2016

@StephD I've added the feature that displays line number in response view, and you can try it in the latest version 0.8.7

@StephD
Copy link
Author

StephD commented Oct 19, 2016

Nice :) Thanks

@Huachao
Copy link
Owner

Huachao commented Nov 7, 2016

@StephD I've already supported multiple requests in the same file which is separated by delimiter ###, and you can simply kick off the request just placing the cursor anywhere between the delimiters. You can try the latest version 0.10.1, and you can view the usage details in README.md

@StephD
Copy link
Author

StephD commented Nov 7, 2016

Hi,
It seem to be a nice and easy feature but I cannot make it works even with your exemple :(

2 things :
First, if I try your exemple, the feature doesn't works. I mean, If I click somewhere between 2 delimiters, the line before GET, GET line or the line after and push the shortcut, it return my a 400 bad request or the first request. You can see the highlight line.
BAD
2016-11-07 16_43_58-response 388ms - gateway - visual studio code.
GOOD
2016-11-07 16_46_34-response 431ms - gateway - visual studio code

Same probleme on my file, it but it send the first line request. I still have to hightlight the request line if I want to send the GET request, even between ### delimiter. So i suppose that there is still an issue about this functionnality.

Second, but I think that it a previous change, I cannot have one request per line anymore. I must have, at least, a blank line to delimit the requests, is it correct and normal?
2016-11-07 16_48_41- untitled-1 - gateway - visual studio code
I think it's easier for you to develop functionality and delimiter or header detection with the kind of syntax.

Small third thing. I do not more have the scroll bar problem (enhancement 2). Maybe vscode update fixed it.

Thanks

@Huachao
Copy link
Owner

Huachao commented Nov 7, 2016

@StephD thanks for your quick response, in my test it works fine. Could you please make sure you've installed the latest version 0.10.1, since vs code sometimes has the cache issue? or simply uninstall and then reinstall it?
For question 2, we only needs ### delimiter line, no need blank line, as follows:

GET https://api.github.com/users/Huachao HTTP/1.1
###
GET https://api.github.com/repos/Huachao/vscode-restclient HTTP/1.1
###
GET https://api.github.com/users/fakeuser HTTP/1.1

For question 3, it seems still exists in my vscode 1.7.1 😄

@StephD
Copy link
Author

StephD commented Nov 8, 2016

I thought that your extension was updated to last last version yesterday. But this morning, it was installing the last update (version 0.10.2) and the exemple you gave me works fine.

For the question 2, here is my exemple.
No blank line
2016-11-08 09_03_15- hello rest - gateway - visual studio code
Blank or delimiter works
2016-11-08 09_03_33-response 302ms - gateway - visual studio code

For me, it doesn't bother me even if I don't know why I got header mistake because it only have to launch the first line as request (GET).

Btw, I will have to add ### at each line to add your functionnality that is very appreciated :).

Question 3. The procedure I explained do not reproduce the error (tab changement). It has you want :)

I'm not more very active on my REST program so I do not follow all your changes for the moment. It still a very good extension and it seem to be appreciated by the community with your 60k+ download :)

@Huachao
Copy link
Owner

Huachao commented Nov 8, 2016

@StephD for question 2, since you need to add ### to separate multiple requests, blank line can work is just due to my code works unexpected. Any I forgot to say I didn't quite follow your suggestion, I need explicit delimiters.
Although you are not active on REST program, and thanks so much for your suggestion and help for my extension, without your help, it can't go step further. You are one of the most important guys in my extension development. Thank you!!!

@StephD
Copy link
Author

StephD commented Nov 18, 2016

I know you said the is not available right now, but is it possible (may be hard) to add text to the ### feature? Like the following exemple
### test ###
GET http...

@Huachao
Copy link
Owner

Huachao commented Nov 18, 2016

@StephD nice suggestion, I have implemented it that line begins with ### is thought as delimeter, and you can append any text after it. I will publish this version ASAP

@Huachao
Copy link
Owner

Huachao commented Feb 1, 2017

@StephD the scroll bar issue is fixed in VS Code microsoft/vscode#8256 of vs code 1.9

@Huachao Huachao removed the upstream label Feb 1, 2017
@Huachao
Copy link
Owner

Huachao commented Feb 26, 2017

@StephD I have implemented the feature that you can download the response body as a file, like if the response is application/json, when you click the Save Response Body icon, you can save the json file which contains the response body, and if the response is image/jpeg, when you save it, you will get a jpeg file.

And I will publish this in next release

@StephD
Copy link
Author

StephD commented Feb 28, 2017

I would love to see that :)

@bjornreppen
Copy link

bjornreppen commented Apr 10, 2017

I was wondering if it is possible to incorporate and execute the calls from inside a Markdown file. I guess what I am looking for is a way to document the calls for the next poor person that has to take over my work.

@Huachao
Copy link
Owner

Huachao commented Apr 10, 2017

@mashi do you mean add API document or description for each REST call?

@bjornreppen
Copy link

bjornreppen commented Apr 10, 2017

I would like to add human readable descriptions above each of the calls if possible to describe the request ie. change Alice's password to monkey or for example describe a sequence of calls.

@Huachao
Copy link
Owner

Huachao commented Apr 10, 2017

@mashi nice suggestion, there's already a similar issue in #67

@bjornreppen
Copy link

bjornreppen commented Apr 10, 2017

Sorry for duplicating. Yes, that's exactly what I was looking for. :-)

@Huachao
Copy link
Owner

Huachao commented Jan 23, 2018

Close this to in favor of the only missing feature request #157

@Huachao Huachao closed this as completed Jan 23, 2018
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

3 participants