@wrongstack/plug-lsp 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ECOSTACK TECHNOLOGY OÜ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # @wrongstack/plug-lsp
2
+
3
+ Language Server Protocol tools for WrongStack.
4
+
5
+ This package is implemented as a WrongStack monorepo plugin and reads its
6
+ configuration from `extensions["@wrongstack/plug-lsp"]`.
7
+
8
+ ```json
9
+ {
10
+ "features": { "plugins": true },
11
+ "plugins": ["@wrongstack/plug-lsp"],
12
+ "extensions": {
13
+ "@wrongstack/plug-lsp": {
14
+ "autoStart": "lazy",
15
+ "servers": {
16
+ "typescript": {
17
+ "command": "typescript-language-server",
18
+ "args": ["--stdio"],
19
+ "languages": ["typescript", "typescriptreact", "javascript", "javascriptreact"],
20
+ "rootPatterns": ["tsconfig.json", "jsconfig.json", "package.json"]
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ Registered tools:
29
+
30
+ - `lsp_diagnostics`
31
+ - `lsp_definition`
32
+ - `lsp_references`
33
+ - `lsp_hover`
34
+ - `lsp_symbols`
35
+ - `lsp_rename`
36
+ - `lsp_code_actions`
37
+
38
+ Plugin slash commands are namespaced by the current WrongStack command
39
+ registry, for example `/@wrongstack/plug-lsp:list`.
40
+
41
+ ## Installing language servers
42
+
43
+ The plugin is an LSP client. Language server binaries can be installed into the
44
+ project instead of relying on global PATH state:
45
+
46
+ ```sh
47
+ pnpm --filter @wrongstack/plug-lsp build
48
+ pnpm --filter @wrongstack/plug-lsp setup -- --cwd /path/to/project
49
+ ```
50
+
51
+ After setup, `autoDiscover` checks both PATH and project-local
52
+ `node_modules/.bin`, so the same flow works on Windows, macOS, and Linux.
53
+
54
+ Default setup installs npm-based servers for TypeScript/JavaScript, Python,
55
+ JSON, HTML, CSS, YAML, and shell scripts. Extra toolchain-backed servers can be
56
+ requested explicitly:
57
+
58
+ ```sh
59
+ wrongstack-lsp-setup --languages typescript,python,go,rust,ruby
60
+ ```
@@ -0,0 +1,63 @@
1
+ import { Plugin } from '@wrongstack/core';
2
+
3
+ type AutoStartMode = 'lazy' | 'eager' | 'never';
4
+ type DiagnosticsAfterEdit = 'background' | 'manual';
5
+ type SeverityName = 'error' | 'warning' | 'info' | 'hint';
6
+ interface ServerConfig {
7
+ command: string;
8
+ args?: string[];
9
+ env?: Record<string, string>;
10
+ languages: string[];
11
+ rootPatterns?: string[];
12
+ initializationOptions?: unknown;
13
+ settings?: unknown;
14
+ startupTimeoutMs?: number;
15
+ enabled?: boolean;
16
+ }
17
+ interface PlugLSPConfig {
18
+ servers: Record<string, ServerConfig>;
19
+ autoStart: AutoStartMode;
20
+ diagnosticsAfterEdit: DiagnosticsAfterEdit;
21
+ diagnosticsWaitMs: number;
22
+ severityFilter: SeverityName[];
23
+ maxDiagnosticsPerFile: number;
24
+ maxDiagnosticsTotal: number;
25
+ autoDiscover: boolean;
26
+ logServerOutput: boolean;
27
+ }
28
+ declare module '@wrongstack/core' {
29
+ interface EventMap {
30
+ 'lsp.server.starting': {
31
+ name: string;
32
+ command: string;
33
+ };
34
+ 'lsp.server.ready': {
35
+ name: string;
36
+ languages: string[];
37
+ };
38
+ 'lsp.server.exited': {
39
+ name: string;
40
+ code: number | null;
41
+ signal: string | null;
42
+ };
43
+ 'lsp.server.crashed': {
44
+ name: string;
45
+ error: string;
46
+ };
47
+ 'lsp.diagnostics.updated': {
48
+ path: string;
49
+ count: number;
50
+ };
51
+ 'lsp.document.opened': {
52
+ path: string;
53
+ language: string;
54
+ };
55
+ 'lsp.document.closed': {
56
+ path: string;
57
+ };
58
+ }
59
+ }
60
+
61
+ declare const plugin: Plugin;
62
+
63
+ export { type AutoStartMode, type DiagnosticsAfterEdit, type PlugLSPConfig, type ServerConfig, plugin as default };