securityos/node_modules/monaco-editor/esm/vs/language/css/monaco.contribution.js

140 lines
4.5 KiB
JavaScript

import '../../editor/editor.api.js';
/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.36.1(6c56744c3419458f0dd48864520b759d1a3a1ca8)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
// src/fillers/monaco-editor-core.ts
var monaco_editor_core_exports = {};
__reExport(monaco_editor_core_exports, monaco_editor_core_star);
import * as monaco_editor_core_star from "../../editor/editor.api.js";
// src/language/css/monaco.contribution.ts
var LanguageServiceDefaultsImpl = class {
_onDidChange = new monaco_editor_core_exports.Emitter();
_options;
_modeConfiguration;
_languageId;
constructor(languageId, options, modeConfiguration) {
this._languageId = languageId;
this.setOptions(options);
this.setModeConfiguration(modeConfiguration);
}
get onDidChange() {
return this._onDidChange.event;
}
get languageId() {
return this._languageId;
}
get modeConfiguration() {
return this._modeConfiguration;
}
get diagnosticsOptions() {
return this.options;
}
get options() {
return this._options;
}
setOptions(options) {
this._options = options || /* @__PURE__ */ Object.create(null);
this._onDidChange.fire(this);
}
setDiagnosticsOptions(options) {
this.setOptions(options);
}
setModeConfiguration(modeConfiguration) {
this._modeConfiguration = modeConfiguration || /* @__PURE__ */ Object.create(null);
this._onDidChange.fire(this);
}
};
var optionsDefault = {
validate: true,
lint: {
compatibleVendorPrefixes: "ignore",
vendorPrefix: "warning",
duplicateProperties: "warning",
emptyRules: "warning",
importStatement: "ignore",
boxModel: "ignore",
universalSelector: "ignore",
zeroUnits: "ignore",
fontFaceProperties: "warning",
hexColorLength: "error",
argumentsInColorFunction: "error",
unknownProperties: "warning",
ieHack: "ignore",
unknownVendorSpecificProperties: "ignore",
propertyIgnoredDueToDisplay: "warning",
important: "ignore",
float: "ignore",
idSelector: "ignore"
},
data: { useDefaultDataProvider: true },
format: {
newlineBetweenSelectors: true,
newlineBetweenRules: true,
spaceAroundSelectorSeparator: false,
braceStyle: "collapse",
maxPreserveNewLines: void 0,
preserveNewLines: true
}
};
var modeConfigurationDefault = {
completionItems: true,
hovers: true,
documentSymbols: true,
definitions: true,
references: true,
documentHighlights: true,
rename: true,
colors: true,
foldingRanges: true,
diagnostics: true,
selectionRanges: true,
documentFormattingEdits: true,
documentRangeFormattingEdits: true
};
var cssDefaults = new LanguageServiceDefaultsImpl("css", optionsDefault, modeConfigurationDefault);
var scssDefaults = new LanguageServiceDefaultsImpl("scss", optionsDefault, modeConfigurationDefault);
var lessDefaults = new LanguageServiceDefaultsImpl("less", optionsDefault, modeConfigurationDefault);
monaco_editor_core_exports.languages.css = { cssDefaults, lessDefaults, scssDefaults };
function getMode() {
if (false) {
return new Promise((resolve, reject) => {
__require(["vs/language/css/cssMode"], resolve, reject);
});
} else {
return import("./cssMode.js");
}
}
monaco_editor_core_exports.languages.onLanguage("less", () => {
getMode().then((mode) => mode.setupMode(lessDefaults));
});
monaco_editor_core_exports.languages.onLanguage("scss", () => {
getMode().then((mode) => mode.setupMode(scssDefaults));
});
monaco_editor_core_exports.languages.onLanguage("css", () => {
getMode().then((mode) => mode.setupMode(cssDefaults));
});
export {
cssDefaults,
lessDefaults,
scssDefaults
};