Commit Graph

3070 Commits

Author SHA1 Message Date
Arya Irani
c4f8ffcf39 clear latestTypecheckedFile on update
fixes #3424
2024-08-09 15:50:38 -04:00
Mitchell Rosen
7909114218 ⅄ trunk → 24-07-24-diff-api 2024-08-05 10:41:06 -04: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
Chris Penner
3e87dc3854 Fix unused-binding-detection in case patterns 2024-08-02 10:57:16 -07:00
Greg Pfeil
1ee188d0e3
Merge remote-tracking branch 'upstream/trunk' into doc-lexer 2024-08-01 23:01:02 -06:00
Arya Irani
9100b97e91 tweak output messages 2024-08-01 17:49:45 -04:00
ChrisPenner
8c9c3baad8 automatically run ormolu 2024-08-01 00:17:33 +00: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
Mitchell Rosen
9e4719e408 break up libdeps merge into diff and apply steps 2024-07-29 22:36:24 -04:00
Mitchell Rosen
43bfa09e43 make a Unison.Merge module that re-exports most of the merge API 2024-07-29 13:25:52 -04:00
Greg Pfeil
6f2d188e5c
Split Doc parser from Unison lexer 2024-07-27 00:52:12 -06:00
Mitchell Rosen
c4c23273f9 delete unused imports 2024-07-24 15:03:49 -04:00
Greg Pfeil
bd4c2044ec
Ensure transcript parser consumes entire stanzas
With the switch to `cmark`, the “second phase” parsing of individual
stanzas omitted an EOF check to ensure that the entire stanza had been
parsed. This resulted in parses where we end up with truncated sets of
UCM commands or API requests, which could either result in premature
success or failures occurring later in the transcript, where they’d
complain about the wrong thing.
2024-07-24 12:42:57 -06:00
Mitchell Rosen
aea1660a07 simplify checkDeclCoherency again 2024-07-24 02:58:07 -04:00
Mitchell Rosen
e64ffb6f2c ⅄ trunk → update-defn-order 2024-07-24 02:40:13 -04:00
Mitchell Rosen
7c307e61ea move some code around 2024-07-24 02:14:38 -04:00
Mitchell Rosen
7506ae26b6 get transcripts passing 2024-07-23 13:45:16 -04:00
Mitchell Rosen
4b68359e6e simplify update 2024-07-23 10:50:49 -04:00
Mitchell Rosen
c7a55f0196 update work 2024-07-22 18:26:14 -04:00
Chris Penner
1b22343c24 branch.reflog -> reflog 2024-07-22 15:00:47 -07:00
ChrisPenner
6e6c0ab8e2 automatically run ormolu 2024-07-22 17:59:57 +00:00
Chris Penner
05826172b8 Remove reset-root, fix docs for reset 2024-07-22 10:59:11 -07:00
Arya Irani
ef62cd99db
Merge pull request #5235 from sellout/refactor-transcript-parser 2024-07-19 19:29:42 +00:00
Greg Pfeil
9ac6a04ec1
Inform Ormolu of some operator precedences
This adds a .ormolu file to tell Ormolu what some operator precedences
are, to improve indentation of multi-line operator sequences.
2024-07-18 19:44:34 -06:00
Greg Pfeil
b8f1ed988a
Run Ormolu over the entire codebase
With #5142, Ormolu was upgraded from 0.5.2.0 to 0.7.2.0. This formats
the codebase to avoid spurious formatting comingled in other commits.

Almost all of the changes are simply wrapping single constraints in parens, like
```diff
-hashBranch :: forall m. Monad m => Branch m -> m BranchHash
+hashBranch :: forall m. (Monad m) => Branch m -> m BranchHash
```

There is also some reordering of language pragmas and imports,
indentation correction (some of which gets precedence wrong), and switching
some Haddock from `-- ^` to `-- |` .
2024-07-18 17:48:40 -06:00
Greg Pfeil
b1cf12330a
Split TranscriptParser into three modules
- `Transcript` – the data model
- `Transcript.Parser` – the parser and printer
- `Transcript.Runner` – the runner

There is unfortunately still some printing tightly coupled to the
runner, but this makes it more obvious. Also, the runner is the only
component tied to the CLI.
2024-07-16 19:35:02 -06:00
Greg Pfeil
00f6c8c954
Refactoring TranscriptParser
A bunch of small changes in TranscriptParser

- remove dead code
- don’t use `Show` for formatted output
- put processed blocks in a separate sum type from unprocessed blocks
- remove `Transcript` from identifiers (changed importers to use
 `qualified as Transcript`)
- deduplicated some error reporting

