shareable-twoslash-comments 0.0.15 → 0.0.16
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/dist/index.js +7 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -215,12 +215,13 @@ define(function () { 'use strict';
|
|
|
215
215
|
return [4 /*yield*/, getLeftMostQuickInfo({ line: quickInfoLine, column: column })];
|
|
216
216
|
case 5:
|
|
217
217
|
quickInfoString = _b.sent();
|
|
218
|
-
|
|
218
|
+
quickInfoString = multilineEnabled
|
|
219
219
|
? quickInfoString.replace(/\r?\n/g, model.getEOL() + commentPrefix)
|
|
220
|
-
: quickInfoString.replace(/\r?\n\s*/g, " ")
|
|
221
|
-
if (!truncationDisabled && !
|
|
222
|
-
|
|
220
|
+
: quickInfoString.replace(/\r?\n\s*/g, " ");
|
|
221
|
+
if (!truncationDisabled && !quickInfoString.includes("\n")) {
|
|
222
|
+
quickInfoString = truncate(quickInfoString, 100);
|
|
223
223
|
}
|
|
224
|
+
quickInfoComment = match[0] + (quickInfoString.length > 0 ? " " : "") + quickInfoString;
|
|
224
225
|
prevQuickInfoComment = getPreviousQuickInfoComment({ lineNumber: lineNumber });
|
|
225
226
|
prevQuickInfoLines = prevQuickInfoComment.split("\n").length;
|
|
226
227
|
prevQuickInfoEndLine = lineNumber + prevQuickInfoLines - 1;
|
|
@@ -282,6 +283,7 @@ define(function () { 'use strict';
|
|
|
282
283
|
function truncate(str, maxLength) {
|
|
283
284
|
return str.length > maxLength ? str.slice(0, maxLength) + "…" : str;
|
|
284
285
|
}
|
|
286
|
+
//# sourceMappingURL=utils.js.map
|
|
285
287
|
|
|
286
288
|
var debouncedFillTwoSlashQueries = debounce(fillTwoSlashQueries, 500);
|
|
287
289
|
var makePlugin = function (utils) {
|
|
@@ -406,6 +408,7 @@ define(function () { 'use strict';
|
|
|
406
408
|
};
|
|
407
409
|
return customPlugin;
|
|
408
410
|
};
|
|
411
|
+
//# sourceMappingURL=index.js.map
|
|
409
412
|
|
|
410
413
|
return makePlugin;
|
|
411
414
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shareable-twoslash-comments",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
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",
|