@aihu/language-server 0.1.0 → 0.2.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/dist/server.d.ts CHANGED
@@ -1,22 +1,73 @@
1
- import { Connection } from "vscode-languageserver/node.js";
1
+ import { R as URI, _ as LanguageServerProject, b as SnapshotDocument, g as LanguageServerEnvironment, m as ExperimentalFeatures, t as index_d_exports } from "./index-ROvxbbgq.js";
2
+ import * as _$_volar_language_service0 from "@volar/language-service";
2
3
 
3
4
  //#region src/server.d.ts
4
5
  /**
5
- * Build and wire the LSP server onto a connection, returning it without calling
6
- * `.listen()`. Exposed so tests / alternative transports can drive the server.
7
- * The default `createConnection(ProposedFeatures.all)` reads stdio.
6
+ * Create and wire the test seam for integration / unit tests.
7
+ * Renamed from `createServer` to avoid collision with Volar's own `createServer`
8
+ * export from `@volar/language-server/node`.
9
+ *
10
+ * Returns the Volar server object (not a vscode-languageserver Connection) so
11
+ * tests can inspect initialized state or call .initialize() directly if needed.
8
12
  */
9
- declare function createServer(connection?: Connection): Connection;
13
+ declare function createTestServer(): {
14
+ initializeParams: _$_volar_language_service0.InitializeParams;
15
+ project: LanguageServerProject;
16
+ languageServicePlugins: _$_volar_language_service0.LanguageServicePlugin<any>[];
17
+ initialize(params: _$_volar_language_service0.InitializeParams, project: LanguageServerProject, languageServicePlugins: _$_volar_language_service0.LanguageServicePlugin[]): _$_volar_language_service0.InitializeResult<ExperimentalFeatures>;
18
+ initialized(): void;
19
+ shutdown(): void;
20
+ configurations: {
21
+ get: <T>(section: string, scopeUri?: string) => Promise<T | undefined>;
22
+ onDidChange: (cb: _$_volar_language_service0.NotificationHandler<_$_volar_language_service0.DidChangeConfigurationParams>) => {
23
+ dispose(): void;
24
+ };
25
+ };
26
+ editorFeatures: void;
27
+ documents: {
28
+ all: () => SnapshotDocument[];
29
+ onDidChangeContent: _$_volar_language_service0.Event<index_d_exports.TextDocumentChangeEvent<SnapshotDocument>>;
30
+ onDidOpen: _$_volar_language_service0.Event<index_d_exports.TextDocumentChangeEvent<SnapshotDocument>>;
31
+ onDidClose: _$_volar_language_service0.Event<index_d_exports.TextDocumentChangeEvent<SnapshotDocument>>;
32
+ onDidSave: _$_volar_language_service0.Event<index_d_exports.TextDocumentChangeEvent<SnapshotDocument>>;
33
+ get(uri: URI): SnapshotDocument | undefined;
34
+ };
35
+ workspaceFolders: {
36
+ readonly all: URI[];
37
+ has(uri: URI): boolean;
38
+ onDidChange: (cb: _$_volar_language_service0.NotificationHandler<_$_volar_language_service0.WorkspaceFoldersChangeEvent>) => {
39
+ dispose(): void;
40
+ };
41
+ };
42
+ fileWatcher: {
43
+ watchFiles: (patterns: string[]) => Promise<_$_volar_language_service0.Disposable>;
44
+ onDidChangeWatchedFiles: (cb: _$_volar_language_service0.NotificationHandler<_$_volar_language_service0.DidChangeWatchedFilesParams>) => {
45
+ dispose: () => void;
46
+ };
47
+ };
48
+ languageFeatures: {
49
+ requestRefresh: (clearDiagnostics: boolean) => Promise<void>;
50
+ };
51
+ fileSystem: {
52
+ readFile(uri: URI): string | Thenable<string | undefined>;
53
+ stat(uri: URI): _$_volar_language_service0.FileStat | Thenable<_$_volar_language_service0.FileStat | undefined>;
54
+ readDirectory(uri: URI): _$_volar_language_service0.ProviderResult<[string, _$_volar_language_service0.FileType][]>;
55
+ install(scheme: string, provider: _$_volar_language_service0.FileSystem): void;
56
+ };
57
+ env: LanguageServerEnvironment;
58
+ connection: index_d_exports.Connection;
59
+ onInitialize(callback: (serverCapabilities: _$_volar_language_service0.ServerCapabilities<ExperimentalFeatures>) => void): void;
60
+ onInitialized(callback: () => void): void;
61
+ };
10
62
  /**
11
63
  * Start the language server on stdio and begin listening. This is the entry
12
64
  * point the `aihu-language-server` bin calls.
13
65
  *
14
66
  * Bind the connection to `process.stdin`/`process.stdout` explicitly so the
15
67
  * binary works when launched directly (e.g. `{ command: "aihu-language-server" }`
16
- * in Neovim/Helix). vscode-languageserver's bare `createConnection` otherwise
17
- * requires a `--stdio` / `--node-ipc` CLI flag and throws without one.
68
+ * in Neovim/Helix).
18
69
  */
19
- declare function startServer(): Connection;
70
+ declare function startServer(): void;
20
71
  //#endregion
21
- export { createServer, startServer };
72
+ export { createTestServer, startServer };
22
73
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;;;iBAyDgB,YAAA,CACd,UAAA,GAAY,UAAA,GACX,UAAA;;;;;;;;;;iBAwMa,WAAA,CAAA,GAAe,UAAA"}
1
+ {"version":3,"file":"server.d.ts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;;;AAmCA;;;;iBAAgB,gBAAA,CAAA;oBAAgB,0BAAA,CAAA,gBAAA;;;;;;;oDAR7B,OAAA,CAAA,CAAA;qEAAA,0BAAA,CAAA,4BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBa,WAAA,CAAA"}