@stripe/extensibility-language-server 0.2.8 → 0.3.1
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.cjs +9401 -4
- package/dist/index.js +9388 -2
- package/dist/plugin/declaration-tooltip-experiences.d.ts +27 -0
- package/dist/plugin/declaration-tooltip-experiences.d.ts.map +1 -0
- package/dist/plugin/display-parts.d.ts +32 -0
- package/dist/plugin/display-parts.d.ts.map +1 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/quick-info-composer.d.ts +38 -0
- package/dist/plugin/quick-info-composer.d.ts.map +1 -0
- package/dist/plugin.cjs +9403 -4
- package/dist/plugin.js +9388 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/plugin/index.js +2 -0
- package/plugin/package.json +4 -0
- package/server/index.js +2 -0
- package/server/package.json +4 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declaration-hover experiences layered on top of native TypeScript quick info.
|
|
3
|
+
*
|
|
4
|
+
* Each "experience" turns a single FormSpec fact category into one hover
|
|
5
|
+
* section so the plugin can mix and match them without hard-coding one giant
|
|
6
|
+
* formatter.
|
|
7
|
+
*/
|
|
8
|
+
import type * as tsServer from 'typescript/lib/tsserverlibrary.js';
|
|
9
|
+
import type { FormSpecAnalysisCommentSnapshot } from '@formspec/ts-plugin';
|
|
10
|
+
import type { TooltipSection, TooltipSurface } from './quick-info-composer.js';
|
|
11
|
+
/**
|
|
12
|
+
* The declaration snapshot and native hover that synthesized sections can use.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export interface DeclarationTooltipContext {
|
|
17
|
+
readonly surface: TooltipSurface;
|
|
18
|
+
readonly comment: FormSpecAnalysisCommentSnapshot;
|
|
19
|
+
readonly baseQuickInfo: tsServer.QuickInfo | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Materialize all declaration-hover sections that apply to the current symbol.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function getDeclarationTooltipSections(context: DeclarationTooltipContext): readonly TooltipSection[];
|
|
27
|
+
//# sourceMappingURL=declaration-tooltip-experiences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declaration-tooltip-experiences.d.ts","sourceRoot":"","sources":["../../src/plugin/declaration-tooltip-experiences.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EACV,+BAA+B,EAEhC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/E;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,+BAA+B,CAAC;IAClD,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;CACxD;AA4BD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,yBAAyB,GACjC,SAAS,cAAc,EAAE,CAK3B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for building tsserver display-part arrays.
|
|
3
|
+
*
|
|
4
|
+
* The plugin emits the same `SymbolDisplayPart` shape that native TypeScript
|
|
5
|
+
* hovers use so that editors preserve their standard rendering pipeline.
|
|
6
|
+
*/
|
|
7
|
+
import type * as tsServer from 'typescript/lib/tsserverlibrary.js';
|
|
8
|
+
/**
|
|
9
|
+
* Wrap plain text as a one-part display block.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function toDisplayParts(text: string, kind?: string): tsServer.SymbolDisplayPart[];
|
|
14
|
+
/**
|
|
15
|
+
* Create a single display part with the requested tsserver kind.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function toDisplayPart(text: string, kind?: string): tsServer.SymbolDisplayPart;
|
|
20
|
+
/**
|
|
21
|
+
* Treat empty strings as no content so callers can compose blocks safely.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function hasDisplayPartsContent(parts: readonly tsServer.SymbolDisplayPart[] | undefined): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Join documentation blocks with blank lines while skipping empty sections.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function joinDisplayPartBlocks(blocks: readonly (readonly tsServer.SymbolDisplayPart[] | undefined)[]): tsServer.SymbolDisplayPart[];
|
|
32
|
+
//# sourceMappingURL=display-parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-parts.d.ts","sourceRoot":"","sources":["../../src/plugin/display-parts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAEnE;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,SAAS,GACZ,QAAQ,CAAC,iBAAiB,EAAE,CAE9B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,SAAS,GAAG,QAAQ,CAAC,iBAAiB,CAKrF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,QAAQ,CAAC,iBAAiB,EAAE,GAAG,SAAS,GACvD,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,CAAC,SAAS,QAAQ,CAAC,iBAAiB,EAAE,GAAG,SAAS,CAAC,EAAE,GACrE,QAAQ,CAAC,iBAAiB,EAAE,CAkB9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAo1BnE;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE;IAC5B,QAAQ,CAAC,UAAU,EAAE,OAAO,QAAQ,CAAC;CACtC,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,CAiB/B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hover composition helpers for merging native tsserver quick info with
|
|
3
|
+
* additional FormSpec-authored sections.
|
|
4
|
+
*/
|
|
5
|
+
import type * as tsServer from 'typescript/lib/tsserverlibrary.js';
|
|
6
|
+
/** @internal */
|
|
7
|
+
export type TooltipSurface = 'declaration-hover';
|
|
8
|
+
/**
|
|
9
|
+
* A synthesized documentation block to splice around native hover content.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export interface TooltipSection {
|
|
14
|
+
readonly placement: 'before-docs' | 'after-docs';
|
|
15
|
+
readonly documentation: readonly tsServer.SymbolDisplayPart[];
|
|
16
|
+
readonly suppressTagNames?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Inputs for hover composition.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export interface ComposeQuickInfoOptions {
|
|
24
|
+
readonly typescript: typeof tsServer;
|
|
25
|
+
readonly position: number;
|
|
26
|
+
readonly baseQuickInfo: tsServer.QuickInfo | undefined;
|
|
27
|
+
readonly sections: readonly TooltipSection[];
|
|
28
|
+
readonly fallbackDocumentation?: readonly tsServer.SymbolDisplayPart[];
|
|
29
|
+
readonly fallbackDisplayParts?: readonly tsServer.SymbolDisplayPart[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Preserve native TypeScript quick info when available, and only synthesize a
|
|
33
|
+
* standalone hover when FormSpec has something useful to add on its own.
|
|
34
|
+
*
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare function composeQuickInfo(options: ComposeQuickInfoOptions): tsServer.QuickInfo | undefined;
|
|
38
|
+
//# sourceMappingURL=quick-info-composer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-info-composer.d.ts","sourceRoot":"","sources":["../../src/plugin/quick-info-composer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAOnE,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,aAAa,GAAG,YAAY,CAAC;IACjD,QAAQ,CAAC,aAAa,EAAE,SAAS,QAAQ,CAAC,iBAAiB,EAAE,CAAC;IAC9D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,UAAU,EAAE,OAAO,QAAQ,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IAC7C,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,QAAQ,CAAC,iBAAiB,EAAE,CAAC;IACvE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,QAAQ,CAAC,iBAAiB,EAAE,CAAC;CACvE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,uBAAuB,GAC/B,QAAQ,CAAC,SAAS,GAAG,SAAS,CAwDhC"}
|