Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect COBOL variable in EXEC SQL, provides go to def, show refs and hover #375

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d879fd4
Add a skeleton for SQL preprocessor
lefessan Jun 21, 2024
951de55
SQL is parsed
LilyOlivier Jun 26, 2024
f25b81b
try to copy
LilyOlivier Jun 27, 2024
7fc9933
Add CONNECT and CONNECT RESET
LilyOlivier Jun 28, 2024
e46a5b6
light integration of typeck, size seems correctly calculated
LilyOlivier Jul 10, 2024
cdad875
typoS
LilyOlivier Jul 11, 2024
9a91b6a
refactoring
LilyOlivier Jul 26, 2024
213d2d1
Start transaction
LilyOlivier Jul 29, 2024
29e1955
Merge and conflict resolve
LilyOlivier Jul 29, 2024
500b284
drom
LilyOlivier Jul 29, 2024
61c5c87
add some Cursor utilities
LilyOlivier Aug 2, 2024
ad2bf0a
fix Select Into
LilyOlivier Aug 12, 2024
5c987a9
add Prepare Into and fix typos
LilyOlivier Aug 12, 2024
45be81d
fix Insert
LilyOlivier Aug 13, 2024
ca64c9d
fix select into and simplification
LilyOlivier Aug 14, 2024
a85b842
rework error_treatment, fix cursor, add DeclareTable
LilyOlivier Aug 16, 2024
4f9eb71
fix Cursor and fix some type calculation
LilyOlivier Aug 20, 2024
6b64ff5
somes changes
LilyOlivier Aug 28, 2024
a2be3da
better copy
LilyOlivier Sep 9, 2024
917bd30
note for the one who will continue this work
LilyOlivier Sep 20, 2024
8fa6cf1
Merge branch 'master' into sql_preproc
NeoKaios Oct 3, 2024
4e38236
fix: merge build errors
NeoKaios Oct 4, 2024
ba14fe9
fix: problem with long sql stmt generation
NeoKaios Oct 7, 2024
6e81be0
docs: how to run gixsql test for superbol
NeoKaios Oct 7, 2024
93430b2
fix: multiple bugfixes and refactors
NeoKaios Oct 11, 2024
ff2a927
fix: grammar and add cbsql to cob_extension
NeoKaios Oct 14, 2024
36c117a
feat: update gixsql testsuite doc
NeoKaios Oct 14, 2024
ff34002
fix: failing test
NeoKaios Oct 16, 2024
85cd08c
feat: add sql_ast visitor, fix typo in types
NeoKaios Oct 16, 2024
9c00487
chore: refactor, and using ast visitor
NeoKaios Oct 16, 2024
b0b7364
feat: reactivate sql preproc, go to def/ref active in exec block
NeoKaios Oct 16, 2024
d9adafd
test: autopromote
NeoKaios Oct 16, 2024
1fe8a89
fix: half fix group var need splitting in sql stmt
NeoKaios Oct 22, 2024
b793fd0
Revert "feat: reactivate sql preproc, go to def/ref active in exec bl…
NeoKaios Oct 22, 2024
6def5a8
Revert "test: autopromote"
NeoKaios Oct 22, 2024
4002f79
Merge branch 'master' into sql-preproc
NeoKaios Oct 22, 2024
5e09035
fix: group var splitting in sql preproc
NeoKaios Oct 22, 2024
365cb47
Merge branch 'master' into sql-preproc
NeoKaios Oct 23, 2024
997ef96
feat: reactivate sql_preproc in lsp, added refs and hover to var in exec
NeoKaios Oct 23, 2024
757c676
test: added failing test for completion
NeoKaios Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 59 additions & 38 deletions .drom

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- run: opam pin add . -y --no-action

