1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 05:41:54 +03:00
Commit Graph

19859 Commits

Author SHA1 Message Date
Rob Rix
220c6dd133
Rename the Declaration fields. 2019-10-16 18:42:57 -04:00
Rob Rix
b99dc6ad23
Unpack DedupeKey. 2019-10-16 18:41:10 -04:00
Rob Rix
9dbb019833
🔥 findSimilarBy. 2019-10-16 18:39:32 -04:00
Rob Rix
a98588bf29
Don’t recompute the key. 2019-10-16 18:39:07 -04:00
Rob Rix
f8a24c4c4d
Reformat. 2019-10-16 18:36:09 -04:00
Rob Rix
83a84e0d22
Alignment. 2019-10-16 18:35:52 -04:00
Rob Rix
a0fbf8433e
🔥 redundant parens. 2019-10-16 18:35:36 -04:00
Rob Rix
fe1de046b0
findSimilar returns just the similar Declaration. 2019-10-16 18:35:00 -04:00
Rob Rix
8519e25b26
Call entryChange from recordSummary. 2019-10-16 18:30:56 -04:00
Rob Rix
94099aad8f
Don’t prefix the Dedupe fields. 2019-10-16 18:29:47 -04:00
Rob Rix
c94e53adf9
Don’t repack Dedupe when we don’t have to. 2019-10-16 18:28:11 -04:00
Rob Rix
ca4247d6af
🔥 the signature for go. 2019-10-16 18:27:18 -04:00
Rob Rix
b2bbe03e85
Map the entries into Dedupe. 2019-10-16 18:27:05 -04:00
Rob Rix
b3e49380c7
Use strict triples in the maps. 2019-10-16 18:26:10 -04:00
Rob Rix
978b406be2
Don’t match the index & entry. 2019-10-16 18:20:57 -04:00
Rob Rix
8b4c045e0d
Define go as a case expression. 2019-10-16 18:19:32 -04:00
Rob Rix
f366d4519d
Extract a helper to find a similar entry. 2019-10-16 18:16:59 -04:00
Rob Rix
444f0b306c
Index the elements, not the fold. 2019-10-16 18:15:37 -04:00
Rob Rix
ce0866dc1b
Uncurry go. 2019-10-16 18:14:27 -04:00
Rob Rix
2523d60b2c
Rename similarDecl to similar. 2019-10-16 18:13:14 -04:00
Rob Rix
fba58c685f
🔥 termTableOfContentsBy. 2019-10-16 18:12:40 -04:00
Rob Rix
e084c83b7f
Alignment. 2019-10-16 18:11:24 -04:00
Rob Rix
203ea9c954
Define recordSummary using guards. 2019-10-16 18:05:51 -04:00
Rob Rix
73713125cd
Extract formatIdentifier to the top level. 2019-10-16 18:04:08 -04:00
Rob Rix
be95b43b71
Reformat formatIdentifier. 2019-10-16 18:03:13 -04:00
Rob Rix
a0d9f57239
Pattern match in dedupeKey. 2019-10-16 18:00:52 -04:00
Rob Rix
ab0781c07a
Factor Declaration into a kind and the rest of the fields. 2019-10-16 18:00:05 -04:00
Rob Rix
10e82079b9
🔥 the Generic instance for Declaration. 2019-10-16 17:54:48 -04:00
Rob Rix
3a3145050c
Spacing. 2019-10-16 17:45:27 -04:00
Rob Rix
6f7683c9a7
🔥 redundant parens. 2019-10-16 17:45:17 -04:00
Rob Rix
483e6b2f2c
Curry go. 2019-10-16 17:42:13 -04:00
Rob Rix
50638e0205
Factor out the tuple. 2019-10-16 17:40:57 -04:00
Rob Rix
bfec2ffa45
Reformat go. 2019-10-16 17:40:20 -04:00
Rob Rix
582d516bf4
Inline tuples. 2019-10-16 17:39:21 -04:00
Rob Rix
a488ec2d9f
Compose. 2019-10-16 17:39:08 -04:00
Rob Rix
a2348e3463
Monomorphize. 2019-10-16 17:38:41 -04:00
Rob Rix
b54d109311
Move tuples into the where clause. 2019-10-16 17:35:46 -04:00
Rob Rix
70414495f5
🔥 exactMatch. 2019-10-16 17:35:17 -04:00
Rob Rix
d9505164fb
Match the decl explicitly. 2019-10-16 17:34:40 -04:00
Rob Rix
bf8f03ce37
🔥 a let. 2019-10-16 17:33:43 -04:00
Rob Rix
6ced7e6fae
dedupeKey takes the second field only. 2019-10-16 17:32:14 -04:00
Rob Rix
aa98934d85
Split the entry change type logic out of recordSummary. 2019-10-16 17:29:58 -04:00
Rob Rix
fb41c1741e
🔥 the export of entrySummary. 2019-10-16 17:29:35 -04:00
Rob Rix
0246a2e130
Align. 2019-10-16 17:26:32 -04:00
Rob Rix
6fe1467956
Monomorphize. 2019-10-16 17:26:10 -04:00
Rob Rix
d8dc9b7d25
Split Entry up into an enum in a tuple. 2019-10-16 17:25:30 -04:00
Patrick Thomson
ba122b2aae Bump lingo to 0.3 and remove hack associated with #333.
Now that lingo's language detection returns all possible results for a
given filename, we're able to abolish the workaround where we parsed
the string `"Hack"` into PHP. We have to check ourselves for spurious
results associated with Hack, TSX, and Markdown files, but that's
fitting and proper, rather than doing it behind the scenes in lingo.
2019-10-14 15:55:48 -04:00
Patrick Thomson
df96f43acd Make findFilesInDir use pathtype. 2019-10-11 19:24:53 -04:00
Patrick Thomson
78d7ba126b Make languageForFilePath work for .php files.
As reported in #330, we're currently dying in `languageForFilePath`
because `lingo` is giving us back Hack when we expect PHP. This is a
pretty bad bug, so here's a temporary workaround for the issue. Once
https://github.com/tclem/lingo-haskell/issues/3 is fixed, we can
remove this workaround.

