Bläddra i källkod

HUE-9265 [assist] Add multiline statement to drag and drop from left assist

There is no equivalent of cursorEndAdjust for adjusting on the line yet
(e.g. SELECT *|\n ....) but to add next.
Romain 5 år sedan
förälder
incheckning
74e1262de0
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3 3
      desktop/core/src/desktop/js/ko/components/ko.editorDroppableMenu.js

+ 3 - 3
desktop/core/src/desktop/js/ko/components/ko.editorDroppableMenu.js

@@ -140,7 +140,7 @@ class EditorDroppableMenu extends DisposableComponent {
     let cursorEndAdjust = 0;
     switch (type) {
       case TYPES.UPDATE:
-        textToInsert = 'UPDATE ' + this.identifier() + ' SET ';
+        textToInsert = 'UPDATE ' + this.identifier() + '\nSET ';
         cursorEndAdjust = -1;
         break;
       case TYPES.DROP:
@@ -149,11 +149,11 @@ class EditorDroppableMenu extends DisposableComponent {
         cursorEndAdjust = -2;
         break;
       case TYPES.INSERT:
-        textToInsert = 'INSERT INTO ' + this.identifier() + ' VALUES ();';
+        textToInsert = 'INSERT INTO ' + this.identifier() + '\nVALUES ();';
         cursorEndAdjust = -3;
         break;
       case TYPES.SELECT:
-        textToInsert = 'SELECT * FROM ' + this.identifier() + ' LIMIT 100;';
+        textToInsert = 'SELECT *\nFROM ' + this.identifier() + '\nLIMIT 100\n;';
         cursorEndAdjust = -2;
         break;
       default: