setMode(mode) {
		if (this.type !== "editor") return;
		const modelist = ace.require("ace/ext/modelist");
		const event = createFileEvent(this);
		this.#emit("changemode", event);
		if (event.defaultPrevented) return;

		if (!mode) {
			const ext = Path.extname(this.filename);
			const modes = helpers.parseJSON(localStorage.modeassoc);
			if (modes?.[ext]) {
				mode = modes[ext];
			} else {
				mode = modelist.getModeForPath(this.filename).mode;
			}
		}

		// sets ace editor EditSession mode
		this.session.setMode(mode);

		// sets file icon
		this.#tab.lead(
			<span className={this.icon} style={{ paddingRight: "5px" }}></span>,
		);
	}
Sets syntax highlighting of the file.
@param {string} [mode]