Fixes #330.
2019-10-11 12:16:17 -04:00
Rick Winfrey
e07d63f284 Java as code nav language; update javaParser 2019-10-09 12:56:50 -07:00
Patrick Thomson
c12eca0c00 Pathtype comes with a shim for withBinaryFile. 2019-10-08 18:57:28 -04:00
Patrick Thomson
4110353b63 Make the -o option demand a file path.
You can test this like so:

```
cabal run semantic -- -o /tmp/blah/ parse --json --gitDir .git --sha HEAD
option -o: "/tmp/blah/" is not a valid file path
```

This would previously fail at runtime with a less informative error message:

```
/tmp/blah/: openBinaryFile: inappropriate type (Not a directory)
```
2019-10-08 18:52:28 -04:00
Patrick Thomson
d998c40043
Merge branch 'master' into 🔥-ts-parse 2019-10-08 18:28:03 -04:00
Patrick Thomson
3e65913d27 Fix a build error. 2019-10-08 18:24:36 -04:00
Rob Rix
e57359a8bf
Merge branch 'master' into 🔥-ts-parse 2019-10-08 18:00:56 -04:00
Patrick Thomson
2036569a09
Merge pull request #312 from github/remove-shelly
Remove shelly in favor of streaming-bytestring and utf8-string.
2019-10-08 17:58:59 -04:00
Rob Rix
2291e0c97d
Merge branch 'precise-json' into 🔥-ts-parse 2019-10-08 17:37:29 -04:00
Patrick Thomson
8368950c03
Merge branch 'master' into remove-shelly 2019-10-08 16:52:07 -04:00
Rob Rix
b053774ede
Merge branch 'remove-reprinter-and-rewriter' into precise-json 2019-10-08 16:32:19 -04:00
Patrick Thomson
eabfd53284 Redundant import. 2019-10-08 15:50:26 -04:00
Patrick Thomson
df9e272419 Some Evaluatable instances got nuked. 2019-10-08 15:50:07 -04:00
Patrick Thomson
3b4b9dc95e fix stray typo and remove spec invocations 2019-10-08 15:02:33 -04:00
Patrick Thomson
693c317bf0 Remove experimental reprinting and rewriting facilities.
As we shift to a precise, non-DTALC representation of language syntax,
the foundations upon which our (experimental) reprinting and rewriting
framework are becoming questionable. These experiments are not hooked
up anywhere (except the tests), constitute a considerable amount of
code, and are getting in the way of @robrix and myself lately.

