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

Vscode autocomplete not working #76

Closed
toplinuxsir opened this issue Mar 3, 2017 · 5 comments
Closed

Vscode autocomplete not working #76

toplinuxsir opened this issue Mar 3, 2017 · 5 comments

Comments

@toplinuxsir
Copy link

  • VSCode Version: 1.10.1
  • OS Version: Debian stretch
  • REST Client Version:0.12.3

Steps to Reproduce:

The console output is :

Extension Host] Uncaught Exception: SyntaxError: Unexpected token s in JSON at position 21935d.logExtensionHostMessage @ extensionHost.ts:282(anonymous function) @ extensionHost.ts:137emitTwo @ events.js:106emit @ events.js:191process.nextTick @ internal/child_process.js:744_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98
extensionHost.ts:282 [Extension Host] SyntaxError: Unexpected token s in JSON at position 21935
at fs.readFile (/home/lhs/.vscode/extensions/humao.rest-client-0.12.3/out/src/persistUtility.js:118:42)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)d.logExtensionHostMessage @ extensionHost.ts:282(anonymous function) @ extensionHost.ts:137emitTwo @ events.js:106emit @ events.js:191process.nextTick @ internal/child_process.js:744_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98
shell.ts:426 Unexpected token s in JSON at position 21935: SyntaxError: Unexpected token s in JSON at position 21935
at fs.readFile (/home/lhs/.vscode/extensions/humao.rest-client-0.12.3/out/src/persistUtility.js:118:42)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)e.onUnexpectedError @ shell.ts:426(anonymous function) @ shell.ts:383e.onUnexpectedError @ errors.ts:68o @ errors.ts:88t.onUnexpectedExtHostError @ mainThreadErrors.ts:13e.handle @ abstractThreadService.ts:34s @ ipcRemoteCom.ts:275f @ ipcRemoteCom.ts:231_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98

@Huachao
Copy link
Owner

Huachao commented Mar 3, 2017

@toplinuxsir I think it should be the history.json is corrupted, whose content is used for auto completion, and can you check the file under this path %USERPROFILE%\.rest-client\history.json, and update it to make it as a valid JSON, or simply clear the file content.

@toplinuxsir
Copy link
Author

@Huachao Yes, it works Thanks

@toplinuxsir
Copy link
Author

But is there any way to escape special character such as &
For Example :
GET http://10.192.2.239:5000/help/auth_email
?email=ttt@sohu.com
&passwd=pass123&*(

But the backend only receive the param passwd is "pass123" not the whole string "pass123&*("

@Huachao
Copy link
Owner

Huachao commented Mar 3, 2017

@toplinuxsir I think & is a special character in query string which is used as a separator, so I can not tell the & precisely in query string is the separator or just a normal character. I think you'd better manually escape the & to %26.

In my code, other unescaped characters are already encoded, while & it not by design. I also test the behavior of curl, it's the same as mine.

Or can you avoid passing the passwd in query string, like set them in body, and setting password in url is not a secure way. Just my personal advice, sorry for any inconvenience.

@Huachao
Copy link
Owner

Huachao commented Mar 3, 2017

@toplinuxsir I close the issue now, please feel free to reopen it.

@Huachao Huachao closed this as completed Mar 3, 2017
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

2 participants