From d687debf33277ee7ad717c4f34a60cf7617b43b9 Mon Sep 17 00:00:00 2001 From: RamiBerm <54766858+RamiBerm@users.noreply.github.com> Date: Thu, 13 Jan 2022 09:21:47 +0200 Subject: [PATCH] fix push import order (#32) * Update webviewCommunicator.ts and main.css * Update main.css --- src/providers/webviewCommunicator.ts | 14 +++++++------- src/webview/src/main.css | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/providers/webviewCommunicator.ts b/src/providers/webviewCommunicator.ts index f26a6a5..c752211 100644 --- a/src/providers/webviewCommunicator.ts +++ b/src/providers/webviewCommunicator.ts @@ -196,15 +196,15 @@ export class UP9WebviewCommunicator { const currentEditorContents = editor.document.getText(); if (currentEditorContents) { //insert missing imports at the top + const missingImports = this.getMissingImportsInCode(currentEditorContents); editor.edit(editBuilder => { - editBuilder.insert(new vscode.Position(0, 0), this.getMissingImportsInCode(currentEditorContents)); + editBuilder.insert(new vscode.Position(0, 0), missingImports); + if (currentEditorContents.indexOf("class ") == -1) { + editBuilder.insert(editor.selection.active, `${microTestsClassDef}\n${code}`); + } else { + editBuilder.insert(editor.selection.active, `\n\n${code.replace(' ', '')}`); + } }); - - if (currentEditorContents.indexOf("class ") == -1) { - editor.insertSnippet(new vscode.SnippetString(`${microTestsClassDef}\n${code}`)); - } else { - editor.insertSnippet(new vscode.SnippetString(`\n\n${code.replace(' ', '')}`)); - } } else { editor.insertSnippet(new vscode.SnippetString(`${microTestsHeader}\n${code}`)); } diff --git a/src/webview/src/main.css b/src/webview/src/main.css index f6d30ff..ab730b5 100644 --- a/src/webview/src/main.css +++ b/src/webview/src/main.css @@ -118,7 +118,7 @@ table { .anchor-tab { text-decoration: none; color: var(--vscode-editor-foreground); - opacity: 0.8; + opacity: 0.6; text-transform: capitalize; margin-right: 24px; user-select: none; @@ -128,12 +128,12 @@ table { .anchor-tab.active { border-bottom: 1px solid var(--vscode-editor-foreground) !important; - font-weight: bold; + opacity: 1 !important; } .anchor-tab:active, .anchor-tab:hover { color: var(--vscode-editor-foreground); - opacity: 1; + opacity: 0.8; border-bottom: 1px solid var(--vscode-input-background); }