1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 21:01:35 +03:00
Commit Graph

25756 Commits

Author SHA1 Message Date
Timothy Clem
c04d165a2b Merge branch 'master' into declaration-matching-improvement 2018-10-10 15:22:20 -07:00
Patrick Thomson
ea66d5323a Merge pull request #2203 from github/lts-upgrade-12.12
Upgrade to LTS 12.12.
2018-10-10 12:18:55 -04:00
Patrick Thomson
8549d70b77 Refactor: remove duplicate code in Analysis.Declaration
The family of functions that extracted a meaningful "identifier" for a
declaration contained a large amount of duplication, owing to
type-specific pattern-matching. Encapsulating this pattern-matching in
a Rule means we can go from six functions to one.
2018-10-10 12:17:10 -04:00
Patrick Thomson
c4561184ff Merge branch 'master' into lts-upgrade-12.12 2018-10-09 16:31:05 -04:00
Patrick Thomson
156f3f6dbc fix ansi-terminal 2018-10-09 15:38:52 -04:00
Timothy Clem
ad3ceb7ab3 Merge pull request #2198 from github/pair-down-symbols-output
Change up what Declarations we identify
2018-10-09 09:28:01 -07:00
Patrick Thomson
0ae629142a License revitalization. 2018-10-09 11:32:42 -04:00
Rob Rix
6ac9b657f0 Merge branch 'master' into pair-down-symbols-output 2018-10-09 10:45:03 -04:00
Patrick Thomson
989d38f27d Update to LTS 12.12.
The major bumps we get here are `algebraic-graphs` v0.2, which
contains a number of speed improvements, and the removal of the
`foundation` as a dependency.
2018-10-09 01:06:55 -04:00
Timothy Clem
ac70c565cc Change up what Declarations we identify 2018-10-05 09:54:57 -07:00
Timothy Clem
8a5e152790 Merge pull request #2196 from github/fix-pretty-range-instance
Fix Range's Show instance to assuage the pretty-printer.
2018-10-04 13:36:22 -07:00
Patrick Thomson
d9c9e6838e Merge branch 'master' into fix-pretty-range-instance 2018-10-04 15:57:54 -04:00
Patrick Thomson
932a613cf4 Merge pull request #2195 from github/ghci-slowness
Prevent slowdowns when pretty-printing in ghci.
2018-10-04 15:57:42 -04:00
Patrick Thomson
7746f7f006 Fix Range's Show instance to assuage the pretty-printer.
We use the `pretty-show` for pretty-printing Haskell values. This is a
convenient package in that it provides acceptably-good output without
having to define any extra instances of some `Pretty` class, and
we get nice colored output with `hscolour`.

It's not all skateboards and firecrackers, though. `pretty-show` uses
a predefined parser targeting the `Show` idioms in Haskell, and it
doesn't always do the thing we mean. For example, in #2192 we changed
the `Show` instance of `Range` to be a little more concise: a value of
shape `Range n m` is now printed as `[ n - m ]`. However, the
`pretty-show` parser sees that dash as Haskell's negate operator,
which is wrong, and leads to confused output from `ppShow` versus
`show`: the former prints out `[ n (-m) ]`, which is wrong.

There are three solutions we could pursue here, in increasing order of
practicality:

1. Dispense with `Show` entirely. There's an argument that we should
   never write our own `Show` instances, as this ensures that
   `read . show` is equivalent to `id`. If we want to examine values in
   the REPL, we should be using a `Pretty` typeclass from some
   library, and our `-interactive-print` function should operate on
   `Pretty` values rather than `Show`. This would mean we could elide
   a lot of generated `Show` instances, which is nice.
2. Keep our `Show` instances around, but move any custom
   instances to a `Pretty` class, and use a function that engages that
   class for our `-interactive-print` function.
3. Change the output of this `Show` instance to use something other
   than `-` for its separator.

Option 1 is the most principled, but also would require a lot of
legwork (though it might save us some compile time). Option 2 would be
more tolerable if we had `-XDerivingVia` or some easy way to use
`Show` as a `Pretty` instance. But both are unsatisfactory in light of
option 3, so I've changed the `-` to a `..`, which avoids all
lexer-related confusion.
2018-10-04 14:49:39 -04:00
Patrick Thomson
d56377aea9 Prevent slowdowns when pretty-printing in ghci.
Right now, when opening a shell with `script/ghci`, you can encounter
a tremendous slowdown by turning on pretty-printing (with `pretty`)
then printing any value (`[0..3]` should work).

