coc-goose 0.0.0-stage → 0.1.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/LICENCE +21 -0
- package/README.md +27 -2
- package/lib/index.js +67 -0
- package/package.json +67 -4
package/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Konrad Wasowicz <exaroth@gmail.com>
|
|
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
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
## CoC Goose
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img align="center" width="900" src="https://github.com/user-attachments/assets/1a52cee2-cec9-4481-b828-faceee198c78" alt=""><br/>
|
|
4
|
+
|
|
5
|
+
[Goose Programming Language](https://github.com/aardappel/goose) LSP integration for [CoC.nvim](https://github.com/neoclide/coc.nvim).
|
|
6
|
+
|
|
7
|
+
> [!IMPORTANT]
|
|
8
|
+
> Vim/NeoVim does not yet offer proper filetype detection for Goose language by default, in order for the extension to work properly either:
|
|
9
|
+
> 1. Install [goose-lang.vim](https://github.com/exaroth/goose-lang.vim)
|
|
10
|
+
> 2. Add `au BufRead,BufNewFile *.goose setfiletype goose` line to your `.vimrc` on `init.vim`
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Installation
|
|
14
|
+
|
|
15
|
+
Add following to your `coc-settings.json`
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
"goose.enabled": true,
|
|
19
|
+
"goose.path": "<path_to_goose_compiler>",
|
|
20
|
+
"goose.stdlib": "<path_to_goose_stdlib_dir>"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Run `:CocInstall coc-goose`
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Licence
|
|
27
|
+
|
|
28
|
+
See LICENSE file for details.
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
activate: () => activate
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
|
+
var import_coc = require("coc.nvim");
|
|
26
|
+
async function activate(context) {
|
|
27
|
+
const config = import_coc.workspace.getConfiguration("goose");
|
|
28
|
+
if (!config.get("enabled", true)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const command = config.get("path", "goose");
|
|
32
|
+
let optargs = ["lsp"];
|
|
33
|
+
let stdlib = config.get("stdlib", null);
|
|
34
|
+
if (stdlib != null) {
|
|
35
|
+
optargs.push("--stdlib", stdlib);
|
|
36
|
+
}
|
|
37
|
+
const opts = {
|
|
38
|
+
command,
|
|
39
|
+
args: ["lsp", "--stdlib", ""]
|
|
40
|
+
};
|
|
41
|
+
const clientOpts = {
|
|
42
|
+
documentSelector: [{ scheme: "file", language: "goose" }],
|
|
43
|
+
outputChannel: import_coc.window.createOutputChannel("Goose Language Server")
|
|
44
|
+
};
|
|
45
|
+
const client = new import_coc.LanguageClient(
|
|
46
|
+
"gooseLsp",
|
|
47
|
+
"goose-language-server",
|
|
48
|
+
opts,
|
|
49
|
+
clientOpts
|
|
50
|
+
);
|
|
51
|
+
context.subscriptions.push(import_coc.services.registLanguageClient(client));
|
|
52
|
+
import_coc.commands.registerCommand("start", () => {
|
|
53
|
+
client.start();
|
|
54
|
+
});
|
|
55
|
+
import_coc.commands.registerCommand("stop", () => {
|
|
56
|
+
void client.stop();
|
|
57
|
+
});
|
|
58
|
+
import_coc.commands.registerCommand("restart", () => {
|
|
59
|
+
void client.stop().then(() => {
|
|
60
|
+
client.start();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
activate
|
|
67
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coc-goose",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Goose LSP integration for CoC",
|
|
5
|
+
"author": "Konrad Wasowicz <exaroth@gmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"coc": "^0.0.80"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/exaroth/coc-goose.git"
|
|
17
|
+
},
|
|
18
|
+
"activationEvents": [
|
|
19
|
+
"onLanguage:goose"
|
|
20
|
+
],
|
|
21
|
+
"contributes": {
|
|
22
|
+
"commands": [
|
|
23
|
+
{
|
|
24
|
+
"command": "goose.restart",
|
|
25
|
+
"title": "Restart LSP server"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"configuration": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"title": "coc-goose configuration",
|
|
31
|
+
"properties": {
|
|
32
|
+
"goose.enable": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": true,
|
|
35
|
+
"description": "Enable Goose extension"
|
|
36
|
+
},
|
|
37
|
+
"goose.path": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"default": "goose",
|
|
40
|
+
"description": "Path to goose compiler"
|
|
41
|
+
},
|
|
42
|
+
"goose.stdlib": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"default": null,
|
|
45
|
+
"description": "Path to goose standard library"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"coc.nvim",
|
|
52
|
+
"languageserver",
|
|
53
|
+
"goose",
|
|
54
|
+
"vim",
|
|
55
|
+
"neovim"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "node esbuild.mjs",
|
|
59
|
+
"prepare": "npm run build",
|
|
60
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "^22.20.5",
|
|
64
|
+
"coc-test": "^0.2.2",
|
|
65
|
+
"coc.nvim": "^0.0.83-next.27",
|
|
66
|
+
"esbuild": "^0.28.2",
|
|
67
|
+
"typescript": "^6.0.3"
|
|
68
|
+
}
|
|
69
|
+
}
|