Skip to content

Commit 7610a93

Browse files
orienjairo-caro-agkidandcatmfelscheiacore
authored
Merge VSCode extension from pony-language-server repo (#2)
Co-authored-by: Jairo <jairo@agentero.com> Co-authored-by: Jairo <kidandcat@gmail.com> Co-authored-by: Matthias Wahl <matthiaswahl@m7w3.de> Co-authored-by: Matthias Wahl <mfelsche@users.noreply.github.com> Co-authored-by: iacore <74560659+iacore@users.noreply.github.com> Co-authored-by: iacore <noreply+gpg-stub@1a-insec.net>
1 parent 5d00b30 commit 7610a93

17 files changed

+6386
-8
lines changed

.github/workflows/pr.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ jobs:
3838
steps:
3939
- name: Checkout source
4040
uses: actions/checkout@v4.1.1
41-
- name: Install npm
42-
run: sudo apt-get install -y --no-install-recommends npm
43-
- name: Install vsce
44-
run: npm install -g @vscode/vsce
41+
- name: Install Node.js
42+
uses: actions/setup-node@v6.2.0
43+
with:
44+
node-version: '22.x'
45+
cache: 'npm'
4546
- name: Build
46-
run: make vscode_extension config=debug
47+
run: make config=debug

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
build/
2+
dist/
3+
node_modules/
4+
out/
5+
6+
.*
7+
!.vscode/
8+
!.github
9+
!.release-notes
10+
!.gitattributes
11+
!.gitignore
12+
!.markdownlintignore
13+
!.vscodeignore
14+
!.vscodeignore
15+
*.vsix

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": ["dbaeumer.vscode-eslint", "connor4312.esbuild-problem-matchers", "ms-vscode.extension-test-runner"]
5+
}

.vscode/launch.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/dist/**/*.js"
17+
],
18+
"preLaunchTask": "${defaultBuildTask}"
19+
}
20+
]
21+
}

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"out": false, // set this to true to hide the "out" folder with the compiled JS files
5+
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
6+
},
7+
"search.exclude": {
8+
"out": true, // set this to false to include "out" folder in search results
9+
"dist": true // set this to false to include "dist" folder in search results
10+
},
11+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
12+
"typescript.tsc.autoDetect": "off"
13+
}

.vscode/tasks.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "watch",
8+
"dependsOn": [
9+
"npm: watch:tsc",
10+
"npm: watch:esbuild"
11+
],
12+
"presentation": {
13+
"reveal": "never"
14+
},
15+
"group": {
16+
"kind": "build",
17+
"isDefault": true
18+
}
19+
},
20+
{
21+
"type": "npm",
22+
"script": "watch:esbuild",
23+
"group": "build",
24+
"problemMatcher": "$esbuild-watch",
25+
"isBackground": true,
26+
"label": "npm: watch:esbuild",
27+
"presentation": {
28+
"group": "watch",
29+
"reveal": "never"
30+
}
31+
},
32+
{
33+
"type": "npm",
34+
"script": "watch:tsc",
35+
"group": "build",
36+
"problemMatcher": "$tsc-watch",
37+
"isBackground": true,
38+
"label": "npm: watch:tsc",
39+
"presentation": {
40+
"group": "watch",
41+
"reveal": "never"
42+
}
43+
},
44+
{
45+
"type": "npm",
46+
"script": "watch-tests",
47+
"problemMatcher": "$tsc-watch",
48+
"isBackground": true,
49+
"presentation": {
50+
"reveal": "never",
51+
"group": "watchers"
52+
},
53+
"group": "build"
54+
},
55+
{
56+
"label": "tasks: watch-tests",
57+
"dependsOn": [
58+
"npm: watch",
59+
"npm: watch-tests"
60+
],
61+
"problemMatcher": []
62+
}
63+
]
64+
}

.vscodeignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.github/
2+
.release-notes/
3+
.vscode/
4+
node_modules/
5+
src/
6+
.markdownlintignore
7+
.gitignore
8+
Makefile
9+
VERSION
10+
tsconfig.json

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
VERSION := $(shell cat VERSION)
2+
3+
config ?= release
4+
ifdef config
5+
ifeq (,$(filter $(config),debug release))
6+
$(error Unknown configuration "$(config)")
7+
endif
8+
endif
9+
10+
11+
BUILD_DIR := build/$(config)
12+
DIST_DIR := dist
13+
SRC_DIR := src
14+
EXTENSION_JS := $(DIST_DIR)/extension.js
15+
EXTENSION := $(BUILD_DIR)/pony-$(VERSION).vsix
16+
SOURCE_FILES := $(shell find $(SRC_DIR) -name *.ts)
17+
18+
all: $(EXTENSION)
19+
20+
$(EXTENSION): $(SOURCE_FILES) $(BUILD_DIR) node_modules $(BUILD_DIR)
21+
npm run vsce package -- --no-git-tag-version --out="$(BUILD_DIR)/pony-$(VERSION).vsix" "$(VERSION)"
22+
23+
node_modules:
24+
npm install
25+
26+
$(BUILD_DIR):
27+
mkdir -p $(BUILD_DIR)
28+
29+
clean:
30+
rm -rf dist build
31+
32+
.PHONY: clean

README.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1-
# vscode-extension
1+
# Pony Extension for Visual Studio Code
22

3-
Pony VSCode support
3+
## Build it
4+
5+
```sh
6+
# install dependencies
7+
npm install
8+
9+
# compile the code
10+
npm run compile
11+
12+
# build the package
13+
npm run vsce package
14+
```
15+
16+
Alternatively run `make`!
17+
18+
## Install it
19+
20+
```sh
21+
# uninstall any previously installed extensions
22+
code --uninstall-extension ponylang.pony
23+
24+
# install the newly-built package
25+
code --install-extension "pony-${VERSION}.vsix"
26+
```
27+
28+
## Configure the Language Server
29+
30+
### Prerequisites
31+
32+
Install `pony-lsp` and [`ponyc`](https://github.com/ponylang/ponyc) and ensure they're on your PATH. For example:
33+
34+
```sh
35+
brew install ponyc
36+
```
37+
38+
The extension will show an error if `pony-lsp` is not found.
39+
40+
### Configuration
41+
42+
**`pony.ponyStdLibPath`**: The file path to the Pony standard library. If set, prepended to `PONYPATH`.
43+
44+
```json
45+
{
46+
"pony.ponyStdLibPath": "/usr/local/lib/ponyc/0.60.5/packages"
47+
}
48+
```

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.0
1+
0.3.0

0 commit comments

Comments
 (0)