Commit Graph

125 Commits

Author SHA1 Message Date
Chris Penner
611cef1011 Failing effect list annotation tests 2023-02-01 11:01:46 -06:00
Chris Penner
59e8a25693
Fix annotations for bindings and blocks (#3689)
* WIP: fix up anns for bindings, blocks, etc.

* Working annotations for lets

* Add nesting tests

* Fix nesting tests

* Fix annotations on let-rec blocks

* Fix bad test src

* Skip destructuring binds test for now.

* Remove debugging

* Better fallbacks for finding ref nodes

* Transcript updates

* Fix bad 'contains'

* Rewrite letrec and let combinators to avoid requiring semigroup

* Don't include block openers in the block itself.

We don't want things like '=' or '->' to be part of a block

* Re-run transcripts

* Remove redundant constraint
2023-01-10 11:12:51 -06:00
Chris Penner
84f36ff4a8
Parse share handles separate from name segments (#3704)
* Parse share handles with `-` in them
2023-01-09 08:42:44 -06:00
Mitchell Rosen
f971d8c41d ⅄ trunk → 22-12-09-break-up-unison-util 2022-12-13 14:05:22 -05:00
Mitchell Rosen
11226cc2c3 rename Unison.Util.Text back to U.Util.Text due to name conflict 2022-12-09 12:43:03 -05:00
Mitchell Rosen
d0c7206532 move U.Util.Text from unison-util to unison-prelude
also delete U.Util.String, because it was only used once, and
U.Util.Text is fine there
2022-12-09 12:36:28 -05:00
Chris Penner
b45b07ae93
Include LHS of binary exprs in annotation (#3640)
* Include LHS of binary exprs in annotation

* Add combinators from Hover branch for testing

* Finish adding LSP annotation tests

* Fix custom op lhs annotations
2022-12-05 09:56:57 -06:00
Chris Penner
fe5892ed06 Remove irrelevant tests for now 2022-12-01 13:57:31 -06:00
Chris Penner
c208d9ad05 don't strip type signatures from terms, even if redundant 2022-11-30 13:50:19 -06:00
Chris Penner
ade9690a71 Fix custom op lhs annotations 2022-11-29 14:03:12 -06:00
Chris Penner
e8623418cc Finish adding LSP annotation tests 2022-11-29 13:20:24 -06:00
Chris Penner
7cce2c77cd Add combinators from Hover branch for testing 2022-11-29 11:56:16 -06:00
mergify[bot]
6b91db24f4
Merge pull request #3619 from unisonweb/travis/codebase-root-branch-cache-bugs
Fix codebase root branch cache bugs
2022-11-28 20:27:58 +00:00
Travis Staton
fafc3280c9 Prevent opening two ucm processes against the same codebase
optionally obtain file lock on sqlite when opening a codebase
2022-11-18 16:32:06 -05:00
Mitchell Rosen
19c4401a44 make tests compile 2022-11-09 18:37:45 +05:30
Mitchell Rosen
5ab44f8746 make tests compile 2022-11-07 20:46:15 +05:30
Mitchell Rosen
95958a1845 get test compiling 2022-11-05 12:14:47 +05:30
Mitchell Rosen
6abfb8d641 sbh -> sch 2022-11-01 07:56:11 +05:30
Chris Penner
16424b3f25 ShortBranchHash -> ShortCausalHash 2022-10-31 16:07:18 -06:00
Mitchell Rosen
7a59244dbb amend test 2022-10-14 15:14:08 -04:00
Mitchell Rosen
b6ad66f27c add a test demonstrating that label works 2022-10-14 14:12:06 -04:00
Chris Penner
a309ec0f13
Pull base from the most recent major milestone (#3438)
* Pull base from the most recent major milestone

* Fixup
2022-09-22 15:35:23 -06:00
Chris Penner
d8ebfc7d57 Fix tests 2022-09-12 16:18:17 -06:00
Chris Penner
8696fef129
Tab completion speedup (#3312)
* Working and fast prefix-based tab complete

* Re-arrange completion modules

* Hash completion for conflicted terms

* Sort Completions

* Remove fuzzy matcher for now

* Remove 'Branch' from suggestion signature

* Add ability to test completions in transcripts

* Use explicit lax-path query parser
2022-08-16 15:01:46 -06:00
Arya Irani
cb56814e16 and update tests 2022-07-14 14:57:43 -04:00
Chris Penner
79aa93fd22 latest -> main 2022-07-08 13:47:30 -06:00
Chris Penner
e60f12ab4f Fix base-pull location 2022-07-08 12:11:32 -06:00
Chris Penner
ea143517e5
Don't auto-login on pulling public routes; pull base from share (#3139)
* Don't auto-login on pulling public routes.

* Update base version parser

* Fix version parser tests

* Don't print error on unauthenticated requests,

need to wait to see if the server 401's first.

* Update unison-cli/src/Unison/Codebase/Editor/HandleInput.hs

Co-authored-by: Mitchell Rosen <mitchellwrosen@gmail.com>

* out of date comment

Co-authored-by: Mitchell Rosen <mitchellwrosen@gmail.com>
2022-06-21 11:09:16 -06:00
Chris Penner
18266a13a8
Update input patterns and unisonConfig for Share paths. (#3080)
* Clean up docs and parsers for read/write remote namespaces for share

* Revive deprecated git parser so old unisonConfig's still work

* Don't hide git errors

* Fix CodeserverURI -> URI conversion

* Reflect the provided port in CodeserverURI

* Focus messaging around primary action
2022-06-03 15:31:43 -06:00
Chris Penner
8558dacb36 Maybe fix windows failures? 2022-06-03 14:56:11 -06:00
Arya Irani
bb254c00a1 fix up tests 2022-05-27 16:42:25 -04:00
Arya Irani
63fc75416c Merge remote-tracking branch 'origin/trunk' into arya/ooo-sync
# Conflicts:
#	codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs
#	parser-typechecker/package.yaml
#	parser-typechecker/src/Unison/Codebase.hs
#	parser-typechecker/src/Unison/Codebase/SqliteCodebase.hs
#	parser-typechecker/src/Unison/Codebase/SqliteCodebase/Migrations/MigrateSchema3To4.hs
#	unison-cli/src/Unison/Codebase/Editor/Command.hs
#	unison-cli/src/Unison/Codebase/Editor/HandleCommand.hs
#	unison-cli/src/Unison/Codebase/Editor/Output.hs
#	unison-cli/src/Unison/Codebase/Editor/VersionParser.hs
#	unison-cli/src/Unison/CommandLine/OutputMessages.hs
2022-05-27 13:49:34 -04:00
Chris Penner
5bf8f1c204
Causal hash/branch hash cleanup migration (#3073)
* Rename Branch.Hash -> Branch.CausalHash for clarity.

* WIP simplifying types for Causals and hashes

* Single type for causal hashes.

* Remove vestigial function

* Clean up some rogue hashes

* Formatting

* Fix tests

* Add namespace hash migration

* Cleanup

* Finish writing migration for bad branches, add some sanity checks too.

* Keep hash_object mappings up to date.

* Working migration

* More checks

* Dependency-order migration WIP

* Finish first draft of crawled migration strategy

* Improve speed and reliability of migration.

* Better migration logging

* Perform integrity checks once after all migrations are done.

* Considerably speed up migration by only re-hashing branches which have
the same causal hash as value hash.

* Clarify migration docs

* Move 'differing causal value hash' check to integrity checks

* Bump schema version for new codebases

* PR cleanup

* Remove commented out migration

* PR feedback cleanup

* Add integrity check for hash_objects.

* Correctly set 'changes' key

* Don't check hash object integrity in migrations

Some codebases (like mine) are borked in this area and we'll need to fix
them later on.

* Correct final migration number

* Check namespace hash even if branch has no children

* Rehash every branch regardless

* Use v4 of base.
2022-05-26 16:20:38 -06:00
Arya Irani
37add698d1 plumb new repo types 2022-05-17 18:45:06 -04:00
Chris Penner
8e65b79f5e format with new ormolu 2022-02-28 15:52:25 -06:00
Chris Penner
fa7a20b92c Remove ORMOLU_DISABLE 2022-02-28 15:41:59 -06:00
Chris Penner
abac49bb71
Merge pull request #2948 from unisonweb/cp/transcript-api
Run transcripts using Haskell API rather than shelling out
2022-02-28 13:35:21 -06:00
Chris Penner
3bb1c07e1c
Use v3 branch instead of v2 for less confusion (#2951) 2022-02-25 16:57:27 -05:00
Chris Penner
02ac5a32da Replace writeFile with writeUtf8 2022-02-24 15:23:05 -06:00
Chris Penner
0ceddd5000 Use Haskell API to run transcripts
Trunk currently runs all of the transcripts by shelling out to the unison cli, this causes two problems:

* It's slow to boot up a fresh ucm for every transcript
* On Windows, we're likely to encounter [this bug](https://github.com/commercialhaskell/stack/issues/5038) which comes up when using `readProcess`, I'm noticing when I run transcripts on windows it inserts a ton of `++stty: 'standard input': Inappropriate ioctl for device` into output files.

As far as speedup goes, a quick benchmark on non-optimized builds shaves off ~90 seconds!

```
New version
/usr/bin/time stack exec transcripts
      103.79 real       153.25 user        89.79 sys

/usr/bin/time stack exec transcripts
      193.79 real       183.08 user         6.97 sys
```

Implementation notes

* Define `withTranscriptRunner`, which does a single initialization and then provides a transcript runner to the provided action. The caller can run any number of transcripts without re-initializing the runtime.
* Rather than crash the with an `exit 1` on failure and then detect that exit code, we return an Either which can be handled as a test failure.
2022-02-24 14:51:57 -06:00
Arya Irani
f77ec97cb2 replace removeDirectoryRecursive with removePathForcibly
in case that helps #2924

also replaces `"rm" $|` with the same.
2022-02-18 22:08:33 -07:00
Arya Irani
87e58af9c5 switch to Windows code page 65001 in exe:unison and exe:tests
I think it's only needed in these two spots, as the other
executables just shell out to `stack exec unison`.

I'm not actually clear on how this interacts with (or could be replaced by `hSetEncoding`, which we do have sprinkled around already, but not sufficiently to let Windows builds work.

If there's a cleaner solution, I'd like to use it. i.e. am I papering over a more correct multi-platform fix by using the Windows-only System.IO.Codepage?
2022-02-17 15:55:30 -07:00
Chris Penner
8334fbd970 Allow pushing to v2 codebases 2022-02-16 13:52:18 -06:00
Chris Penner
094f71b709
Use 'v2' branch for auto-pull of base on topic/rehash-codebase (#2902)
* Use 'v2' branch of base to avoid needing to migrate base on every pull.

This also allows us to keep v1 and v2 versions of base around during the
transition period.

* Fix version parsing tests.

Co-authored-by: Arya Irani <538571+aryairani@users.noreply.github.com>
2022-02-15 10:41:14 -06:00
Chris Penner
99912bfb1a Merge branch 'trunk' into topic/rehash-codebase 2022-02-09 11:44:08 -06:00
Chris Penner
69db163bcb Allow pushing/pulling to git branches. 2022-02-09 09:27:18 -06:00
Mitchell Rosen
f430921b12 ⅄ trunk → topic/rehash-codebase 2022-01-24 12:43:11 -05:00
Chris Penner
c3c5d69ac3 Fix hashes in gitsync tests 2022-01-21 15:07:05 -06:00
Chris Penner
5809a9f321 Add test asserting that local changes are wiped out when there's changes on the remote 2022-01-19 11:41:38 -06:00
Chris Penner
bfd4669d02 Remove one-term test
It depends on a hash, but doesn't clarify what it's testing, and the
test after it seems to be accomplishing a similar thing in a more robust
way.
2022-01-06 14:36:40 -06:00
Chris Penner
f9bfaa6943 Add local state persistence tests. 2021-12-21 11:42:51 -06:00
Mitchell Rosen
209ced0fc0 fix gitsync22.sc.history 2021-12-14 14:47:05 -05:00
Mitchell Rosen
3563a47d05 fix gitsync22.sc.gist 2021-12-14 14:41:12 -05:00
Mitchell Rosen
fb022ab855 fix gitsync22.sc.one-term 2021-12-14 14:34:46 -05:00
Chris Penner
9c225cb08d Merge branch 'trunk' into topic/rehash-codebase-merge-trunk 2021-12-14 12:40:18 -06:00
Mitchell Rosen
ceb1692a53
Merge pull request #2708 from unisonweb/21-11-30-unknown-schema-ver
Fix open local codebase logic to handle unknown schema case
2021-12-11 00:28:07 -05:00
Chris Penner
dafa094ad0 Test that we can successfully pull.without-history 2021-12-09 15:14:55 -06:00
Mitchell Rosen
76fac4f811 fix compiler errors in test 2021-12-07 11:49:55 -05:00
Chris Penner
3155ef9cec Add GitSync tests for pushing/pulling with deleted namespaces 2021-12-06 16:01:13 -06:00
Chris Penner
c69048e5e3 Merge branch 'trunk' into cp/order-branch-modifications-1552 2021-12-01 15:15:28 -06:00
Chris Penner
7ce4d3b479 Merge branch 'trunk' into topic/rehash-codebase 2021-11-29 16:48:09 -06:00
Chris Penner
fe0a197f3d Merge branch 'trunk' into cp/order-branch-modifications-1552 2021-11-29 11:31:36 -06:00
Chris Penner
338b945acd Merge branch 'trunk' into cp/ensure-codebase-closes 2021-11-29 11:02:19 -06:00
Mitchell Rosen
1be6574d28
Merge pull request #2657 from unisonweb/21-11-12-gist
Add gist command (fixes #2603)
2021-11-28 12:13:13 -05:00
Chris Penner
9c14f44078 Merge branch 'trunk' into cp/order-branch-modifications-1552 2021-11-24 15:17:02 -06:00
Chris Penner
3771a03ab1 Don't save gitsync transcripts anymore 2021-11-23 15:53:18 -06:00
Chris Penner
9744b3d9a8 Update transcripts 2021-11-23 15:47:13 -06:00
Chris Penner
f8b39a7744 Re-enable ORMOLU on properly formatted files 2021-11-23 12:10:59 -06:00
Chris Penner
54d6fbf1bd Add ORMOLU_DISABLE to every file.
This allows all developers to add ormolu autoformat on save in their
editors without worrying about creating huge diffs on files that haven't
been formatted yet.

If you format a file, remove the DISABLE comment to ensure it stays
formatted in the future.
2021-11-23 12:10:58 -06:00
Mitchell Rosen
feef9dbd5a add gist transcript test 2021-11-23 11:55:36 -05:00
Chris Penner
bfd8fe6d51 Get unison-cli tests building 2021-11-22 15:30:41 -06:00
Chris Penner
30dfd3df50 Update hash embedded in gitsync tests 2021-11-19 14:27:09 -06:00
Arya Irani
14489cc2ed Merge remote-tracking branch 'origin/trunk' into topic/rehash-codebase
# Conflicts:
#	parser-typechecker/src/Unison/Codebase/Editor/HandleInput.hs
#	parser-typechecker/src/Unison/CommandLine/OutputMessages.hs
#	parser-typechecker/src/Unison/PrettyPrintEnv.hs
#	unison-src/transcripts/merges.output.md
#	unison-src/transcripts/reflog.output.md
#	unison-src/transcripts/squash.output.md
2021-11-11 12:06:00 -05:00
Mitchell Rosen
4ad8c385f7 ⅄ trunk → 21-11-02-push-create 2021-11-06 13:38:24 -04:00
Mitchell Rosen
d46bdcbf3e move many ucm-related modules into unison-cli library component 2021-11-05 00:40:50 -04:00