Forráskód Böngészése

[editor] Remove dependency on ko bindings from AceEditor component and related modules

Johan Ahlen 5 éve
szülő
commit
64aa9d3c9f

+ 3 - 2
desktop/core/src/desktop/js/apps/notebook2/components/aceEditor/AceEditor.vue

@@ -37,8 +37,6 @@
   import { formatSql } from 'apps/notebook2/apiUtils';
   import Executor from 'apps/notebook2/execution/executor';
   import SubscriptionTracker from 'components/utils/SubscriptionTracker';
-  import { INSERT_AT_CURSOR_EVENT } from 'ko/bindings/ace/ko.aceEditor';
-  import { CURSOR_POSITION_CHANGED_EVENT } from 'ko/bindings/ace/aceLocationHandler';
   import { IdentifierChainEntry, ParsedLocation } from 'parse/types';
   import { EditorInterpreter } from 'types/config';
   import { hueWindow } from 'types/types';
@@ -50,6 +48,9 @@
   // Taken from https://www.cs.tut.fi/~jkorpela/chars/spaces.html
   const UNICODES_TO_REMOVE = /[\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u202F\u205F\u3000\uFEFF]/gi;
 
+  const INSERT_AT_CURSOR_EVENT = 'editor.insert.at.cursor';
+  const CURSOR_POSITION_CHANGED_EVENT = 'editor.cursor.position.changed';
+
   const removeUnicodes = (value: string) => value.replace(UNICODES_TO_REMOVE, ' ');
 
   @Component({

+ 2 - 2
desktop/core/src/desktop/js/apps/notebook2/components/aceEditor/autocomplete/AceAutocomplete.vue

@@ -81,8 +81,6 @@
 <script lang="ts">
   import { Ace } from 'ext/ace';
   import ace from 'ext/aceHelper';
-  import { REFRESH_STATEMENT_LOCATIONS_EVENT } from 'ko/bindings/ace/aceLocationHandler';
-  import hueDebug from 'utils/hueDebug';
   import Vue from 'vue';
   import Component from 'vue-class-component';
   import { Prop } from 'vue-property-decorator';
@@ -102,9 +100,11 @@
   import UdfDetailsPanel from './UdfDetailsPanel.vue';
   import Spinner from 'components/Spinner.vue';
   import { clickOutsideDirective } from 'components/directives/clickOutsideDirective';
+  import hueDebug from 'utils/hueDebug';
 
   const aceUtil = <Ace.AceUtil>ace.require('ace/autocomplete/util');
   const HashHandler = <typeof Ace.HashHandler>ace.require('ace/keyboard/hash_handler').HashHandler;
+  const REFRESH_STATEMENT_LOCATIONS_EVENT = 'editor.refresh.statement.locations';
 
   @Component({
     components: {