1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 01:42:43 +03:00
Commit Graph

17650 Commits

Author SHA1 Message Date
Timothy Clem
09e6046763 Be consistent with other responses 2018-11-10 09:40:19 -08:00
Timothy Clem
bc9f85fdef Catch errors for some diff outputs 2018-11-09 16:44:10 -08:00
Timothy Clem
b964324d09 Only stat errors once per path 2018-11-09 13:18:46 -08:00
Josh Vera
0edad11aef Merge branch 'master' into streamline-toc-summaries 2018-11-08 11:59:56 -05:00
Timothy Clem
57f284f847 Streamline the declarations for toc summaries 2018-11-08 08:33:26 -08:00
Josh Vera
ebb380f427 Merge branch 'master' into add-explicit-assignment-timeout 2018-11-08 11:18:02 -05:00
Rick Winfrey
6e934d83d9 Merge branch 'master' into add-explicit-assignment-timeout 2018-11-07 13:49:02 -08:00
Timothy Clem
8c0dd6d3b5 Just return the first line if function defs span multiple lines 2018-11-07 11:48:50 -08:00
Timothy Clem
24544863f7 Handle comments inside of selectorExpressions in Go 2018-11-06 13:36:24 -08:00
Timothy Clem
343289f1c5 Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-06 09:17:49 -08:00
Timothy Clem
a297d15f47 Fix for comments in expressions with python assignment changes 2018-11-06 08:01:33 -08:00
Patrick Thomson
bdc5db555b rename and prune 2018-11-05 16:56:49 -05:00
Timothy Clem
bdb7ee0430 More tests 2018-11-05 13:09:37 -08:00
Timothy Clem
67724b2812 Take annotation from first item in list for snippets 2018-11-05 12:33:14 -08:00
Timothy Clem
7169685d06 Always use a wrapping list for python functions and classes 2018-11-05 12:32:46 -08:00
Timothy Clem
11c145589c Give class a custom Declarations1 instance 2018-11-05 09:27:41 -08:00
Patrick Thomson
15f5319252 fix stray indent 2018-11-05 12:17:05 -05:00
Patrick Thomson
76f0ef7f38 Merge remote-tracking branch 'origin/master' into revisit-matching 2018-11-05 11:07:49 -05:00
Patrick Thomson
688219e380 Arrow instance, why not 2018-11-05 11:06:59 -05:00
Timothy Clem
fa60a394b4 Fully commit to new method of generating symbols 2018-11-05 08:03:09 -08:00
Timothy Clem
0cacdd84d0 Helps the warnings 2018-11-05 07:57:14 -08:00
Rob Rix
3cb4fc5711 Use pure instead of return & 🔥 the annotation. 2018-11-05 09:53:17 -05:00
Rob Rix
2ee79706e3 Whitelist attemptUnsafeArithmetic in the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
68d87314ce Move the reduce duplication annotation into the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
4f92337221 Move the ignore use . annotation into the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
1e5920e318 Move the ignore eta reduce thing into the hlint config. 2018-11-05 09:51:04 -05:00
Rob Rix
fe9f0b0aeb 🔥 a redundant hlint annotation. 2018-11-05 09:49:34 -05:00
Patrick Thomson
292a268b00 better name for infix operator 2018-11-04 14:46:19 -05:00
Patrick Thomson
a84b25ad6e remove Data.Algebra import 2018-11-04 14:39:38 -05:00
Patrick Thomson
8e4f9ea119 better docs 2018-11-02 19:43:12 -04:00
Patrick Thomson
7ea52dbfe3 Give Control.Matching API better ergonomics.
Given that @tclem and I have found the matcher API frustrating, I've
taken a stab at improving its ergonomics, and I've found some success
in separating composition of matchers from predicate-based narrowing
thereof.

The biggest change here is the elimination of the old `match`
combinator, which proved to be clumsy in that it complected narrowing
and composition. Top-down matching combinators are now written with
the `need` combinator and the `>>>` combinator, which is more readable
and more versatile. Here's a matcher that accepts functions with
Python docstrings:

```haskell
docstringMatcher :: ( Decl.Function :< fs
                    , [] :< fs
                    , Lit.TextElement :< fs
                    , term ~ Term (Sum fs) ann
                    ) => Matcher term term
docstringMatcher = target <*
               (need Decl.functionBody
                >>> narrow @[]
                >>> mhead
                >>> narrow @Lit.TextElement
                >>> ensure Lit.isTripleQuoted))
```

Pretty readable, right? Each step of the tree regular expression -
choosing function bodies, ensuring said bodies are lists, examining
the first element, and choosing only TextElements containing
triple-quoted strings - is made implicit. The old way would have
looked something like this:

```haskell
docstringMatcher = target <* match Decl.functionBody
                           $ narrow
                           $ matchM listToMaybe
                           $ target <* ensure Lit.isTripleQuoted
```
which is a good deal more disorganized and less flexible
in the quite-common case of applying functions during a
matching pass. Separating the act of composition from
function application is a big win here.

Further comments are inline.
2018-11-02 19:25:29 -04:00
Timothy Clem
8d12b5c242 Fix declarations to make tests pass 2018-11-02 13:55:55 -07:00
Timothy Clem
5b9b0daee3 Helper for testing ruby tags 2018-11-02 13:55:46 -07:00
Timothy Clem
bf90ef8e45 Did this 2018-11-02 13:54:55 -07:00
Timothy Clem
223298b86a Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-02 12:54:21 -07:00
Timothy Clem
018dc73af9 Python assignment: conditionally include annotation on functions 2018-11-02 12:39:38 -07:00
Timothy Clem
a87c526977 No errors, just keep trying 2018-11-02 12:30:43 -07:00
Patrick Thomson
b4a469c706 Merge branch 'master' into add-tsparse-quiet-flag 2018-11-02 13:07:58 -04:00
Patrick Thomson
0a117222c1 Merge branch 'master' into add-explicit-assignment-timeout 2018-11-02 11:10:09 -04:00
Patrick Thomson
b9a742e6db address @rewinfrey's suggestion 2018-11-02 11:03:57 -04:00
Patrick Thomson
a62840c58d Be commensurate with parse --quiet 2018-11-02 11:00:09 -04:00
Patrick Thomson
bd51a186e7 Merge remote-tracking branch 'origin/master' into add-tsparse-quiet-flag 2018-11-02 09:16:28 -04:00
Josh Vera
9f22607fc0 Merge branch 'master' into diff-via-fused-effects 2018-11-01 22:21:46 -04:00
Timothy Clem
55787183b9 Use evalState 2018-11-01 17:40:58 -07:00
Timothy Clem
12a4fc5073 Turn this on for classes and Modules 2018-11-01 17:40:49 -07:00
Timothy Clem
d26cd0bf1a No need for State in this fold 2018-11-01 17:16:34 -07:00
Timothy Clem
63e13ee20c Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-01 16:04:15 -07:00
Timothy Clem
02c9074b7e Format, hide lang 2018-11-01 16:03:12 -07:00
Timothy Clem
92f9f8373e Render to same output format, respecting field choice 2018-11-01 15:48:47 -07:00
Timothy Clem
806c5c417b Include a place for span 2018-11-01 15:48:35 -07:00