diff --git a/CHANGELOG.md b/CHANGELOG.md index 852a9f2c..3cddc1b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 0.19.0 (2018/6/28) +* __Breaking Change__: Remove support for setting `rest-client.defaultuseragent`, replace this with `rest-client.defaultHeaders` which has more capability to add other default request headers +* __Breaking Change__: Remove support for setting `rest-client.previewResponseInActiveColumn`, replace this with `rest-client.previewColumn` which has more capability to specify which column to preview, not just currently active one +* __Feature__: [Add support for default headers](https://github.com/Huachao/vscode-restclient/pull/206) ([@Kronuz](https://github.com/Kronuz)) +* __Feature__: [Show response preview in right editor](https://github.com/Huachao/vscode-restclient/issues/216) +* __Feature__: [Preserve focus of the http editor](https://github.com/Huachao/vscode-restclient/issues/167) +* __Bug Fix__: [Setting: 'previewOption' does not work in combination with 'previewResponseInUntitledDocument'](https://github.com/Huachao/vscode-restclient/issues/183) +* __Bug Fix__: Fix Chinese encoding not copied to clipboard +* __Improvement__: [Retina icon](https://github.com/Huachao/vscode-restclient/pull/217) ([@pluwen](https://github.com/pluwen)) +* __Improvement__: Add http language default configuration `editor.quickSuggestions` +* __Improvement__: Refactor resolving http variables logic +* __Improvement__: Leverage new Webview API to render response and code snippet + ## 0.18.4 (2018/5/4) * __Feature__: [Open a saving dialogue when saving response and response body](https://github.com/Huachao/vscode-restclient/issues/186) * __Bug Fix__: [Do not empty rulesets](https://github.com/Huachao/vscode-restclient/pull/203) ([@mtxr](https://github.com/mtxr)) diff --git a/README.md b/README.md index 8b721b03..7a224b6f 100644 --- a/README.md +++ b/README.md @@ -321,7 +321,7 @@ Environments give you the ability to customize requests using variables, and you Environments and including variables are defined directly in `Visual Studio Code` setting file, so you can create/update/delete environments and variables at any time you wish. If you __DO NOT__ want to use any environment, you can choose `No Environment` in the environment list. Notice that if you select `No Environment`, variables defined in shared environment are still available. See [Environment Variables](#environment-variables) for more details about environment variables. ## Variables -We support two types of variables, one is __Custom Variables__ which is defined by user and can be further divided into __Environment Variables__, __File Variables__ and __Request Variables__, the other is __System Variables__ which is a predefined set of variables out-of-box. +We support two types of variables, one is __Custom Variables__ which is defined by user and can be further divided into __Environment Variables__, __File Variables__ and __Request Variables__, the other is __System Variables__ which is a predefined set of variables out-of-box. The reference syntax of system and custom variables types has a subtle difference, for the former the syntax is `{{$SystemVariableName}}`, while for the latter the syntax is `{{CustomVariableName}}`, without preceding `$` before variable name. The definition syntax and location for different types of custom variables are obviously different. Notice that when the same name used for custom variable, request variables takes higher resolving precedence over file variables, file variables takes higher precedence over environment variables. @@ -504,7 +504,8 @@ exchange | Preview the whole HTTP exchange(request and response) * `rest-client.disableHighlightResonseBodyForLargeResponse`: Controls whether to highlight response body for response whose size is larger than limit specified by `rest-client.largeResponseSizeLimitInMB`. (Default is __true__) * `rest-client.disableAddingHrefLinkForLargeResponse`: Controls whether to add href link in previewed response for response whose size is larger than limit specified by `rest-client.largeResponseSizeLimitInMB`. (Default is __true__) * `rest-client.largeResponseBodySizeLimitInMB`: Set the response body size threshold of MB to identify whether a response is a so-called 'large response', only used when `rest-client.disableHighlightResonseBodyForLargeResponse` and/or `rest-client.disableAddingHrefLinkForLargeResponse` is set to true. (Default is __5__) -* `rest-client.previewResponseInActiveColumn`: Preview response in current active column. (Default is __false__) +* `rest-client.previewColumn`: Response preview column option. 'left' for previewing in the left most editor column. 'center' for previewing in the center editor column(three columns layout) or right most editor column(two columns layout). 'right' for previewing in the right most editor column. 'current' for previewing in the column of current request file. (Default is __center__) +* `rest-client.previewResponsePanelTakeFocus`: Preview response panel will take focus after receiving response. (Default is __True__) Rest Client extension respects the proxy settings made for Visual Studio Code (`http.proxy` and `http.proxyStrictSSL`). Only HTTP and HTTPS proxies are supported. diff --git a/package.json b/package.json index 90576d7f..2b9aa9af 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "rest-client", "displayName": "REST Client", "description": "REST Client for Visual Studio Code", - "version": "0.18.4", + "version": "0.19.0", "publisher": "humao", "author": { "name": "Huachao Mao", @@ -478,12 +478,6 @@ "scope": "resource", "description": "Set the response body size threshold of MB to identify whether a response is a so-called 'large response', only used when 'rest-client.disableHighlightResonseBodyForLargeResponse' and/or 'rest-client.disableAddingHrefLinkForLargeResponse' is set to true" }, - "rest-client.previewResponseInActiveColumn": { - "type": "boolean", - "default": false, - "scope": "resource", - "description": "Preview response in current active column" - }, "rest-client.previewColumn": { "type": "string", "enum": [ @@ -494,7 +488,7 @@ ], "default": "center", "scope": "resource", - "description": "Response preview column option. 'left' for previewing in the left most editor column. 'center' for previewing in the center editor column. 'right' for previewing in the right most editor column. 'current' for previewing in the column of current request file." + "description": "Response preview column option. 'left' for previewing in the left most editor column. 'center' for previewing in the center editor column(three columns layout) or right most editor column(two columns layout). 'right' for previewing in the right most editor column. 'current' for previewing in the column of current request file." }, "rest-client.previewResponsePanelTakeFocus": { "type": "boolean", diff --git a/src/controllers/historyController.ts b/src/controllers/historyController.ts index fb7df27a..d9693272 100644 --- a/src/controllers/historyController.ts +++ b/src/controllers/historyController.ts @@ -99,7 +99,6 @@ export class HistoryController { private errorHandler(error: any) { this._outputChannel.appendLine(error); - this._outputChannel.show(); window.showErrorMessage("There was an error, please view details in output log"); } diff --git a/src/controllers/requestController.ts b/src/controllers/requestController.ts index 8c19cc23..ce41d2c5 100644 --- a/src/controllers/requestController.ts +++ b/src/controllers/requestController.ts @@ -157,7 +157,6 @@ export class RequestController { } catch (reason) { this._outputChannel.appendLine(reason); this._outputChannel.appendLine(reason.stack); - this._outputChannel.show(); window.showErrorMessage(reason); } @@ -181,7 +180,6 @@ export class RequestController { this._durationStatusBarItem.text = ''; this._outputChannel.appendLine(error); this._outputChannel.appendLine(error.stack); - this._outputChannel.show(); window.showErrorMessage(error.message); } finally { this._requestStore.complete(requestId); diff --git a/src/utils/httpVariableProvider/systemVariableProvider.ts b/src/utils/httpVariableProvider/systemVariableProvider.ts index efbc9ae9..89b22056 100644 --- a/src/utils/httpVariableProvider/systemVariableProvider.ts +++ b/src/utils/httpVariableProvider/systemVariableProvider.ts @@ -184,6 +184,7 @@ export class SystemVariableProvider implements HttpVariableProvider { } else { resolveToken(cachedToken, false); } + return; } acquireToken(); diff --git a/src/utils/variableProcessor.ts b/src/utils/variableProcessor.ts index 82e0b862..ef824676 100644 --- a/src/utils/variableProcessor.ts +++ b/src/utils/variableProcessor.ts @@ -26,7 +26,7 @@ export class VariableProcessor { while (match = variableRefercenceRegex.exec(request)) { result += request.substring(lastIndex, match.index); lastIndex = variableRefercenceRegex.lastIndex; - const name = match[1]; + const name = match[1].trim(); const document = window.activeTextEditor.document; const context = { rawRequest: request, parsedRequest: result }; for (const provider of VariableProcessor.providers) { diff --git a/src/views/httpResponseWebview.ts b/src/views/httpResponseWebview.ts index cfdde9fc..ee102609 100644 --- a/src/views/httpResponseWebview.ts +++ b/src/views/httpResponseWebview.ts @@ -75,7 +75,7 @@ export class HttpResponseWebview extends BaseWebview { panel.webview.html = this.getHtmlForWebview(response); - commands.executeCommand('setContext', this.httpResponsePreviewActiveContextKey, true); + commands.executeCommand('setContext', this.httpResponsePreviewActiveContextKey, this.settings.previewResponsePanelTakeFocus); panel.reveal(this.settings.previewColumn, !this.settings.previewResponsePanelTakeFocus);