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

Does this plugin support script completion? #100

Closed
henghengyang opened this issue Jan 24, 2022 · 7 comments
Closed

Does this plugin support script completion? #100

henghengyang opened this issue Jan 24, 2022 · 7 comments

Comments

@henghengyang
Copy link

### @name example
GET example.org
?foo=value

{{
console.info(response.parsedBody.data.length)
}}

when i type response key word, there is no code hinting

@AnWeber
Copy link
Owner

AnWeber commented Jan 25, 2022

Code completion for Javascript I have not currently implemented. The implementation means several changes, for which I currently do not find the time. One would have to change the connection from httpyac to VSCode to LSP. From then on you could include the CodeCompletion similar to vetur. This would also allow formatting, ....
As a workaround I would recommend to simply import the javascript using require, then it is possible to achieve code completion using type hints (npm i httpyac needed).

### @name example
GET example.org
?foo=value

{{
require('script.js`)(response);
}}
module.exports = function (/**@type {import('httpyac').HttpResponse}*/ response) {
  console.info(response.parsedBody.data.length);
}

image

@henghengyang
Copy link
Author

Okay,thank you for replay😃
I like this plugin,this is what I’m looking for.
I used IntelliJ http client then rest client,but both them can't satisfy me.

There are still some small details that need to be improved like what I have mentioned

@AnWeber
Copy link
Owner

AnWeber commented Jan 25, 2022

The change is not small:-) But yes, you can still improve quite a bit. If you are interested, I am open to PR, but this change would be rather advanced. But there are still some more construction sites, which I want to attack (RabbitMQ, Debugging Adapter, ...)

@henghengyang
Copy link
Author

I really want to do it, but unfortunately I'm a back-end engineer.😭

Anyway, thank you for developing such a good plugin

@AnWeber
Copy link
Owner

AnWeber commented Jan 25, 2022

:-) I thought so too for a long time. And there's a reason why the whole thing doesn't have a GUI, like maybe postman or hoppscotch:-)

@henghengyang
Copy link
Author

GUI is not very useful.I’d rather test api from file by using ide, it’s more easily faster and freedom

@AnWeber
Copy link
Owner

AnWeber commented Jan 30, 2022

I am closing the ticket to combine all the requirements related to the implementation of LSP into one issue (#101)

@AnWeber AnWeber closed this as completed Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants