@@ -3,10 +3,10 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
33
44let debounce = ( func , wait , immediate ) => {
55 var timeout ;
6- return function ( ) {
6+ return function ( ) {
77 var context = this ,
88 args = arguments ;
9- var later = function ( ) {
9+ var later = function ( ) {
1010 timeout = null ;
1111 if ( ! immediate ) func . apply ( context , args ) ;
1212 } ;
@@ -32,16 +32,14 @@ export class EditorElement extends LitElement {
3232 background-color: rgb(243, 243, 243);
3333 }
3434
35-
36-
3735 .editor-root {
3836 flex-basis: 100%;
3937 }
4038
4139 .tab {
42- background-color: rgb(236,236,236);
40+ background-color: rgb(236, 236, 236);
4341 color: #616161;
44- font-family: -apple-system,BlinkMacSystemFont,sans-serif;
42+ font-family: -apple-system, BlinkMacSystemFont, sans-serif;
4543 font-size: 11px;
4644 padding: 8px 18px;
4745 display: inline-block;
@@ -181,17 +179,21 @@ export class EditorElement extends LitElement {
181179 this . editor . setModel ( this . currentEditorState . model ) ;
182180 this . editor . restoreViewState ( this . currentEditorState . state ) ;
183181 }
182+
183+ this . editor . getAction ( 'editor.action.formatDocument' ) . run ( ) ;
184184 }
185185
186186 render ( ) {
187187 return html `
188188 < div class ="root ">
189189 < div class ="tab-root ">
190- ${ this . fileTypes . map ( type => html `
191- < div @click ="${ _ => this . showTab ( type ) } "
192- class ="tab ${ type === this . currentType ? 'selected' : '' } ">
193- ${ type }
194- </ div > ` ) }
190+ ${ this . fileTypes . map (
191+ type => html `
192+ < div @click ="${ _ => this . showTab ( type ) } " class ="tab ${ type === this . currentType ? 'selected' : '' } ">
193+ ${ type }
194+ </ div >
195+ `
196+ ) }
195197 </ div >
196198 < div class ="editor-root ">
197199 < slot name ="editor "> </ slot >
0 commit comments