File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 33 [
44 " @babel/preset-env" ,
55 {
6- "modules" : false ,
6+ "modules" : " commonjs " ,
77 "useBuiltIns" : " usage" ,
88 "corejs" : 2 ,
99 "exclude" : [
Original file line number Diff line number Diff line change 2323 "babel-plugin-async-to-promises" : " ^1.0.5" ,
2424 "ci-publish" : " ^1.3.1" ,
2525 "codemirror" : " ^5.48.4" ,
26+ "codemirror-grammar-mode" : " ^0.1.9" ,
2627 "css-loader" : " 2.1.1" ,
2728 "debounce" : " ^1.2.0" ,
2829 "deepmerge" : " ^1.5.0" ,
3233 "fast-async" : " 7" ,
3334 "flatten" : " ^1.0.2" ,
3435 "github-markdown-css" : " ^3.0.1" ,
36+ "google_modes" : " git+https://github.com/codemirror/google-modes.git" ,
3537 "html-webpack-plugin" : " ^3.2.0" ,
3638 "is-empty-object" : " ^1.1.1" ,
3739 "markdown-it" : " ^8.4.2" ,
Original file line number Diff line number Diff line change 1- import 'codemirror' ;
1+ import CodeMirror from 'codemirror' ;
22import 'codemirror/lib/codemirror' ;
33import 'codemirror/addon/hint/show-hint'
44import 'codemirror/addon/hint/anyword-hint'
@@ -24,6 +24,10 @@ import TargetPlatform from '../target-platform'
2424import ExecutableFragment from './executable-fragment' ;
2525import '../styles.scss' ;
2626
27+ globalThis . CodeMirror = CodeMirror ;
28+ require ( 'codemirror-grammar-mode' ) ;
29+ require ( 'google_modes/dist/kotlin' ) ;
30+
2731const INITED_ATTRIBUTE_NAME = 'data-kotlin-playground-initialized' ;
2832const DEFAULT_INDENT = 4 ;
2933
@@ -51,7 +55,7 @@ const ATTRIBUTES = {
5155
5256const MODES = {
5357 JAVA : "text/x-java" ,
54- KOTLIN : "text/x -kotlin" ,
58+ KOTLIN : "google -kotlin" ,
5559 JS : "text/javascript" ,
5660 GROOVY : "text/x-groovy" ,
5761 XML : "text/html" ,
You can’t perform that action at this time.
0 commit comments