Skip to content

Commit

Permalink
整理代码
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Dec 30, 2024
1 parent 5f524f0 commit 4218f61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/editorTable/editorTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { queue, throttle } from "../utility/decorators";
import { EditorData, valueOnGet, valueOnSet } from "./editorData";
import { define } from "../customDefine";
export { EditorData } from "./editorData";
import { EditorJson } from "./editorJson";
import { Y3Json } from "../tools/y3json";

const templateDir = 'template\\json_template';
const metaDir = 'src\\helper_meta\\editor';
Expand Down Expand Up @@ -94,7 +94,7 @@ export async function ready() {
}

export class EditorObject<N extends Table.NameCN = Table.NameCN> {
private _json?: EditorJson;
private _json?: Y3Json;
private _name?: string;
private _text?: string;
public uri?: vscode.Uri;
Expand All @@ -107,12 +107,12 @@ export class EditorObject<N extends Table.NameCN = Table.NameCN> {
/**
* 获取对象的json数据语法树
*/
public get json(): EditorJson | undefined {
public get json(): Y3Json | undefined {
if (this._json === undefined) {
if (!this._text) {
return undefined;
}
this._json = new EditorJson(this._text);
this._json = new Y3Json(this._text);
this._text = undefined;
}
return this._json;
Expand Down
1 change: 1 addition & 0 deletions src/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './download';
export * from './log';
export * as fs from './fs';
export * as json from './json';
export * as y3json from './y3json';
export * as lua from './lua';
export * as tracy from './tracy';
export * as version from './version';
Expand Down
2 changes: 1 addition & 1 deletion src/editorTable/editorJson.ts → src/tools/y3json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as jsonc from 'jsonc-parser';
/**
* 编辑器使用的 JSON 格式,读写时会遵循编辑器的格式规范
*/
export class EditorJson {
export class Y3Json {
private _text: string;
private _tree?: jsonc.Node;
private _data?: Record<string, any>;
Expand Down

0 comments on commit 4218f61

Please sign in to comment.