Bladeren bron

代码块的缩进

kilnonedre 1 jaar geleden
bovenliggende
commit
f61de50c5a

+ 10 - 10
packages/yili-dag/src/DatasourceNodeInfo.tsx

@@ -16,16 +16,16 @@ import { CheckboxChangeEvent } from 'antd/es/checkbox';
 export default class DatasourceNodeInfo extends React.Component<any, any> {
   formRef = React.createRef();
 
-  constructor(props: any) {
-    super(props);
-    this.state = {
-      debugTable: [],
-      localDebugTable: [],
-      currentTablePath: 'node',
-      nodeName: '',
-      checkAll: false
-    };
-  }
+constructor(props: any) {
+super(props);
+this.state = {
+  debugTable: [],
+  localDebugTable: [],
+  currentTablePath: 'node',
+  nodeName: '',
+  checkAll: false
+};
+}
 
   async getDebugTableList() {
     const { data } = await getDebugTable({

+ 16 - 4
packages/yili-dag/src/ScriptEditor.tsx

@@ -105,11 +105,23 @@ export default class ScriptEditor extends React.Component<any, any> {
         indentUnit: 4,
         tabSize: 4,
         extraKeys: {
-          Tab: cm => {
+          Tab: (cm) => {
             const indentUnit = cm.getOption('indentUnit') as number;
-            var spaces = Array(indentUnit + 1).join(' ');
-            cm.replaceSelection(spaces);
-          }
+            if (cm.somethingSelected()) {    
+                cm.indentSelection('add');  
+            } else {                   
+                cm.replaceSelection(Array(indentUnit + 1).join(" "));
+            }   
+        },  
+        "Shift-Tab": (cm) => {              
+            if (cm.somethingSelected()) {
+                cm.indentSelection('subtract');  
+            } else {
+                const cursor = cm.getCursor();
+                cm.setCursor({line: cursor.line, ch: cursor.ch - 4});  
+            }   
+            return ;
+        },  
         }
       }
     );

+ 8 - 8
testutils/test/start_jupyter_server.spec.ts

@@ -6,14 +6,14 @@ const fetch = require('node-fetch');
 import { JupyterServer } from '../src';
 import { PageConfig, URLExt } from '@jupyterlab/coreutils';
 
-describe('JupyterServer', () => {
-  it('should start the server', async () => {
-    jest.setTimeout(20000);
-    const server = new JupyterServer();
-    const url = await server.start();
-    await fetch(URLExt.join(url, 'api'));
-    await server.shutdown();
-  });
+                describe('JupyterServer', () => {
+                  it('should start the server', async () => {
+                    jest.setTimeout(20000);
+                    const server = new JupyterServer();
+                    const url = await server.start();
+                    await fetch(URLExt.join(url, 'api'));
+                    await server.shutdown();
+                  });
 
   it('should accept options', async () => {
     jest.setTimeout(20000);

File diff suppressed because it is too large
+ 0 - 0
untitled.dag


Some files were not shown because too many files changed in this diff