@mrclrchtr/supi-lsp 11.3.0 → 12.0.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/README.md +22 -17
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +3 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/declaration-level.ts +34 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +64 -28
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/semver/classes/range.js +2 -2
- package/node_modules/semver/internal/constants.js +30 -0
- package/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
- package/node_modules/semver/package.json +1 -1
- package/package.json +3 -3
- package/src/api.ts +2 -2
- package/src/client/client-diagnostic-capabilities.ts +13 -3
- package/src/client/client-diagnostics.ts +25 -9
- package/src/client/client-document-sync.ts +7 -5
- package/src/client/client-edit-capture.ts +258 -0
- package/src/client/client.ts +64 -11
- package/src/config/capabilities.ts +8 -0
- package/src/config/operation-support.ts +48 -79
- package/src/config/tsconfig-scope.ts +10 -0
- package/src/manager/manager-typescript-coverage.ts +118 -0
- package/src/manager/manager.ts +67 -3
- package/src/manager/typescript-file-local.ts +87 -0
- package/src/provider/lsp-refactor-provider.ts +21 -35
- package/src/provider/refactor-command-capture.ts +139 -0
- package/src/provider/refactor-planning.ts +202 -47
- package/src/provider/semantic-symbol-mapper.ts +22 -17
- package/src/session/route-boundary.ts +26 -0
- package/src/session/runtime-registry.ts +106 -16
- package/src/session/runtime-rename.ts +3 -0
- package/src/session/workspace-lsp-runtime.ts +22 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CodeQueryResult, CodeRequestControl } from "@mrclrchtr/supi-code-runtime/api";
|
|
2
|
+
import type { CommandEditCaptureResult } from "../client/client-edit-capture.ts";
|
|
2
3
|
import type {
|
|
3
4
|
CodeAction,
|
|
4
5
|
CodeActionContext,
|
|
@@ -80,6 +81,14 @@ export interface RoutedMutationResponse<T> {
|
|
|
80
81
|
readonly reason?: string;
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
/** One code-action response with the routed server's negotiated kinds. */
|
|
85
|
+
export interface RoutedCodeActionResponse extends RoutedMutationResponse<CodeAction[] | null> {
|
|
86
|
+
/** Negotiated `codeActionProvider.codeActionKinds`; undefined when the server did not narrow them. */
|
|
87
|
+
readonly advertisedKinds?: readonly string[];
|
|
88
|
+
/** Negotiated `executeCommandProvider.commands`; undefined when the server lists none. */
|
|
89
|
+
readonly advertisedCommands?: readonly string[];
|
|
90
|
+
}
|
|
91
|
+
|
|
83
92
|
/** Extra protocol context for one explicit code-action request. */
|
|
84
93
|
export interface WorkspaceCodeActionRequestOptions {
|
|
85
94
|
/** Operation-specific CodeActionKind filters. */
|
|
@@ -164,7 +173,19 @@ export interface WorkspaceLspRuntime extends WorkspaceLspDiagnosticSurface {
|
|
|
164
173
|
positionOrRange: Position | Range,
|
|
165
174
|
control?: CodeRequestControl,
|
|
166
175
|
options?: WorkspaceCodeActionRequestOptions,
|
|
167
|
-
): Promise<
|
|
176
|
+
): Promise<RoutedCodeActionResponse | null>;
|
|
177
|
+
/**
|
|
178
|
+
* Run the command of one command-only code action on the client routed to
|
|
179
|
+
* `filePath` and capture the single edit the server pushes. No pushed edit is
|
|
180
|
+
* applied. The runtime enforces eligibility itself: a `refactor*`,
|
|
181
|
+
* `source.organizeImports*`, or `source.fixAll*` kind, and a command the
|
|
182
|
+
* server lists when it lists any; other actions are unavailable unrun.
|
|
183
|
+
*/
|
|
184
|
+
captureCodeActionEdit(
|
|
185
|
+
filePath: string,
|
|
186
|
+
action: CodeAction,
|
|
187
|
+
control?: CodeRequestControl,
|
|
188
|
+
): Promise<RoutedMutationResponse<CommandEditCaptureResult | null> | null>;
|
|
168
189
|
getOpenDocumentVersion(filePath: string): number | null;
|
|
169
190
|
/**
|
|
170
191
|
* Wait for file readiness; an explicit refresh may make one shared route
|