This commit is contained in:
Rizky 2023-11-25 01:17:55 +07:00
parent 6cb7d5d8b7
commit e23c11d198
2 changed files with 21 additions and 13 deletions

View File

@ -159,10 +159,15 @@ export const ScriptMonaco = () => {
openCodeEditor(source, r, selectionOrPosition) {
const cpath = r.path.substring(`scope~`.length).split("__");
const comp_id = cpath[0];
if (cpath[1]) {
const path = cpath[1].split("~");
const type = path[0] as "prop" | "passprop" | "local";
const id = path[path.length - 1].replace(".d.ts", "");
if (type === "prop") {
return false;
}
if (comp_id) {
let meta = p.page.meta[id];
if (active.comp_id) {
@ -177,6 +182,7 @@ export const ScriptMonaco = () => {
active.item_id = id;
}
p.render();
}
return false;
},

View File

@ -18,6 +18,8 @@ export const declareScope = async (
if (!s) return;
s.p.push(active_id);
monaco.editor.getModels().forEach((model) => {
if (model.uri.toString().startsWith("ts:scope~")) {
model.dispose();