@effect/language-service 0.59.0 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -3526,7 +3526,8 @@ var defaults = {
3526
3526
  }],
3527
3527
  extendedKeyDetection: false,
3528
3528
  pipeableMinArgCount: 1,
3529
- layerGraphFollowDepth: 0
3529
+ layerGraphFollowDepth: 0,
3530
+ mermaidProvider: "mermaid.live"
3530
3531
  };
3531
3532
  function parseKeyPatterns(patterns) {
3532
3533
  const result = [];
@@ -3564,7 +3565,8 @@ function parse(config) {
3564
3565
  keyPatterns: isObject(config) && hasProperty(config, "keyPatterns") && isArray(config.keyPatterns) ? parseKeyPatterns(config.keyPatterns) : defaults.keyPatterns,
3565
3566
  extendedKeyDetection: isObject(config) && hasProperty(config, "extendedKeyDetection") && isBoolean(config.extendedKeyDetection) ? config.extendedKeyDetection : defaults.extendedKeyDetection,
3566
3567
  pipeableMinArgCount: isObject(config) && hasProperty(config, "pipeableMinArgCount") && isNumber(config.pipeableMinArgCount) ? config.pipeableMinArgCount : defaults.pipeableMinArgCount,
3567
- layerGraphFollowDepth: isObject(config) && hasProperty(config, "layerGraphFollowDepth") && isNumber(config.layerGraphFollowDepth) ? config.layerGraphFollowDepth : defaults.layerGraphFollowDepth
3568
+ layerGraphFollowDepth: isObject(config) && hasProperty(config, "layerGraphFollowDepth") && isNumber(config.layerGraphFollowDepth) ? config.layerGraphFollowDepth : defaults.layerGraphFollowDepth,
3569
+ mermaidProvider: isObject(config) && hasProperty(config, "mermaidProvider") && isString(config.mermaidProvider) ? config.mermaidProvider : defaults.mermaidProvider
3568
3570
  };
3569
3571
  }
3570
3572
 
@@ -15311,13 +15313,19 @@ var formatLayerProvidersAndRequirersInfo = fn("formatLayerProvidersAndRequirersI
15311
15313
  );
15312
15314
 
15313
15315
  // src/quickinfo/layerInfo.ts
15314
- function generateMarmaidUri(code) {
15316
+ function generateMarmaidUri(code, mermaidProvider) {
15315
15317
  return gen(function* () {
15316
15318
  const state = JSON.stringify({ code });
15317
15319
  const data = new TextEncoder().encode(state);
15318
15320
  const compressed = deflate_1(data, { level: 9 });
15319
15321
  const pakoString = "pako:" + encodeBase64Url(compressed);
15320
- return "https://www.mermaidchart.com/play#" + pakoString;
15322
+ if (mermaidProvider === "mermaid.com") {
15323
+ return "https://www.mermaidchart.com/play#" + pakoString;
15324
+ } else if (mermaidProvider === "mermaid.live") {
15325
+ return "https://mermaid.live/edit#" + pakoString;
15326
+ } else {
15327
+ return mermaidProvider + "/edit#" + pakoString;
15328
+ }
15321
15329
  });
15322
15330
  }
15323
15331
  function getAdjustedNode(sourceFile, position) {
@@ -15388,8 +15396,8 @@ function layerInfo(sourceFile, position, quickInfo2) {
15388
15396
  ({ nestedGraphMermaid, outlineGraphMermaid, providersAndRequirersTextualExplanation }) => gen(function* () {
15389
15397
  const linkParts = [];
15390
15398
  if (!options.noExternal) {
15391
- const mermaidUri = yield* generateMarmaidUri(nestedGraphMermaid);
15392
- const outlineMermaidUri = yield* generateMarmaidUri(outlineGraphMermaid);
15399
+ const mermaidUri = yield* generateMarmaidUri(nestedGraphMermaid, options.mermaidProvider);
15400
+ const outlineMermaidUri = yield* generateMarmaidUri(outlineGraphMermaid, options.mermaidProvider);
15393
15401
  linkParts.push({ kind: "space", text: "\n" });
15394
15402
  linkParts.push({ kind: "link", text: "{@link " });
15395
15403
  linkParts.push({ kind: "linkText", text: mermaidUri + " Show full Layer graph" });