From de4b7af1ade3f9bb91ca0514de15bc52d1339ecf Mon Sep 17 00:00:00 2001 From: swjain23 <36710109+swjain23@users.noreply.github.com> Date: Wed, 20 Nov 2019 12:36:20 -0800 Subject: [PATCH] Set encoding to true (Bug fix for flavor) (#8395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For offline scripts it shows the flavor as “Choose SQL Language”, this is because in flavorStatus.ts line 150 when we compare (uri === currentUri), the value of current Uri is "file:///d%3A/GitHub/PGExtension/TestDatabase/1ae730a9.sql" whereas the value for uri is "file:///d:/GitHub/PGExtension/TestDatabase/1ae730a9.sql" which ends up returning label ‘Choose SQL Language’. In queryInput.ts we set public get uri(): string { return this.getResource().toString(true); } This is the variable that we use in doChangeLanguageFlavor. And as we compare this with getEditorUri() later in flavorStatus.ts, it does not match. So enabling encoding here as well to get the encoded string in both the cases. --- src/sql/workbench/common/sqlWorkbenchUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/workbench/common/sqlWorkbenchUtils.ts b/src/sql/workbench/common/sqlWorkbenchUtils.ts index a4ed002385..d8396d24bb 100644 --- a/src/sql/workbench/common/sqlWorkbenchUtils.ts +++ b/src/sql/workbench/common/sqlWorkbenchUtils.ts @@ -34,7 +34,7 @@ export function getEditorUri(input: IEditorInput): string { } if (uri) { - return uri.toString(); + return uri.toString(true); } return undefined; }