slint/docs/archive/editor/language-facets.js
Nigel Breslaw 08d90a5f13
Next gen docs for 1.9 (#6766)
Co-authored-by: Aurindam Jana <aurindam.jana@slint.dev>
Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-11-14 15:52:35 +01:00

11 lines
358 B
JavaScript

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import { Facet } from "@codemirror/state";
// Define a custom facet to hold the language name
export const languageNameFacet = Facet.define({
combine(languages) {
return languages.length ? languages[0] : null; // Combine to get the first language if set
},
});