Commit Graph

16864 Commits

Author SHA1 Message Date
Arya Irani
f63cfbeadb
Merge pull request #5252 from sellout/test-1327 2024-08-03 23:46:39 +00:00
Arya Irani
c049c65ad7
Merge pull request #5187 from sellout/doc-lexer 2024-08-03 23:45:30 +00:00
Arya Irani
97c9109291
Merge pull request #5250 from unisonweb/update-defn-order 2024-08-02 22:22:37 +00:00
Arya Irani
69886f44a4
Merge pull request #5264 from unisonweb/nix-tmate 2024-08-02 22:21:39 +00:00
Arya Irani
6cb39c8838
Update .github/workflows/nix-dev-cache.yaml
Co-authored-by: Greg Pfeil <greg@technomadic.org>
2024-08-02 16:00:20 -04:00
Chris Penner
c32bb936d5
Merge pull request #5265 from unisonweb/lsp/fix-unused-bindings-in-cases
Fix unused-binding-detection in case patterns
2024-08-02 12:59:37 -07:00
Arya Irani
d7ac7c6031
Update .github/workflows/nix-dev-cache.yaml 2024-08-02 15:48:33 -04:00
Arya Irani
02f9eb7eed
Update .github/workflows/nix-dev-cache.yaml
Co-authored-by: Greg Pfeil <greg@technomadic.org>
2024-08-02 15:43:05 -04:00
Arya Irani
d903fd2401
Update nix-dev-cache.yaml 2024-08-02 14:32:57 -04:00
Arya Irani
d12176f2bb
Update nix-dev-cache.yaml 2024-08-02 14:14:48 -04:00
Arya Irani
a26a31a7cd
Update nix-dev-cache.yaml 2024-08-02 14:13:47 -04:00
Chris Penner
3e87dc3854 Fix unused-binding-detection in case patterns 2024-08-02 10:57:16 -07:00
Arya Irani
ac75905f8b
debug nix-dev-cache 2024-08-02 13:44:31 -04:00
Arya Irani
d184ac1f74
Merge pull request #5262 from unisonweb/update-defn-order-tweak 2024-08-02 17:33:40 +00:00
Greg Pfeil
1ee188d0e3
Merge remote-tracking branch 'upstream/trunk' into doc-lexer 2024-08-01 23:01:02 -06:00
Greg Pfeil
96f865b37c
Add a transcript showing that #5076 was fixed
Some handling of blocks without final newlines was improved in the course of this PR.

Fixes #5076.
2024-08-01 22:58:13 -06:00
Greg Pfeil
c5a66d5608
Simplify Doc parser from State to Reader 2024-08-01 22:52:54 -06:00
Arya Irani
8a3e2efafc
Merge pull request #5258 from unisonweb/cp/global-search 2024-08-01 21:56:22 +00:00
Arya Irani
9100b97e91 tweak output messages 2024-08-01 17:49:45 -04:00
Greg Pfeil
4803d446f1
Add some description to the new transcripts 2024-08-01 12:27:49 -06:00
ChrisPenner
8c9c3baad8 automatically run ormolu 2024-08-01 00:17:33 +00:00
Chris Penner
f9db384df1 Fix transcripts 2024-07-31 17:16:18 -07:00
Chris Penner
e545e0b1a7 Rerun transcripts 2024-07-31 16:41:00 -07:00
Chris Penner
d4a04b7349 re-add names.global 2024-07-31 16:40:56 -07:00
Chris Penner
03b225ccd1 Add ability to find over EVERY branch. 2024-07-31 16:36:08 -07:00
Arya Irani
4acebf0113
Merge pull request #5256 from unisonweb/travis/empty-pattern-match 2024-07-30 02:31:21 +00:00
Travis Staton
72da81f18b
remove unused arg 2024-07-29 21:21:09 -04:00
Travis Staton
94209eae14
permit empty matches 2024-07-29 19:45:48 -04:00
Greg Pfeil
beecaa9be7
Make Doc parser ignorant of type/term distinctions
This was the last thing tying Doc to Unison.
2024-07-27 00:52:13 -06:00
Greg Pfeil
9a941a3890
Caught a hardcoded }} in the Doc parser
The Doc parser shouldn’t know how Unison terminates Doc blocks.
2024-07-27 00:52:12 -06:00
Greg Pfeil
a6528ac351
Generalize the Doc parser
It is now completely[^1] independent of the Unison language. The parser takes a few parsers as arguments: one for
identifiers, one for code, and one to indicate the end of the Doc block.

