shareable-twoslash-comments 0.0.5 → 0.0.7
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/README.md +1 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A TypeScript Playground plugin that embeds twoslash (// ^?) type hints as literal comments in your code, making them easy to copy and share.
|
|
4
4
|
|
|
5
|
-
https://github.com/user-attachments/assets/
|
|
5
|
+
https://github.com/user-attachments/assets/78243c42-a868-4ece-9815-e869a20e30b6
|
|
6
6
|
|
|
7
7
|
## Running this plugin
|
|
8
8
|
|
package/dist/index.js
CHANGED
|
@@ -96,7 +96,7 @@ define(function () { 'use strict';
|
|
|
96
96
|
case 4:
|
|
97
97
|
quickInfo = _d.sent();
|
|
98
98
|
quickInfoString = (_c = (_b = quickInfo === null || quickInfo === void 0 ? void 0 : quickInfo.displayParts) === null || _b === void 0 ? void 0 : _b.map(function (d) { return d.text; }).join("")) !== null && _c !== void 0 ? _c : "";
|
|
99
|
-
quickInfoComment = "".concat(match[0]
|
|
99
|
+
quickInfoComment = "".concat(match[0]).concat(quickInfoString.length > 0 ? " " : "").concat(multilineEnabled
|
|
100
100
|
? quickInfoString.replace(/\r?\n/g, model.getEOL() + commentPrefix)
|
|
101
101
|
: truncate(quickInfoString.replace(/\r?\n\s*/g, " "), truncationDisabled ? Number.POSITIVE_INFINITY : 100));
|
|
102
102
|
prevQuickInfoComment = getPreviousQuickInfoComment({
|
|
@@ -164,6 +164,7 @@ define(function () { 'use strict';
|
|
|
164
164
|
id: "shareable-twoslash-comments",
|
|
165
165
|
displayName: "Shareable Twoslash Comments",
|
|
166
166
|
data: { firstMount: true },
|
|
167
|
+
shouldBeSelected: function () { return true; },
|
|
167
168
|
didMount: function (sandbox, container) {
|
|
168
169
|
// Create a design system object to handle
|
|
169
170
|
// making DOM elements which fit the playground (and handle mobile/light/dark etc)
|
|
@@ -187,6 +188,7 @@ define(function () { 'use strict';
|
|
|
187
188
|
});
|
|
188
189
|
var model = sandbox.getModel();
|
|
189
190
|
if (customPlugin.data.firstMount) {
|
|
191
|
+
debouncedFillTwoSlashQueries(sandbox);
|
|
190
192
|
model.onDidChangeContent(function () {
|
|
191
193
|
debouncedFillTwoSlashQueries(sandbox);
|
|
192
194
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shareable-twoslash-comments",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
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",
|