stan-language-server 0.3.1 → 0.4.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 CHANGED
@@ -107,10 +107,20 @@ Assuming you are using [stan-ts-mode](https://github.com/WardBrian/stan-ts-mode)
107
107
  and add the following to your `init.el`:
108
108
 
109
109
  ```elisp
110
- ; elgot is built in to emacs 29+, but a similar config would work for lsp-mode
111
- (with-eval-after-load 'eglot
112
- (add-to-list 'eglot-server-programs
113
- '(stan-ts-mode . ("/YOUR/PATH/TO/stan-language-server" "--stdio"))))
110
+ ; elgot is built in to emacs 29+, but some features work better if you use the
111
+ ;; latest version from GNU ELPA
112
+ (require 'package)
113
+ (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
114
+ (package-initialize)
115
+
116
+ (use-package eglot
117
+ :ensure t
118
+ :demand t
119
+ :pin gnu
120
+ :hook (stan-ts-mode . eglot-ensure)
121
+ :config
122
+ (add-to-list 'eglot-server-programs '(stan-ts-mode .
123
+ ("PATH/TO/stan-language-server" "--stdio"))))
114
124
  ```
115
125
 
116
126
 
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ import type { CompletionItem, CompletionList, DocumentDiagnosticReport, Hover, InitializeResult, LSPAny, TextEdit } from "vscode-languageserver-protocol";
2
+ export interface LSPMessage {
3
+ jsonrpc: "2.0";
4
+ id?: number | string;
5
+ method?: string;
6
+ params?: any;
7
+ result?: any;
8
+ error?: {
9
+ code: number;
10
+ message: string;
11
+ data?: any;
12
+ };
13
+ }
14
+ export declare class LSPTestClient {
15
+ private server;
16
+ private messageId;
17
+ private pendingRequests;
18
+ private buffer;
19
+ private currentSettings;
20
+ private workspaceUri;
21
+ private registrationResolve;
22
+ private openDocumentUris;
23
+ serverMessages: LSPMessage[];
24
+ numRefreshRequest: number;
25
+ start(): Promise<void>;
26
+ stop(): Promise<void>;
27
+ private handleServerMessage;
28
+ private handleMessage;
29
+ private handleDiagnosticRefresh;
30
+ private handleConfigurationRequest;
31
+ private handleWorkspaceFoldersRequest;
32
+ private handleRegisterCapability;
33
+ private sendMessage;
34
+ private sendRequest;
35
+ private sendNotification;
36
+ initialize(workspaceUri?: string, dynamicRegistration?: boolean): Promise<InitializeResult>;
37
+ initialized(): Promise<void>;
38
+ waitForRegistration(timeout?: number): Promise<void>;
39
+ shutdown(): Promise<void>;
40
+ exit(): Promise<void>;
41
+ didOpen(uri: string, languageId: string, text: string): Promise<void>;
42
+ didChange(uri: string, text: string, version: number): Promise<void>;
43
+ didClose(uri: string): Promise<void>;
44
+ closeAll(): Promise<void>;
45
+ didChangeConfiguration(settings?: LSPAny): Promise<void>;
46
+ completion(uri: string, line: number, character: number): Promise<CompletionList | CompletionItem[]>;
47
+ formatting(uri: string): Promise<TextEdit[]>;
48
+ hover(uri: string, line: number, character: number): Promise<Hover | null>;
49
+ diagnostics(uri: string): Promise<DocumentDiagnosticReport>;
50
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -759,7 +759,7 @@ var startLanguageServer = (connection, reader) => {
759
759
  await connection.client.register(DidChangeConfigurationNotification.type);
760
760
  connection.console.info("Registered for didChangeConfiguration");
761
761
  }
762
- connection.console.info("Stan language server is initialized!");
762
+ connection.console.info("Stan language server is initialized");
763
763
  });
764
764
  connection.onExit(() => {
765
765
  connection.console.info("Stan language server is exiting...");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stan-language-server",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Language Server Protocol implementation for the Stan probabilistic programming language",
5
5
  "main": "dist/server/index.js",
6
6
  "module": "src/server/index.ts",
@@ -48,6 +48,7 @@
48
48
  "scripts": {
49
49
  "build": "bun build src/server/index.ts --outdir dist/server --packages external --target browser --format esm && tsc --emitDeclarationOnly --outDir dist",
50
50
  "build:binary": "bun build src/server/cli.ts --drop=console --compile --outfile bin/stan-language-server",
51
+ "build:bin-package": "bun run scripts/build-bin-package.ts",
51
52
  "prepublishOnly": "bun run build",
52
53
  "version:set": "bun run scripts/set-version.ts",
53
54
  "publish:npm": "npm publish --access public --provenance",
@@ -60,19 +61,22 @@
60
61
  "typecheck": "tsc --noEmit",
61
62
  "check": "bun run lint && bun run typecheck",
62
63
  "test": "bun test",
64
+ "test:unit": "bun test src/__tests__/handlers src/__tests__/language",
65
+ "test:e2e": "bun run build:binary && bun test src/__tests__/e2e/",
66
+ "test:e2e:ci": "bun test src/__tests__/e2e/",
63
67
  "dev": "bun run src/server/cli.ts"
64
68
  },
65
69
  "devDependencies": {
66
70
  "@types/bun": "latest",
67
- "@types/node": "24.8.1",
68
- "@typescript-eslint/eslint-plugin": "^8.0.0",
69
- "@typescript-eslint/parser": "^8.0.0",
70
- "eslint": "^9.0.0",
71
+ "@types/node": "25.5.0",
72
+ "@typescript-eslint/eslint-plugin": "8.57.1",
73
+ "@typescript-eslint/parser": "8.57.1",
74
+ "eslint": "10.0.3",
71
75
  "typescript": "5.9.3"
72
76
  },
73
77
  "dependencies": {
74
- "stanc3": "^2.37.0",
75
- "trie-search": "2.2.0",
78
+ "stanc3": "2.38.0",
79
+ "trie-search": "2.2.1",
76
80
  "vscode-languageserver": "9.0.1",
77
81
  "vscode-languageserver-textdocument": "1.0.12",
78
82
  "vscode-uri": "3.1.0"