- run: opam depext -y superbol-studio-oss superbol-vscode-platform polka-js-stubs interop-js-stubs node-js-stubs vscode-js-stubs vscode-languageclient-js-stubs vscode-json vscode-debugadapter vscode-debugprotocol superbol-free superbol_free_lib superbol_preprocs superbol_project cobol_common cobol_parser cobol_ptree ebcdic_lib cobol_lsp ppx_cobcflags pretty cobol_config cobol_indent cobol_indent_old cobol_preproc cobol_data cobol_typeck cobol_unit ez_toml ezr_toml sql_ast sql_parser cobol_cfg
- run: opam depext -y superbol-studio-oss superbol-vscode-platform polka-js-stubs interop-js-stubs node-js-stubs vscode-js-stubs vscode-languageclient-js-stubs vscode-json vscode-debugadapter vscode-debugprotocol superbol-free superbol_free_lib superbol_preprocs superbol_project cobol_common cobol_parser cobol_ptree ebcdic_lib cobol_lsp ppx_cobcflags pretty cobol_config cobol_indent cobol_indent_old cobol_preproc cobol_data cobol_typeck cobol_unit ez_toml ezr_toml sql_preproc sql_ast sql_parser cobol_cfg
# if: steps.cache-opam.outputs.cache-hit != 'true'