This stems from the fact that our `.ghci` specifies the `prettyShow`
function, defined in Semantic.Util, as its `-interactive-print`
function. While this is a good choice of a pretty-printer, the fact
that it is in Util, a file which imports many modules and uses fancy
types, is not good: pretty-printing cannot begin until Util is
recompiled and linked in. This explains why benchmarking this slowdown
revealed nothing but `dlsym` calls: we thought it was due to linking
in the tree-sitter libraries, but it was actually waiting for Util to
compile and link in.

The fix is simple: define `prettyShow` in another module. This should
provide significant speedups to our developer workflow.
2018-10-04 14:38:36 -04:00
Rob Rix
4a3af9665a Merge pull request #2193 from github/charliesome/remove-alegbra
Remove unused bits from Data.Algebra
2018-10-02 09:01:50 -04:00
Charlie Somerville
a6138760a8 remove unused Subterm bits 2018-10-02 11:32:51 +10:00
Charlie Somerville
ef93c452c6 remove subtermValue and subtermAddress 2018-10-02 11:11:12 +10:00
Charlie Somerville
eda36d5331 remove collectingTerms 2018-10-02 11:05:40 +10:00
Charlie Somerville
db53ba16ec remove unused bits from Data.Algebra 2018-10-02 11:05:04 +10:00
Rob Rix
86c743a6c8 Merge pull request #2191 from github/first-order-closures
First-order closures
2018-09-27 14:05:12 -05:00
Rob Rix
27861df507 🔥 a redundant constraint. 2018-09-27 13:45:27 -05:00
Rob Rix
5c2dac35e8 Merge branch 'master' into first-order-closures 2018-09-27 13:37:25 -05:00
Timothy Clem
e33a7b9363 Merge pull request #2192 from github/record-bye-bye
Goodbye Data.Record 😢
2018-09-27 13:22:38 -05:00
Timothy Clem
35d77b505e Revert tableOfContentsBy removal of extra Maybe 2018-09-27 13:05:11 -05:00
Timothy Clem
6b40e59c1d No SplitDiff! 2018-09-27 13:04:51 -05:00
Rob Rix
40f47b45f0 Don’t shadow the name. 2018-09-27 13:03:50 -05:00
Rob Rix
e758b01725 🔥 a redundant TODO. 2018-09-27 13:02:50 -05:00
Timothy Clem
2d1a8cc7e7 Express this a bit more elegantly 2018-09-26 16:55:34 -05:00
Timothy Clem
caf23dcf39 const is a bit nicer 2018-09-26 16:55:13 -05:00
Timothy Clem
f7e721a3a0 Slightly more elegant expression of mark 2018-09-26 16:55:02 -05:00
Timothy Clem
44b8e9249a Align the things 2018-09-26 16:54:48 -05:00
Timothy Clem
aa034e41bc Refactor back to just Range 2018-09-26 14:26:56 -05:00
Timothy Clem
d6302cd687 Cleanup 2018-09-26 14:25:00 -05:00
Timothy Clem
c8dfe57a48 Remove Data.Record entirely 2018-09-26 14:05:29 -05:00
Timothy Clem
fdc8d5210a Custom Show for Range and Span 2018-09-26 13:56:20 -05:00
Timothy Clem
1913277e74 Replace the annotation necessary for toc
Includes span in Declaration, refactors toc functions to remove a layer of maybe
2018-09-26 13:54:16 -05:00
Timothy Clem
f6f556fb32 TOC is the only thing with a custom annotation right now 2018-09-25 17:09:43 -05:00
Rob Rix
891f238179 Merge branch 'master' into first-order-closures 2018-09-25 16:53:41 -05:00
Timothy Clem
a6ad3f7f59 Reduce usage of DiffAnnotation 2018-09-25 16:52:40 -05:00
Rob Rix
29f6438609 🔥 a commented-out import. 2018-09-25 16:42:13 -05:00
Rob Rix
eb5a241edd Ignore a warning about reducing duplication. 2018-09-25 16:41:50 -05:00
Rob Rix
086b3b5624 🔥 some unnecessary language extensions. 2018-09-25 16:40:07 -05:00
Rob Rix
0653832d9d Swap the order of the parameters to Value. 2018-09-25 16:38:05 -05:00
Timothy Clem
f040234cf0 Don't need this 2018-09-25 16:06:02 -05:00
Timothy Clem
810d47300c Annoying that we always have to decorate here... 2018-09-25 15:59:09 -05:00
Rob Rix
6affc61d26 The tests pass. That’s all that matters. 2018-09-25 15:17:06 -05:00
Rob Rix
2db44ac715 Fix the eval spec. 2018-09-25 14:41:57 -05:00
Timothy Clem
505c61959e This goes back to throwing now 2018-09-25 14:04:58 -05:00
Timothy Clem
0a971c4ec8 Docs and a type synonym 2018-09-25 14:00:50 -05:00