shareable-twoslash-comments 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ define(function () { 'use strict';
58
58
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
59
59
  };
60
60
 
61
- var twoSlashQueryRegex = /(^\s*)(\/\/\s*\^\?)/gm;
61
+ var twoSlashQueryRegex = /(^[ \t]*)(\/\/\s*\^\?)/gm;
62
62
  var fillTwoSlashQueries = function (sandbox) { return __awaiter(void 0, void 0, void 0, function () {
63
63
  var multilineEnabled, model, worker, text, editOperations, _i, _a, match, commentPrefix, caretOffset, caretPos, quickInfoPos, quickInfoOffset, quickInfo, quickInfoString, quickInfoComment, prevQuickInfoComment, prevQuickInfoLines, prevQuickInfoEndLine;
64
64
  return __generator(this, function (_b) {
@@ -89,7 +89,7 @@ define(function () { 'use strict';
89
89
  }
90
90
  quickInfoString = quickInfo.displayParts.map(function (d) { return d.text; }).join("");
91
91
  quickInfoComment = "".concat(match[0], " ").concat(multilineEnabled
92
- ? quickInfoString.replace(new RegExp(model.getEOL(), "g"), "".concat(model.getEOL()).concat(commentPrefix))
92
+ ? quickInfoString.replace(/\r?\n/g, model.getEOL() + commentPrefix)
93
93
  : quickInfoString.replace(/\r?\n\s*/g, " "));
94
94
  prevQuickInfoComment = getPreviousQuickInfoComment({
95
95
  model: model,
@@ -126,7 +126,7 @@ define(function () { 'use strict';
126
126
  }
127
127
  prevQuickInfoLines.push(lineContent);
128
128
  }
129
- return prevQuickInfoLines.join("\n");
129
+ return prevQuickInfoLines.join(model.getEOL());
130
130
  };
131
131
  //# sourceMappingURL=utils.js.map
132
132
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareable-twoslash-comments",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "main": "dist/index.js",
5
5
  "description": "A TypeScript Playground plugin that embeds twoslash (// ^?) type hints as literal comments in your code, making them easy to copy and share.",
6
6
  "license": "MIT",