Skip to content

Commit 2818cac

Browse files
committed
Some improvements in the generation of VSIX
* Since package.json is generated, update src/lsp/superbol_free_lib/project.ml * Split Makefile.header rules to be called from SuperBOL CI * Some improvements in Vscode Manifest types
1 parent 2bea02c commit 2818cac

File tree

9 files changed

+334
-3927
lines changed

9 files changed

+334
-3927
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ _build
1616
/_opam
1717
/_build
1818
.drom.config
19-
/dist
19+
/_dist
2020
/node_modules
2121
/yarn-error.log
2222
/yarn.lock
@@ -28,5 +28,6 @@ ATTIC
2828
*.vsix
2929
*.opam.locked
3030
/emacs/lsp-superbol-customs.el
31+
/_out
3132

3233

.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
!syntaxes/
77
!README.md
88
!CHANGELOG.md
9-
!LICENSE
9+
!LICENSE.md
1010
!package.json
1111
!astexplorer/dist/index.html

Makefile.header

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,54 @@ LSP_MODE_SRCDIR ?= ../lsp-mode
1010
all: superbol-free
1111
superbol-free: build
1212
$(CP) _build/default/src/lsp/superbol-free/main.exe superbol-free
13+
cp -f package.json package.json.prev
14+
./superbol-free json vscode --gen package.json
15+
diff -u package.json.prev package.json && rm -f package.json.prev
1316

1417
.PHONY: compile
1518
compile: build
16-
yarn esbuild _build/default/$(SRCDIR)/$(PROJECT).bc.js \
19+
$(MAKE) yarn-build
20+
21+
yarn-build:
22+
mkdir -p _out
23+
$(CP) _build/default/$(SRCDIR)/$(PROJECT).bc.js _out/
24+
yarn esbuild _out/$(PROJECT).bc.js \
1725
--bundle \
1826
--external:vscode \
19-
--outdir=dist \
27+
--outdir=_dist \
2028
--platform=node \
2129
--target=es6 \
2230
--sourcemap
23-
# the last command generated dist/$(PROJECT).bs.js
31+
# the last command generated _dist/$(PROJECT).bs.js
2432

2533
.PHONY: compile-release
26-
compile-release:
34+
compile-release: build-release
35+
$(MAKE) yarn-release
36+
37+
build-release:
2738
opam exec -- dune build $(SRCDIR)/$(PROJECT).bc.js --profile=release
28-
yarn esbuild _build/default/$(SRCDIR)/$(PROJECT).bc.js \
39+
mkdir -p _out
40+
$(CP) _build/default/$(SRCDIR)/$(PROJECT).bc.js _out/
41+
42+
yarn-release:
43+
yarn esbuild _out/$(PROJECT).bc.js \
2944
--bundle \
3045
--external:vscode \
31-
--outdir=dist \
46+
--outdir=_dist \
3247
--platform=node \
3348
--target=es6 \
3449
--minify-whitespace \
3550
--minify-syntax \
3651
--sourcemap \
3752
--sources-content=false
3853

54+
vsix:
55+
vsce package --out superbol-vscode-platform.vsix --yarn
56+
deploy-vsce:
57+
vsce publish --packagePath superbol-vscode-platform.vsix --yarn
58+
deploy-ovsx:
59+
ovsx publish --yarn
60+
3961
.PHONY: clean-execs
4062
distclean: clean-execs
4163
clean-execs:

package.json