- run: opam install -y opam/*.opam --deps-only --with-test
Expand Down
2 changes: 1 addition & 1 deletion Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions drom.toml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ dir = "src/vendor/ez_toml"
dir = "src/lsp/ezr_toml"
# edit 'src/lsp/ezr_toml/package.toml' for package-specific options

[[package]]
dir = "src/lsp/sql_preproc"
# edit 'src/lsp/ezr_toml/package.toml' for package-specific options

[[package]]
dir = "src/lsp/sql_ast"
# edit 'src/lsp/sql_ast/package.toml' for package-specific options
Expand Down
19 changes: 19 additions & 0 deletions dune-project

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions opam/cobol_typeck.opam
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ install: [
depends: [
"ocaml" {>= "4.14.0"}
"dune" {>= "2.8.0"}
"superbol_preprocs" {= version}
"sql_ast" {= version}
"cobol_unit" {= version}
"cobol_ptree" {= version}
"cobol_parser" {= version}
Expand Down
2 changes: 2 additions & 0 deletions opam/osx/cobol_typeck-osx.opam
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ install: [
depends: [
"ocaml" {>= "4.14.0"}
"dune" {>= "2.8.0"}
"superbol_preprocs-osx" {= version}
"sql_ast-osx" {= version}
"cobol_unit-osx" {= version}
"cobol_ptree-osx" {= version}
"cobol_parser-osx" {= version}
Expand Down
60 changes: 60 additions & 0 deletions opam/osx/sql_preproc-osx.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This file was generated by `drom` from `drom.toml`.
# Do not modify, or add to the `skip` field of `drom.toml`.
opam-version: "2.0"
name: "sql_preproc"
version: "0.1.4"
license: "MIT"
synopsis: "SuperBOL Studio OSS Project"
description: "SuperBOL Studio OSS is a new platform for COBOL"
authors: [
"Nicolas Berthier <[email protected]>"
"David Declerck <[email protected]>"
"Boris Eng <[email protected]>"
"Fabrice Le Fessant <[email protected]>"
"Emilien Lemaire <[email protected]>"
]
maintainer: [
"Nicolas Berthier <[email protected]>"
"David Declerck <[email protected]>"
"Boris Eng <[email protected]>"
"Fabrice Le Fessant <[email protected]>"
"Emilien Lemaire <[email protected]>"
]
homepage: "https://ocamlpro.github.io/superbol-studio-oss"
doc: "https://ocamlpro.github.io/superbol-studio-oss/sphinx"
bug-reports: "https://github.com/ocamlpro/superbol-studio-oss/issues"
dev-repo: "git+https://github.com/ocamlpro/superbol-studio-oss.git"
tags: "org:ocamlpro"
build: [
["dune" "subst"] {dev}
["sh" "-c" "./scripts/before.sh build '%{name}%'"]
[
"dune"
"build"
"-p"
"sql_preproc"
"-x"
"osx"
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["sh" "-c" "./scripts/after.sh build '%{name}%'"]
]
install: [
["sh" "-c" "./scripts/before.sh install '%{name}%'"]
]
depends: [
"ocaml" {>= "4.14.0"}
"dune" {>= "2.8.0"}
"superbol_preprocs-osx" {= version}
"ppx_deriving-osx" {>= "5.2.1"}
"ez_file-osx" {>= "0.3"}
"cobol_unit-osx" {= version}
"cobol_typeck-osx" {= version}
"cobol_indent-osx" {= version}
"odoc" {with-doc}
]
# Content of `opam-trailer` field:
1 change: 1 addition & 0 deletions opam/osx/superbol_free_lib-osx.opam
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ depends: [
"dune" {>= "2.8.0"}
"vscode-json-osx" {= version}
"superbol_preprocs-osx" {= version}
"sql_preproc-osx" {= version}
"lwt-osx" {>= "5"}
"ez_toml-osx" {= version}
"ez_file-osx" {>= "0.3"}
Expand Down
58 changes: 58 additions & 0 deletions opam/sql_preproc.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This file was generated by `drom` from `drom.toml`.
# Do not modify, or add to the `skip` field of `drom.toml`.
opam-version: "2.0"
name: "sql_preproc"
version: "0.1.4"
license: "MIT"
synopsis: "SuperBOL Studio OSS Project"
description: "SuperBOL Studio OSS is a new platform for COBOL"
authors: [
"Nicolas Berthier <[email protected]>"
"David Declerck <[email protected]>"
"Boris Eng <[email protected]>"
"Fabrice Le Fessant <[email protected]>"
"Emilien Lemaire <[email protected]>"
]
maintainer: [
"Nicolas Berthier <[email protected]>"
"David Declerck <[email protected]>"
"Boris Eng <[email protected]>"
"Fabrice Le Fessant <[email protected]>"
"Emilien Lemaire <[email protected]>"
]
homepage: "https://ocamlpro.github.io/superbol-studio-oss"
doc: "https://ocamlpro.github.io/superbol-studio-oss/sphinx"
bug-reports: "https://github.com/ocamlpro/superbol-studio-oss/issues"
dev-repo: "git+https://github.com/ocamlpro/superbol-studio-oss.git"
tags: "org:ocamlpro"
build: [
["dune" "subst"] {dev}
["sh" "-c" "./scripts/before.sh build '%{name}%'"]
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["sh" "-c" "./scripts/after.sh build '%{name}%'"]
]
install: [
["sh" "-c" "./scripts/before.sh install '%{name}%'"]
]
depends: [
"ocaml" {>= "4.14.0"}
"dune" {>= "2.8.0"}
"superbol_preprocs" {= version}
"ppx_deriving" {>= "5.2.1"}
"ez_file" {>= "0.3"}
"cobol_unit" {= version}
"cobol_typeck" {= version}
"cobol_indent" {= version}
"odoc" {with-doc}
]
# Content of `opam-trailer` field:
1 change: 1 addition & 0 deletions opam/superbol_free_lib.opam
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ depends: [
"dune" {>= "2.8.0"}
"vscode-json" {= version}
"superbol_preprocs" {= version}
"sql_preproc" {= version}
"lwt" {>= "5"}
"ez_toml" {= version}
"ez_file" {>= "0.3"}
Expand Down
2 changes: 2 additions & 0 deletions opam/windows/cobol_typeck-windows.opam
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ install: [
depends: [
"ocaml" {>= "4.14.0"}
"dune" {>= "2.8.0"}
"superbol_preprocs-windows" {= version}
"sql_ast-windows" {= version}
"cobol_unit-windows" {= version}
"cobol_ptree-windows" {= version}
"cobol_parser-windows" {= version}
Expand Down
60 changes: 60 additions & 0 deletions opam/windows/sql_preproc-windows.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This file was generated by `drom` from `drom.toml`.
# Do not modify, or add to the `skip` field of `drom.toml`.
opam-version: "2.0"
name: "sql_preproc"
version: "0.1.4"
license: "MIT"
synopsis: "SuperBOL Studio OSS Project"
description: "SuperBOL Studio OSS is a new platform for COBOL"
authors: [
"Nicolas Berthier <[email protected]>"
"David Declerck <[email protected]>"
"Boris Eng <[email protected]>"
"Fabrice Le Fessant <[email protected]>"
"Emilien Lemaire <[email protected]>"
]
maintainer: [
"Nicolas Berthier <[email protected]>"
"David Declerck <[email protected]>"
"Boris Eng <[email protected]>"
"Fabrice Le Fessant <[email protected]>"
"Emilien Lemaire <[email protected]>"
]
homepage: "https://ocamlpro.github.io/superbol-studio-oss"
doc: "https://ocamlpro.github.io/superbol-studio-oss/sphinx"
bug-reports: "https://github.com/ocamlpro/superbol-studio-oss/issues"
dev-repo: "git+https://github.com/ocamlpro/superbol-studio-oss.git"
tags: "org:ocamlpro"
build: [
["dune" "subst"] {dev}
["sh" "-c" "./scripts/before.sh build '%{name}%'"]
[
"dune"
"build"
"-p"
"sql_preproc"
"-x"
"windows"
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["sh" "-c" "./scripts/after.sh build '%{name}%'"]
]
install: [
["sh" "-c" "./scripts/before.sh install '%{name}%'"]
]
depends: [
"ocaml" {>= "4.14.0"}
"dune" {>= "2.8.0"}
"superbol_preprocs-windows" {= version}
"ppx_deriving-windows" {>= "5.2.1"}
"ez_file-windows" {>= "0.3"}
"cobol_unit-windows" {= version}
"cobol_typeck-windows" {= version}
"cobol_indent-windows" {= version}
"odoc" {with-doc}
]
# Content of `opam-trailer` field:
1 change: 1 addition & 0 deletions opam/windows/superbol_free_lib-windows.opam
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ depends: [
"dune" {>= "2.8.0"}
"vscode-json-windows" {= version}
"superbol_preprocs-windows" {= version}
"sql_preproc-windows" {= version}
"lwt-windows" {>= "5"}
"ez_toml-windows" {= version}
"ez_file-windows" {>= "0.3"}
Expand Down
4 changes: 2 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions sphinx/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Overview of sub-commands::
snapshot
Manage environment snapshots

sql preproc
Preprocess SQL EXECs

switch
Print current switch

Expand Down Expand Up @@ -526,6 +529,44 @@ Where options are:
* :code:`--save ID` Create snapshot ID from state


main.exe sql preproc
~~~~~~~~~~~~~~~~~~~~~~

Preprocess SQL EXECs


**USAGE**
::

main.exe sql preproc FILE [OPTIONS]

Where options are:


* :code:`FILE` COBOL files to preproc

* :code:`-D VAR=VAL` Define a pre-processor variable VAR, with value VAL

* :code:`-I DIRECTORY` Add DIRECTORY to library search path

* :code:`--conf CONF_FILE` Set the configuration file to be used

* :code:`--copybooks` Preprocess copybooks also (without REPLACING)

* :code:`--dialect DIALECT` or :code:`--std DIALECT` Set the dialect to bu used (overriden by `--conf` if used)

* :code:`--ext EXT` Add .EXT as an extension to find copybooks (default is cpy)

* :code:`--free` Shorthand for `--source-format FREE`

* :code:`--recovery BOOL` Enable/disable parser recovery after syntax errors (default: true)

* :code:`--silence STRING` Silence specific messages

* :code:`--source-format SOURCE_FORMAT` Set the format of source code; allowed values are: { FIXED (the default), FREE}
Overrides `format` from configuration file if present.


main.exe switch
~~~~~~~~~~~~~~~~~

Expand Down
Loading
Loading