Commit Graph

177 Commits

Author SHA1 Message Date
db9371bfa6
Fully package vscode extension with nix 2020-09-17 18:24:36 +03:00
417b427f6d
Fix tree-sitter generation with make 2020-09-17 18:24:35 +03:00
Kirill Kuvshinov
7f3a662cbc
Add nix expressions for building a static musl executable 2020-09-17 18:24:34 +03:00
Kirill Kuvshinov
c44a35d4d1
[LIGO-47] PascaLIGO: Move block out of case_block alternatives
Problem: In multisig.ligo:48, the case alternative block is
interpreted as empty, while it is not. This happens because
PascaLIGO parser expects to find `fields "statements"` inside
a `case_block`. In practice, if a `case_block` contains a `block`,
statements are deeper in the hierarchy, and get ignored.

Solution: Move "block" option out of the "case_block"
(to _if_clause).
2020-09-15 11:25:21 +03:00
Kirill Kuvshinov
04724a1db2
[LIGO-47] Allow let .. in in lambda body
Problem: In multisig.mligo, else clause on line 36 ends on line 55,
while it should end on line 80. This happens because of incorrect
lambda parsing on lines 42-43. In particular, `let valid, keys = vk`
in lambda body gets parsed as a
`tuple (fun_app "let" "valid") (binary_op "=" "keys" "vk")`, and `in`
is considered as a part of the outer `let`.

Solution: Allow `_program` instead of `_expr` as the lambda body.
2020-09-15 11:22:15 +03:00
Anton Myasnikov
7f6820c368
[LIGO-42] Support for document symbols
Problem: We want to be able to extract document symbols from some
ligo contract that are realised by @haskell-lsp@ client.

Solution: Implement `extractDocumentSymbols` and integrate it with
@haskell-lsp@.
2020-09-09 14:08:09 +03:00
Anton Myasnikov
619a7de432
[LIGO-41] Convert ligo scopes to ScopedDecl 2020-09-08 18:48:53 +03:00
Anton Myasnikov
d5154dff36
[LIGO-41] Ligo binary integration
Problem: We want to integrate our lsp client with ligo binary to
be able to typecheck declarations as well as extract their scopes.

Solution: Implement a simple client that calls ligo and some helpers
functions to extract scopes from its output.
2020-09-08 18:48:53 +03:00
Anton Myasnikov
7c43cd9574
[LIGO-40] Move LSP request handlers to Capabilities directory 2020-09-08 18:47:23 +03:00
Anton Myasnikov
0b1590e324
[LIGO-40] Implement LSP range cconversion function
Problem: We need to be able to convert squirrel ranges to lsp
specific ones.

Solution: Add `toLSPRange` function.
2020-09-08 18:44:11 +03:00
Anton Myasnikov
283f41738d
[LIGO-40] Support for code hovering
Problem: We want to be able to show modal on hovering curson on
some specific declaration.

Solution: Add `hoverDecl` and integrate it with haskell-lsp client.
2020-09-08 18:44:11 +03:00
Kirill Kuvshinov
5d8f2c8526
[LIGO-13] Add CameLIGO and ReasonLIGO
Problem: The previous version of the extension only supported
PascaLIGO dialect. We need to add syntax highlighting and
activation events for ReasonLIGO and CameLIGO.

Solution: Add .tmlanguage.json files for ReasonLIGO and CameLIGO,
add activation events.
2020-09-08 13:14:51 +03:00
Kirill Kuvshinov
15fc6f25fd
[LIGO-13] Add a VSCode extension
Problem: We need to deliver a VSCode extension but the one we use
currently is located in a separate repo, requires manual patches
and does not support ReasonLIGO.

Solution: Add our extension that supports PascaLIGO and ReasonLIGO;
CamLIGO is WIP.
2020-09-08 13:14:43 +03:00
Anton Myasnikov
f0005c982a
[LIGO-39] Parse contracts in directory
Problem: We want to be able to parse whole directory for ligo
contracts for testing purposes.

Solution: Add `parseContracts` function that returns `ParsedContract`
data that ignores every file which is not a ligo contract.
2020-08-25 17:29:40 +03:00
Anton Myasnikov
fd862676b3
[LIGO-26] Support code folding capability
Problem: We want to support code folding for functions and types
in our lsp.

Solution: Add `foldingAST` function that produces an additional
list of ranges along with the given monad used in `haskell-lsp`
API to collect ranges that are consequently sent to server.
2020-08-25 13:39:47 +03:00
Kirill Andreev
28714af8cc
Additional fixes 2020-08-24 20:20:52 +04:00
Kirill Andreev
f2a3f0b579
Hopefully fix VFS loading (by falling back to loadByURI) 2020-08-24 20:10:00 +04:00
Kirill Andreev
da6ca97a9d
Fix 'field name not found' for reasonligo 2020-08-24 20:05:24 +04:00
Kirill Andreev
5533b07270
Fix pattern defs for pascaligo 2020-08-24 14:17:53 +04:00
Kirill Andreev
f554551f75
[LIGO-37] [LIGO-38] Looks like it fixes it 2020-08-24 12:29:51 +04:00
Anton Myasnikov
3037be689b
[LIGO-27] Fix parameters for lambdas and restructure grammar
Problem: It happens that "go to definition" fails with lambda
parameters meaning that we do not create proper AST for it.
Also we need to restructure grammar so that we can support it in
the future.