I like a lot of this code, but if we're not using it, it's our moral
imperative to delete it, if only to reduce the carbon emissions
associated with our CI builds. We can always rescuscitate it from the
git history if we find ourselves wanting it back.
2019-10-08 14:41:31 -04:00
Rob Rix
bacb523b7f
Use the AST synonym in the type of MarkdownParser. 2019-10-07 14:40:09 -04:00
Rob Rix
a457d8777f
Use the AST synonym in the type of AssignmentParser. 2019-10-07 14:39:39 -04:00
Rob Rix
c01e8314ff
🔥 the various *ASTParsers. 2019-10-07 14:37:53 -04:00
Rob Rix
3cad826597
🔥 SomeASTParser. 2019-10-07 14:35:49 -04:00
Rob Rix
a21afc0e1b
🔥 Semantic.AST. 2019-10-07 14:35:05 -04:00
Rob Rix
c25cac9531
🔥 tsParseCommand. 2019-10-07 14:34:07 -04:00
Rob Rix
2f6d485205
Get tree_sitter_python from semantic-python for the precise parser.
It’s the same symbol, but will ease breaking the dependency when we 🔥 à la carte Python.
2019-10-07 14:22:28 -04:00
Rob Rix
223007c508
Get tree_sitter_java from Language.Java. 2019-10-07 14:18:46 -04:00
Rob Rix
bb898a34e6
Get tree_sitter_json from Language.JSON. 2019-10-07 14:13:30 -04:00
Patrick Thomson
edb2e1c155 Stylish. 2019-10-07 12:37:58 -04:00
Patrick Thomson
cc9d398947 Small cleanup on lsTree. 2019-10-07 12:34:47 -04:00
Patrick Thomson
fe7301575c Remove shelly in favor of streaming-bytestring and utf8-string. 2019-10-07 12:29:42 -04:00
Rob Rix
17c70240d4
🔥 Assigning.Assignment.Deterministic. 2019-10-07 11:56:00 -04:00
Rob Rix
f4da0a8db4
🔥 DeterministicParser. 2019-10-07 11:55:21 -04:00
Rob Rix
6b4b5011aa
🔥 Language>JSON.Assignment. 2019-10-07 11:42:01 -04:00
Rob Rix
6f9d49fef8
🔥 jsonParser. 2019-10-07 11:13:42 -04:00
Rob Rix
058aab0417
🔥 jsonASTParser. 2019-10-07 11:13:36 -04:00
Rob Rix
47020db964
Drop support for JSON from someASTParser. 2019-10-07 11:12:08 -04:00
Rob Rix
a87b91d9a4
🔥 jsonParserALaCarte'. 2019-10-07 11:10:56 -04:00
Rob Rix
190abe1af5
Simplify aLaCarteParsers to exclude à la carte JSON. 2019-10-07 11:10:22 -04:00
Rob Rix
4743e4e595
Simplify allParsers to exclude à la carte JSON. 2019-10-07 11:10:10 -04:00
Rob Rix
ac961fb945
🔥 modeForLanguage. 2019-10-07 11:07:52 -04:00
Rob Rix
9568ff6f2d
JSON defaults to precise.
This isn’t actually all that useful, but for completeness’ sake.
2019-10-07 11:06:32 -04:00
Rob Rix
734c365674
Add precise JSON to allParsers. 2019-10-07 11:05:49 -04:00
Rob Rix
656f1e187e
Define a ToTags instance for JSON terms. 2019-10-07 11:05:28 -04:00
Rob Rix
8a3fd7ef67
Alphabetize. 2019-10-07 11:04:56 -04:00
Rob Rix
ed17dcbeea
Define an SExprTerm instance for precise JSON. 2019-10-07 10:57:17 -04:00
Rob Rix
4f6e91a128
Define a ShowTerm instance for precise JSON. 2019-10-07 10:57:02 -04:00
Rob Rix
a4ed7de6f0
🔥 a redundant -fno-warn-orphans. 2019-10-07 10:51:50 -04:00
Rob Rix
53803071b0
Rename jsonParser' to jsonParserALaCarte. 2019-10-07 10:48:51 -04:00
Rob Rix
e5e9228f56
Export jsonParserPrecise'. 2019-10-07 10:42:52 -04:00
Rob Rix
f4212d2c6e
Add a precise JSON parser. 2019-10-07 10:40:52 -04:00
Rob Rix
56956198fa
Fix an overlooked case. 2019-10-07 10:40:30 -04:00
Rob Rix
20bc736250
Fix a renamed rule. 2019-10-07 10:40:11 -04:00
Rob Rix
1ec330fbe4
Annotate the kind of ToSExpression. 2019-10-07 09:17:30 -04:00
Rob Rix
57826de7a0
Merge branch 'semantic-java' into precise-s-expressions 2019-10-07 09:16:33 -04:00
Rob Rix
a9abd08f5c
Merge branch 'master' into semantic-java 2019-10-07 09:10:20 -04:00
Rick Winfrey
4729b5e677 Remove Haskell language modules for now 2019-10-04 15:00:58 -07:00
Patrick Thomson
e5841eb473 Squash warnings. 2019-10-04 15:49:34 -04:00
Patrick Thomson
4684e3a798 Overhaul catFile. 2019-10-04 12:39:13 -04:00
Rob Rix
2791018ce0
Merge remote-tracking branch 'origin/semantic-java' into precise-s-expressions 2019-10-03 14:26:53 -04:00
Rob Rix
4eb0e76bee
Use square brackets for collections. 2019-10-03 14:24:00 -04:00
Rob Rix
722f8d3a18
Special-case empty collections. 2019-10-03 14:22:46 -04:00
Rob Rix
9439145b2b
Increase indentation. 2019-10-03 14:21:02 -04:00
Rob Rix
67e2909b05
Simplify the formatting of compositions. 2019-10-03 14:17:29 -04:00
Rob Rix
546c1d0e64
List the imports explicitly. 2019-10-03 14:15:47 -04:00
Rob Rix
7b74525d2f
Specialize for the wrapper types and format accordingly. 2019-10-03 14:11:51 -04:00
Rob Rix
7dabb9a972
Use a list literal. 2019-10-03 13:50:47 -04:00
Rob Rix
70c309aaec
Tweak to alignment. 2019-10-03 13:43:21 -04:00
Rob Rix
90341c1138
Merge branch 'master' into semantic-java 2019-10-03 13:24:52 -04:00
Rob Rix
779b1154c6
Allow s-expr rendering for Java & precise Python. 2019-10-03 12:58:06 -04:00
Timothy Clem
f8c76b2329 Merge remote-tracking branch 'origin/master' into proto-lens 2019-10-03 09:48:06 -07:00
Rob Rix
88f9fc88c7
Define a SExprTerm instance for Precise python. 2019-10-03 12:47:18 -04:00
Rob Rix
b322d2674e
Define a SExprTerm instance for Java. 2019-10-03 12:47:10 -04:00
Rob Rix
4ffa6c4a26
sexprTerm is pure. 2019-10-03 12:46:03 -04:00
Rob Rix
e1a18eeb05
Bypass serialize and call into the s-expression serialization code directly. 2019-10-03 12:45:16 -04:00
Timothy Clem
32f6e9dfb9 ++proto-lens-jsonpb to handle excluding default fields 2019-10-03 08:41:30 -07:00
Rob Rix
867a65c575
Don’t print L1/R1. 2019-10-03 02:50:42 -04:00
Rob Rix
70b24a476d
Define a GToSExpression instance for :.:. 2019-10-03 02:42:08 -04:00
Rob Rix
feac508bb5
Update Precise.hs
Define a GToSExpression instance for Rec1.
2019-10-03 02:40:44 -04:00
Rob Rix
4b0ec75528
Define a GToSExpression instance for Par1. 2019-10-03 02:39:22 -04:00
Rob Rix
48cf558a72
Define ToSExpression at * -> *. 2019-10-03 02:38:01 -04:00
Rob Rix
310e3a36ee
Use ambiguous types instead of proxies. 2019-10-03 02:29:36 -04:00
Rob Rix
8e9fe4e58a
Rename toSExpressionWithStrategy to toSExpression'. 2019-10-03 02:28:59 -04:00
Rob Rix
09070aaf33
Rename ToSExpressionWithStrategy to ToSExpressionBy. 2019-10-03 02:28:32 -04:00
Rob Rix
14e8fd1c50
Merge branch 'master' into semantic-java 2019-10-02 20:51:14 -04:00
Rob Rix
54324a98a7
Merge branch 'master' into list-parsers-independently 2019-10-02 20:27:30 -04:00
Patrick Thomson
2231f7e749 Make runParse return an Either TSParseException. 2019-10-02 18:44:51 -04:00
Rob Rix
914f69add8
🔥 the à la carte Java stuff. 2019-10-02 18:02:50 -04:00
Rob Rix
150ce9b7f3
There isn’t any à la carte Java. 2019-10-02 18:01:31 -04:00
Rob Rix
30d11fe288
Merge branch 'list-parsers-independently' into semantic-java 2019-10-02 17:44:51 -04:00
Rob Rix
116e5b385a
Merge branch 'master' into semantic-java 2019-10-02 17:32:09 -04:00
Timothy Clem
54eb044136 Minor cleanup 2019-10-02 14:21:02 -07:00
Timothy Clem
5fbcca4fe4 Merge remote-tracking branch 'origin/master' into proto-lens 2019-10-02 13:49:32 -07:00
Timothy Clem
85bf7e72ec Use tclem/proto-lens-jsonpb 2019-10-02 13:14:16 -07:00
Rob Rix
e55426cff1
Weaken the language extension to MonoLocalBinds. 2019-10-02 15:51:40 -04:00
Rob Rix
ce8928e9a2
📝 AnalysisClasses. 2019-10-02 15:50:45 -04:00
Rob Rix
898eb8a22d
Reformat AnalysisClasses. 2019-10-02 15:50:45 -04:00
Rob Rix
e0bc6dc9a8
Update src/Semantic/Api/Terms.hs
Co-Authored-By: Patrick Thomson <patrickt@github.com>
2019-10-02 15:31:56 -04:00
Rob Rix
34aaec96d7
📝 the parameters to diffWith/decoratingDiffWith. 2019-10-02 15:30:21 -04:00
Rob Rix
f5f3124efa
📝 diffWith/decoratingDiffWith. 2019-10-02 15:26:15 -04:00
Rob Rix
0c3170edc4
📝 DiffFor. 2019-10-02 15:21:13 -04:00
Rob Rix
e4346562d6
📝 DiffTerms. 2019-10-02 15:18:48 -04:00
Rob Rix
8b705faefc
Rename the DiffFor result variable. 2019-10-02 15:18:29 -04:00
Rob Rix
843b49b26d
🔥 HasDiffFor. 2019-10-02 15:18:13 -04:00
Rob Rix
7433b7e6b1
📝 parseWith & parsePairWith’s parameters. 2019-10-02 15:16:35 -04:00
Rob Rix
3dd91ec21a
Fix some docs. 2019-10-02 15:13:48 -04:00