Lines changed: 81 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,39 @@
11
{
2-
"name": "superbol",
3-
"displayName": "Superbol COBOL",
4-
"description": "Provides a COBOL mode in VSCode based on Superbol",
5-
"license": "MIT",
6-
"version": "0.1.0",
7-
"publisher": "ocamlpro",
8-
"repository": {
9-
"type": "git",
10-
"url": "https://github.com/OCamlPro/superbol-vscode-platform"
11-
},
12-
"homepage": "https://ocamlpro.com/cobol",
13-
"author": {
14-
"name": "OCamlPro SAS",
15-
"email": "[email protected]"
16-
},
17-
"keywords": [
18-
"cobol",
19-
"gnucobol"
20-
],
212
"engines": {
223
"vscode": "^1.64.0"
234
},
24-
"categories": [
25-
"Formatters",
26-
"Programming Languages",
27-
"Linters",
28-
"Snippets",
29-
"Other"
30-
],
315
"activationEvents": [
326
"onLanguage:cobol",
337
"onDebug"
348
],
359
"contributes": {
36-
"languages": [
10+
"breakpoints": [
3711
{
38-
"id": "cobol",
39-
"aliases": [
40-
"COBOL"
41-
],
42-
"filenamePatterns": [
43-
"*.cbl",
44-
"*.cob"
45-
]
12+
"language": "COBOL"
4613
}
4714
],
15+
"configuration": {
16+
"title": "Superbol COBOL",
17+
"properties": {
18+
"superbol.globalFormatTakesSelection": {
19+
"type": "boolean",
20+
"default": false,
21+
"description": "If something is selected, only format the selection"
22+
},
23+
"superbol.path": {
24+
"default": "",
25+
"description": "Path to the `superbol` command"
26+
}
27+
}
28+
},
4829
"debuggers": [
4930
{
5031
"type": "cobol",
32+
"label": "GnuCOBOL Debugger",
33+
"program": "gdb",
5134
"languages": [
5235
"cobol"
5336
],
54-
"program": "gdb",
55-
"args": [
56-
"--init-eval-command=\"source /usr/local/bin/cobcd.py\""
57-
],
5837
"configurationAttributes": {
5938
"launch": {
6039
"type": "cobol",
@@ -83,59 +62,68 @@
8362
]
8463
}
8564
],
86-
"breakpoints": [
65+
"languages": [
8766
{
88-
"language": "COBOL"
67+
"id": "cobol",
68+
"aliases": [
69+
"COBOL"
70+
],
71+
"filenamePatterns": [
72+
"*.cbl",
73+
"*.cob"
74+
]
8975
}
9076
],
91-
"configuration": {
92-
"title": "Superbol COBOL",
93-
"properties": {
94-
"superbol.globalFormatTakesSelection": {
95-
"type": "boolean",
96-
"default": false,
97-
"description": "If something is selected, only format the selection"
98-
},
99-
"superbol.path": {
100-
"type": "string",
101-
"default": "",
102-
"description": "Path to the `superbol` command"
103-
}
104-
}
105-
},
10677
"taskDefinitions": [
107-
{
108-
"type": "superbol",
109-
"properties": {
110-
"copybooks": {
111-
"type": "array",
112-
"description": "The list of copybooks paths"
113-
},
114-
"sourceFormat": {
115-
"type": "string",
116-
"description": "The source format of the code"
117-
},
118-
"dialect": {
119-
"type": "string",
120-
"description": "The COBOL dialect used"
121-
},
122-
"forDebugging": {
123-
"type": "boolean",
124-
"description": "Build for debugging"
125-
},
126-
"extensions": {
127-
"type": "array",
128-
"description": "Add cobol file extensions"
129-
}
130-
}
78+
{
79+
"type": "superbol",
80+
"properties": {
81+
"copybooks": {
82+
"type": "array",
83+
"description": "The list of copybooks paths"
84+
},
85+
"sourceFormat": {
86+
"description": "The source format of the code"
87+
},
88+
"dialect": {
89+
"description": "The COBOL dialect used"
90+
},
91+
"forDebugging": {
92+
"type": "boolean",
93+
"description": "Build for debugging"
94+
},
95+
"extensions": {
96+
"type": "array",
97+
"description": "Add cobol file extensions"
98+
}
13199
}
100+
}
132101
]
133102
},
134-
"main": "./dist/superbol_vscode_platform.bc.js",
103+
"name": "superbol",
104+
"displayName": "Superbol Studio OSS",
105+
"description": "Provides a COBOL mode in VSCode, based on SuperBOL Language Server Protocol for COBOL",
106+
"license": "MIT",
107+
"version": "0.1.0",
108+
"repository": {
109+
"type": "git",
110+
"url": "https://github.com/OCamlPro/superbol-studio-oss"
111+
},
112+
"homepage": "https://get-superbol.com",
113+
"author": {
114+
"name": "SuperBOL at OCamlPro",
115+
"email": "[email protected]"
116+
},
117+
"keywords": [
118+
"cobol",
119+
"gnucobol"
120+
],
121+
"main": "./_dist/superbol_studio_oss.bc.js",
135122
"scripts": {
136123
"compile": "make compile",
137-
"package": "vsce package --out superbol-vscode-platform.vsix --yarn",
138-
"deploy:vsce": "vsce publish --packagePath superbol-vscode-platform.vsix --yarn",
124+
"release": "make release",
125+
"package": "vsce package --out superbol-studio-oss.vsix --yarn",
126+
"deploy:vsce": "vsce publish --packagePath superbol-studio-oss.vsix --yarn",
139127
"deploy:ovsx": "ovsx publish --yarn"
140128
},
141129
"dependencies": {
@@ -155,5 +143,13 @@
155143
"prettier": "^2.5.1",
156144
"vsce": "^2.15.0",
157145
"vscode-test": "1.6.1"
158-
}
159-
}
146+
},
147+
"publisher": "ocamlpro",
148+
"categories": [
149+
"Formatters",
150+
"Programming Languages",
151+
"Linters",
152+
"Snippets",
153+
"Other"
154+
]
155+
}
File renamed without changes.

src/lsp/superbol_free_lib/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let public_subcommands = [
2222
Command_texi2rst.cmd ;
2323
Command_indent_range.cmd;
2424
Command_indent_file.cmd;
25-
Command_json_package.cmd;
25+
Command_json_vscode.cmd;
2626
]
2727

2828
let main ?style_renderer ?utf_8 () =

0 commit comments

Comments
 (0)