mxd %!s(int64=3) %!d(string=hai) anos
pai
achega
d54a4c97da

+ 3 - 1
magic-editor/src/console/src/components/editor/magic-script-editor.vue

@@ -114,7 +114,6 @@ export default {
       theme: store.get('skin') || 'default',
       fontFamily: contants.EDITOR_FONT_FAMILY,
       fontSize: contants.EDITOR_FONT_SIZE,
-      scrollBeyondLastLine: false,
       fontLigatures: true,
       // 自动调整大小
       automaticLayout: true
@@ -127,6 +126,9 @@ export default {
         this.editor.trigger(null, 'editor.action.triggerSuggest', {})
       }
     })
+    CommandsRegistry.registerCommand('editor.action.scrollUp1Line', () => {
+      this.editor.setScrollTop(this.editor.getScrollTop() - 22)
+    })
     this.editor.addCommand(
         monaco.KeyMod.Alt | monaco.KeyCode.US_SLASH,
         () => {

+ 5 - 1
magic-editor/src/console/src/scripts/editor/completion.js

@@ -148,7 +148,11 @@ const completionFunction = async (suggestions, input, env, best) => {
                         kind: monaco.languages.CompletionItemKind.Class,
                         filterText: className,
                         detail: clazz,
-                        insertTextRules: monaco.languages.CompletionItemInsertTextRule.KeepWhitespace,
+                        insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
+                        command: {
+                            id: 'editor.action.scrollUp1Line'
+                        },
+                        insertText: className,
                         additionalTextEdits: [{
                             forceMoveMarkers: true,
                             text: `import ${clazz}\r\n`,