[^1]: There is one last bit to be removed in the next commit – Doc still looks for `type` or `ability` to identify type
links.
2024-07-27 00:52:12 -06:00
Greg Pfeil
e9512a69ce
Split the Doc parser into multiple functions
In general, they map to the constructors of the Doc types, with some wiggle room for now.

It’s probably beneficial to review this commit by ignoring whitespace.
2024-07-27 00:52:12 -06:00
Greg Pfeil
6f2d188e5c
Split Doc parser from Unison lexer 2024-07-27 00:52:12 -06:00
Greg Pfeil
31f952201c
Simplify restoreStack
It’s only used inside `local`, so its attempts to restore the layout are for naught.
2024-07-27 00:52:12 -06:00
Greg Pfeil
70fe615570
Add Data.Functor.Classes instances
These are needed for the new Doc types, but had been stubbed out. Moving
the Doc types to their own module forced the changes that got in the way
of generating these with Template Haskell.
2024-07-27 00:52:12 -06:00
Greg Pfeil
c53cb088e1
Split Doc into its own module 2024-07-27 00:52:12 -06:00
Greg Pfeil
a6f6d9c8dc
Remove unnecessary docOpen in Doc parser 2024-07-27 00:52:11 -06:00
Greg Pfeil
3158e66603
Restructure BlockTree
We now build the stanzas at the same time as the tree, and don’t discard them after reordering.

This also changes the closing element of `Block` to be `Maybe` instead of `[]`.
2024-07-27 00:52:11 -06:00
Greg Pfeil
6c561f3146
Rename T to BlockTree 2024-07-27 00:52:11 -06:00
Greg Pfeil
567238fae8
Expose preParse to the parser 2024-07-27 00:52:11 -06:00
Greg Pfeil
94065e0610
Make comments into Haddock 2024-07-27 00:52:11 -06:00
Greg Pfeil
32472bd9e0
Allow EOF to close layout blocks
This removes the need to pad the lexer stream with trailing `Close` lexemes. If
EOF is reached, the parser will automatically close any layout blocks (but not
context-free blocks).
2024-07-27 00:52:11 -06:00
Greg Pfeil
159ea3a433
Extract preParse from lexer
After running the core of the lexer, the `lexer` function then does some
work to turn the stream into a tree, and reorder some lexemes. It then
throws away the tree structure.

This is the first step of preserving the tree structure for the parser.
It extracts the “pre-parser” from `lexer` so
that it can eventually be used _after_ the lexer, rather than internally.

This also moves `fixup` to be applied on each block as we reorder it,
rather than across the entire stream at the end (since the goal is to
not _have_ an entire stream any more).
2024-07-27 00:52:11 -06:00
Greg Pfeil
227ff27cea
Don’t “un-parse” Doc.
This removes the layer that makes the `Doc` parser look like a lexer and
replaces it with a function that converts the Doc structure directly
Unison Terms.
2024-07-27 00:52:10 -06:00
Greg Pfeil
5f87b41527
Un-hiding the Doc parser
`doc2` was a parser in lexer’s clothing. It would parse recursively, but
then return the result as a flat list of tokens.

This separates the parsing from the “unparsing” (which returns the
tokens), so now we have a parser to a recursive `Doc` structure. This
currently immediately applies the unparser, and should result in an
identical stream of tokens as the previous version. Eventually, we
should be able to avoid unparsing the `Doc` structure.
2024-07-27 00:52:10 -06:00
Greg Pfeil
543daa36c7
Move the Annotated class to the Ann module
This is in preparation for using `Ann` in the `Lexer` module, as that module
actually does some parsing.
2024-07-27 00:52:10 -06:00
Greg Pfeil
d1fe6d9429
Separate the Doc lexer from the Unison lexer
`doc2` is a Unison lexer that traverses a `Doc`.

`docBody` is the actual `Doc` lexer that is ignorant of the fact that Unison wraps `Doc` blocks in `{{`/`}}`.
2024-07-27 00:52:10 -06:00
Greg Pfeil
21209e2bdd
Extract the Doc lexer into a top-level function 2024-07-27 00:52:09 -06:00
Arya Irani
f5595763db
Merge pull request #5254 from unisonweb/cp/defn-search-sync
Add FromJSON for Display Object for definition search
2024-07-26 19:51:27 +00:00
Chris Penner
a49146fac3 Merge branch 'trunk' into cp/defn-search-sync 2024-07-26 11:47:09 -07:00