And one happy fix, IMO – got rid of the `Text.init` that plagued me in
2024-07-16 19:31:01 -06:00
Arya Irani
7019595b7b
Merge pull request #5224 from neduard/merged-ghc-upgrade-try-2 2024-07-15 20:47:57 +00:00
Arya Irani
9516c5983c
Merge pull request #5223 from unisonweb/cp/skip-eval 2024-07-15 17:30:59 +00:00
Eduard Nicodei
6ed06f3089 Merge remote-tracking branch 'origin/trunk' into merged-ghc-upgrade-try-2 2024-07-15 18:21:33 +01:00
Chris Penner
0c7851d289 Don't evaluate the unison file if there are no watch expressions. 2024-07-15 10:01:59 -07:00
Chris Penner
11208f5284 Add unused binding test 2024-07-12 14:48:18 -07:00
Chris Penner
5652c179fc Compiling with lamda annotations 2024-07-12 11:15:21 -07:00
Chris Penner
1e4f1abe73 Fix diff-helper to use the names from both branches 2024-07-11 12:33:19 -07:00
Chris Penner
987cd61976 Swap branch-relative-paths back to relative 2024-07-11 09:49:55 -07:00
Chris Penner
7113005480 Remerge remote 2024-07-10 23:01:16 -07:00
Arya Irani
0cd3cd1cff Merge branch 'trunk' into cp/project-root
# Conflicts:
#	unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md
#	unison-src/transcripts-round-trip/main.output.md
#	unison-src/transcripts/add-run.output.md
#	unison-src/transcripts/bug-strange-closure.output.md
#	unison-src/transcripts/cycle-update-5.output.md
#	unison-src/transcripts/delete.output.md
#	unison-src/transcripts/diff-namespace.output.md
#	unison-src/transcripts/move-namespace.output.md
#	unison-src/transcripts/name-selection.output.md
#	unison-src/transcripts/names.output.md
#	unison-src/transcripts/namespace-dependencies.output.md
#	unison-src/transcripts/propagate.output.md
#	unison-src/transcripts/reflog.output.md
#	unison-src/transcripts/reset.output.md
#	unison-src/transcripts/tab-completion.output.md
#	unison-src/transcripts/transcript-parser-commands.output.md
2024-07-10 23:49:04 -04:00
Chris Penner
f382ef1aeb Attempt to fix up update.old 2024-07-10 15:10:19 -07:00
Greg Pfeil
bf442467a4
Merge remote-tracking branch 'upstream/trunk' into new-transcript-parser 2024-07-10 16:04:10 -06:00
Chris Penner
2f4e57d41b Fix Upgrade 2024-07-10 14:31:56 -07:00
Greg Pfeil
179b8d1bb7
Terminate API code blocks correctly
They were missing trailing newlines, so as you can see in the diff, some
transcripts had invalid output.
2024-07-10 14:09:11 -06:00
Greg Pfeil
0031542faf
Add a space before code block info strings
This is for consistency with the `cmark` style. Now the blocks we still
pretty-print ourselves will match the bulk of them that `cmark`
produces.
2024-07-10 13:56:07 -06:00
Greg Pfeil
9e2fa2bbe7
Replace transcript parser with cmark
We don’t need a very rich parser for transcripts, but we _do_ need to
reliably identify fenced code blocks, and that implies a number of
subtle cases. Using a polished CommonMark parser/printer handles those
subtleties for us.

I chose `cmark` for a few reasons:
- it’s a wrapper around `libcmark`, which is the reference
  implementation of CommonMark, so it should be correct;
- it provides both a parser and a printer (unlike MMark); and
- it is extremely fast (about 20x faster than MMark), so the fact that
  our home-rolled parser got to skip over everything that’s not a block
  isn’t an issue.).

This only _partially_ uses the `cmark` printer. I think it should use it
entirely, but for the cases where we do streaming output (processing UCM
commands, etc.) it’s a more involved change. So I think it should be
handled separately.
2024-07-10 13:26:19 -06:00
Chris Penner
fa6c59e68a Fix merge transcript 2024-07-10 10:54:15 -07:00
Chris Penner
67a41cdaf1 Docs and transcripts 2024-07-10 10:37:08 -07:00
Arya Irani
9b11d96cbb
Merge pull request #5177 from unisonweb/24-07-01-todo-merge-precondition-violations 2024-07-10 13:28:59 -04:00
Chris Penner
15431602ac Revive move-branch confirmations 2024-07-10 10:17:28 -07:00
Chris Penner
09ecc74ce0 Fix test build 2024-07-10 09:52:23 -07:00