Solution: Restructure grammar to use "param_decl" and ensure that
we use proper fields for parser resolution.
2020-08-23 22:05:27 +03:00
Anton Myasnikov
1828fd6d46
[LIGO-29] Integrate existing completion framework with haskell-lsp
Problem: Currently we have not integrated our completions with
haskell-lsp server so that we could use this completion from text
editor itself.

Solution: Add the corresponding requests for handling code completion.
2020-08-23 22:01:00 +03:00
Kirill Andreev
1c684a791c
Fix camligo not registering fun/lam args 2020-08-21 18:24:06 +04:00
Kirill Andreev
7fa947e92e
Add all parser.c as symlinks 2020-08-21 18:23:39 +04:00
Kirill Andreev
5e0cf40ea7
[fix] Cleaning the commented code after CAML grammar 2020-08-19 14:29:44 +04:00
Kirill Andreev
41a49da1e0
Pin the vendor/camligo directory 2020-08-19 14:12:03 +04:00
Kirill Andreev
6e2f592094
[LIGO-17] Implementing CAMLligo dialect 2020-08-18 21:56:33 +04:00
Kirill Andreev
1a948bcae7
Extension and grammar 2020-08-17 16:29:42 +04:00
Kirill Andreev
26d11eea19
Rename debounced -> unsafeDebounce 2020-08-14 15:49:42 +04:00
Kirill Andreev
fe929fbe70
Link camligo grammar, get rid of personal loaders 2020-08-14 15:40:30 +04:00
Kirill Andreev
ba66f6e8e4
Make extension-aware parser entrypoint 2020-08-14 14:54:04 +04:00
Kirill Andreev
28e16ca068
Make grammar parse everything except inline M. 2020-08-13 16:13:48 +04:00
Kirill Andreev
78c408b76a
Untangle existing code for grammar 2020-08-13 16:13:42 +04:00
Anton Myasnikov
f1938eb2af
Hotfix: add missing Scoped instances 2020-08-12 14:28:51 +03:00
Kirill Andreev
31b5ffbeef
Keeps dirs, remove unused artifact 2020-08-11 15:41:20 +04:00
Anton Myasnikov
a1a846b554
[LIGO-25] Add ReasonLIGO parser
Problem: With generated ReasonLIGO grammar we need to develop its
parser as well. With it we also need to restructure AST a bit
and add expressions that are used for ReasonLIGO specifically.

Solution: Add ReasonLIGO parser and some dummy examples of its
usage, adapt AST to it, rename LIGO to AST.
2020-08-11 13:33:26 +03:00
Anton Myasnikov
820d73f345
[LIGO-25] Chores (add Makefile, scripts, vendor, stylish)
Problem: We need to add stylish config to settle code style for our
project. Makefile to simplify its building. Also we need to check
our project for trailing whitespaces so we need to add the corresponding
script to be used later in CI.

Solution:
Add
  - stylish-haskell config
  - Makefile
  - `check_trailing_whitespace` script
2020-08-11 13:31:22 +03:00
Anton Myasnikov
99321a59bb
[LIGO-25] Add grammar for ReasonLIGO and move it to squirrel
Problem: Before making parser for ReasonLIGO we need to construct
its grammar so that we can collect *all* errors and simplify our
further work with AST. Also since we use those grammars in squirrel
it would be conscise to use them from the project directory directly.

Solution: Add grammar for ReasonLIGO and move grammar to squirrel.
2020-08-11 13:30:46 +03:00
Kirill Andreev
2a8cda17ce
Add type/doc capture 2020-08-11 12:32:55 +04:00
Kirill Andreev
38c32f01d4
Remove most warnings and renudant line in AST.Parser 2020-08-11 12:32:55 +04:00
Kirill Andreev
107018e6f3
Add basic code completion mechanism 2020-08-11 12:32:54 +04:00
Kirill Andreev
08a0eb55d1
Fix AST.Scope 2020-08-11 12:32:54 +04:00
Kirill Andreev
31274e1507
Tie all up 2020-08-11 12:32:54 +04:00
Kirill Andreev
9f29dab195
Fix letrec partially 2020-08-11 12:32:53 +04:00
Kirill Andreev
6bd5d9ef84
Update AST.Scope to new framework 2020-08-11 12:32:53 +04:00
Kirill Andreev
226b7264aa
Restore AST.Scope instances and part of the machinery 2020-08-11 12:32:53 +04:00
Kirill Andreev
b5e5bc25a1
[WIP] Conversion to descent-based parser 2020-08-11 12:32:52 +04:00
Kirill Andreev
3233270dba
Add debounced function 2020-08-11 12:32:10 +04:00
Kirill Andreev
58e5128142
Fix dying on broken code and handle errors in Main.hs 2020-08-11 12:32:10 +04:00
Kirill Andreev
508b111374
Fix blocks getting invalid ranges 2020-08-11 12:32:09 +04:00