File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ const curShowCode = computed(() => {
52
52
<template >
53
53
<div id =" advantage" >
54
54
<div class =" gradient-font title" >Cross Platforms</div >
55
- <div class =" detail-describe" >Download Pivot Lang with the command now !</div >
55
+ <div class =" detail-describe" >Install Pivot Lang compiler with only a few commands !</div >
56
56
<div class =" advantages" >
57
57
<div v-for =" item in platforms" :class =" { 'advantage-item': true, 'selected-item': item.type === currenClickPlatform }" :key =" item.type" >
58
58
<font-awesome-icon
Original file line number Diff line number Diff line change @@ -42,19 +42,24 @@ export class PlMonaco {
42
42
model : this . model ,
43
43
} ) ;
44
44
initializeEditor ( this . editor , code , uri ) ;
45
+ this . uri = uri ;
45
46
}
47
+ private uri : string ;
46
48
editor : monaco . editor . IStandaloneCodeEditor ;
47
49
private model : monaco . editor . ITextModel ;
48
50
setContent ( code : string ) {
49
51
this . editor . revealLine ( 0 ) ;
50
- this . model . setValue ( code ) ;
52
+ this . model . applyEdits ( [ {
53
+ range : this . model . getFullModelRange ( ) ,
54
+ text : code ,
55
+ } ] ) ;
51
56
}
52
57
}
53
58
54
59
// 暂不支持同时创建多个Monaco的DOM
55
60
let created = false ;
56
61
let plMonaco : PlMonaco ;
57
- export default async function createPlMonaco ( container : HTMLElement , code : string = '' ) {
62
+ export default function createPlMonaco ( container : HTMLElement , code : string = '' ) {
58
63
if ( ! created ) {
59
64
plMonaco = new PlMonaco ( container , code , `http://www.test.com/main.pi` ) ;
60
65
created = true ;
@@ -229,7 +234,7 @@ function initializeMonaco() {
229
234
provideInlayHints ( model , range , token ) {
230
235
// console.log(JSON.parse(pl.get_inlay_hints()))
231
236
let hints : tp . InlayHint [ ] = JSON . parse ( pl . get_inlay_hints ( ) ) ;
232
- // console.warn (hints);
237
+ console . error ( hints ) ;
233
238
return {
234
239
hints : hints . map ( ( h ) => {
235
240
return {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function gotoEmail() {
13
13
}
14
14
15
15
onMounted (async () => {
16
- monaco = await createMonaco (document .getElementById (' container' )! , basicCode [0 ].code );
16
+ monaco = createMonaco (document .getElementById (' container' )! , basicCode [0 ].code );
17
17
});
18
18
watch (
19
19
() => tabVal .value ,
You can’t perform that action at this time.
0 commit comments