"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const severity = require("../../../base/common/severity.js");
const nls = require("../../../nls.js");
const instantiation = require("../../instantiation/common/instantiation.js");
exports.MarkerSeverity = void 0;
(function(MarkerSeverity) {
  MarkerSeverity[MarkerSeverity["Hint"] = 1] = "Hint";
  MarkerSeverity[MarkerSeverity["Info"] = 2] = "Info";
  MarkerSeverity[MarkerSeverity["Warning"] = 4] = "Warning";
  MarkerSeverity[MarkerSeverity["Error"] = 8] = "Error";
})(exports.MarkerSeverity || (exports.MarkerSeverity = {}));
(function(MarkerSeverity) {
  function compare(a, b) {
    return b - a;
  }
  MarkerSeverity.compare = compare;
  const _displayStrings = /* @__PURE__ */ Object.create(null);
  _displayStrings[MarkerSeverity.Error] = nls.localize("sev.error", "Error");
  _displayStrings[MarkerSeverity.Warning] = nls.localize("sev.warning", "Warning");
  _displayStrings[MarkerSeverity.Info] = nls.localize("sev.info", "Info");
  function toString(a) {
    return _displayStrings[a] || "";
  }
  MarkerSeverity.toString = toString;
  function fromSeverity(severity$1) {
    switch (severity$1) {
      case severity.default.Error:
        return MarkerSeverity.Error;
      case severity.default.Warning:
        return MarkerSeverity.Warning;
      case severity.default.Info:
        return MarkerSeverity.Info;
      case severity.default.Ignore:
        return MarkerSeverity.Hint;
    }
  }
  MarkerSeverity.fromSeverity = fromSeverity;
  function toSeverity(severity$1) {
    switch (severity$1) {
      case MarkerSeverity.Error:
        return severity.default.Error;
      case MarkerSeverity.Warning:
        return severity.default.Warning;
      case MarkerSeverity.Info:
        return severity.default.Info;
      case MarkerSeverity.Hint:
        return severity.default.Ignore;
    }
  }
  MarkerSeverity.toSeverity = toSeverity;
})(exports.MarkerSeverity || (exports.MarkerSeverity = {}));
exports.IMarkerData = void 0;
(function(IMarkerData) {
  const emptyString = "";
  function makeKey(markerData) {
    return makeKeyOptionalMessage(markerData, true);
  }
  IMarkerData.makeKey = makeKey;
  function makeKeyOptionalMessage(markerData, useMessage) {
    let result = [emptyString];
    if (markerData.source) {
      result.push(markerData.source.replace("¦", "\\¦"));
    } else {
      result.push(emptyString);
    }
    if (markerData.code) {
      if (typeof markerData.code === "string") {
        result.push(markerData.code.replace("¦", "\\¦"));
      } else {
        result.push(markerData.code.value.replace("¦", "\\¦"));
      }
    } else {
      result.push(emptyString);
    }
    if (markerData.severity !== void 0 && markerData.severity !== null) {
      result.push(exports.MarkerSeverity.toString(markerData.severity));
    } else {
      result.push(emptyString);
    }
    if (markerData.message && useMessage) {
      result.push(markerData.message.replace("¦", "\\¦"));
    } else {
      result.push(emptyString);
    }
    if (markerData.startLineNumber !== void 0 && markerData.startLineNumber !== null) {
      result.push(markerData.startLineNumber.toString());
    } else {
      result.push(emptyString);
    }
    if (markerData.startColumn !== void 0 && markerData.startColumn !== null) {
      result.push(markerData.startColumn.toString());
    } else {
      result.push(emptyString);
    }
    if (markerData.endLineNumber !== void 0 && markerData.endLineNumber !== null) {
      result.push(markerData.endLineNumber.toString());
    } else {
      result.push(emptyString);
    }
    if (markerData.endColumn !== void 0 && markerData.endColumn !== null) {
      result.push(markerData.endColumn.toString());
    } else {
      result.push(emptyString);
    }
    result.push(emptyString);
    return result.join("¦");
  }
  IMarkerData.makeKeyOptionalMessage = makeKeyOptionalMessage;
})(exports.IMarkerData || (exports.IMarkerData = {}));
const IMarkerService = instantiation.createDecorator("markerService");
exports.IMarkerService = IMarkerService;
