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

Header auto completion is broken in the newest version #422

Closed
Emory-M opened this issue Sep 23, 2019 · 11 comments
Closed

Header auto completion is broken in the newest version #422

Emory-M opened this issue Sep 23, 2019 · 11 comments

Comments

@Emory-M
Copy link

Emory-M commented Sep 23, 2019

  • VSCode Version: 1.38.1
  • OS Version: macOS 10.14.4
  • REST Client Version: 0.22.1

Steps to Reproduce:

  1. switch vscode to http language.
  2. type some http header like Content-Type, not any code completion tips.
  3. downgrade version to 0.22.0 the auto completion is working.
@Huachao
Copy link
Owner

Huachao commented Sep 24, 2019

@Emory-M already fixed ffbd8f2 and will be published in next release

@Huachao Huachao closed this as completed Sep 24, 2019
@Huachao
Copy link
Owner

Huachao commented Sep 25, 2019

@Emory-M you can download the latest version 0.22.2 to verify it.

@Emory-M
Copy link
Author

Emory-M commented Sep 25, 2019

@Huachao It's working, Thank you!
otherwise, about the http code snippet
use ${2:${3:header name}: ${4:header value}} in the header section can be better to use.
fast to delete whole header section if not have any custom header, and then back to use autocomplete to fill.

@Huachao
Copy link
Owner

Huachao commented Sep 29, 2019

@Emory-M I add the header related lines for POST and PUT requests, and I think these requests should contain a body as well as the Content-Type header.

@MisLink
Copy link

MisLink commented Feb 25, 2020

Hi, I have the same issue.

It's very strange. In my some new projects, auto complete is broken:
图片
But in a my old project it works.

I tried to rollback to 0.23.0 and 0.22.2, it still doesn't work. Then I found this issue, I tried to rollback to 0.22.0, it works.

@Huachao
Copy link
Owner

Huachao commented Feb 26, 2020

@MisLink what's the language of your file?

@MisLink
Copy link

MisLink commented Feb 26, 2020

Well.. which kind of language? My vscode language is zh-cn, http file's language is associated to http, all my projects are pure python..

@Huachao
Copy link
Owner

Huachao commented Feb 26, 2020

@MisLink could you please check the output window of VSCode of the REST channel to see if any error message exists
屏幕快照 2020-02-26 下午3 05 27

@MisLink
Copy link

MisLink commented Feb 26, 2020

@Huachao I changed the "rest-client.logLevel" to verbose, but there are not any messages while I trigger the suggest.

@Huachao
Copy link
Owner

Huachao commented Feb 26, 2020

@MisLink Is your .http file a blank file, and did you try to type some characters to see the completion item list?

@MisLink
Copy link

MisLink commented Feb 26, 2020

Nope, it's not blank, there are some requests created by snippets.

I think I found the difference: my old project has these workspace config about rest-client but new one hasn't:

"rest-client.environmentVariables": {
    "$shared": {
      "content_type": "application/json"
    },
    "local": {
      "host": "http://127.0.0.1:5000"
    },
    "dev": {
      "host": "***:5001"
    },
    "prod": {
      "host": "***"
    }
  }

Commenting these lines causes auto-complete to fail.
In my new project, add these line to workspace config:

"rest-client.environmentVariables": {
    "$shared": {},
    "local": {}
  }

auto-complete back to normal.

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

3 participants