Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 7f50ee1

Browse files
committed
Merge branch 'master' into symbol-node-type
2 parents c6aa5d7 + 867455a commit 7f50ee1

File tree

147 files changed

+2270
-3325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+2270
-3325
lines changed

.ghci.repl

+21
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,24 @@
2525
:seti -Wno-unsafe
2626
:seti -Wno-star-is-type
2727
:seti -Wno-missing-deriving-strategies
28+
29+
-- Turn on some language extensions you use a lot
30+
:seti -XFlexibleContexts -XOverloadedStrings -XTypeApplications
31+
32+
-- Break on errors
33+
:seti -fbreak-on-error
34+
35+
-- Automatically show the code around breakpoints
36+
:set stop :list
37+
38+
-- Use a cyan lambda as the prompt
39+
:set prompt "\ESC[1;36m\STXλ \ESC[m\STX"
40+
41+
-- Better errors
42+
:set -ferror-spans -freverse-errors -fprint-expanded-synonyms
43+
44+
-- Better typed holes
45+
:set -funclutter-valid-hole-fits -fabstract-refinement-hole-fits -frefinement-level-hole-fits=2
46+
47+
-- This usually impairs understanding
48+
:seti -Wno-type-defaults

.github/workflows/haskell.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,35 @@ jobs:
2828
cabal-version: ${{ matrix.cabal }}
2929

3030
- uses: actions/cache@v1
31-
name: Cache ~/.cabal/packages
31+
id: cache-cabal
32+
name: Cache Cabal artifacts
3233
with:
33-
path: ~/.cabal/packages
34-
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-packages
34+
path: dist-cache
35+
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-cabal-cache-${{ hashFiles('**/*.cabal') }}
36+
restore-keys: |
37+
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-cabal-cache-
38+
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-
39+
${{ runner.os }}-${{ matrix.ghc }}-
40+
${{ runner.os }}-
3541
36-
- uses: actions/cache@v1
37-
name: Cache ~/.cabal/store
38-
with:
39-
path: ~/.cabal/store
40-
key: ${{ runner.os }}-${{ matrix.ghc }}-v10-cabal-store
41-
42-
- uses: actions/cache@v1
43-
name: Cache dist-newstyle
44-
with:
45-
path: dist-newstyle
46-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-semantic-dist
47-
48-
# - name: hlint
49-
# run: |
50-
# test -f dist-newstyle/hlint || cabal install hlint --installdir=dist-newstyle
51-
# dist-newstyle/hlint src semantic-python
42+
- name: Get cabal-cache
43+
run: |
44+
curl -L https://github.com/haskell-works/cabal-cache/releases/download/v1.0.1.8/cabal-cache_x86_64_linux.tar.gz > ./cc.tar.gz
45+
tar -xvf ./cc.tar.gz
5246
53-
- name: Install dependencies
47+
- name: Configure project
5448
run: |
5549
cabal v2-update
5650
cabal v2-configure --project-file=cabal.project.ci --disable-optimization --enable-benchmarks --enable-tests --write-ghc-environment-files=always -j2
57-
cabal v2-build --project-file=cabal.project.ci all --only-dependencies
51+
52+
- name: Restore from cache
53+
run: ./cabal-cache sync-from-archive --threads=2 --archive-uri=dist-cache || true
5854

5955
- name: Build & test
6056
run: |
6157
cabal v2-build --project-file=cabal.project.ci
6258
cabal v2-run --project-file=cabal.project.ci semantic:test
59+
cabal v2-run --project-file=cabal.project.ci semantic-codeql:test
6360
cabal v2-run --project-file=cabal.project.ci semantic-core:test
6461
cabal v2-run --project-file=cabal.project.ci semantic-go:test
6562
cabal v2-run --project-file=cabal.project.ci semantic-java:test
@@ -72,3 +69,6 @@ jobs:
7269
cabal v2-run --project-file=cabal.project.ci semantic-typescript:test
7370
cd semantic-source; cabal v2-run --project-file=cabal.project.ci semantic-source:test; cd ..
7471
cd semantic-source; cabal v2-run --project-file=cabal.project.ci semantic-source:doctest -- src; cd ..
72+
73+
- name: Write out cache
74+
run: ./cabal-cache sync-to-archive --threads=2 --archive-uri=dist-cache

.gitmodules

Whitespace-only changes.

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COPY --from=haskell /opt/ghc/8.8.1/lib/ghc-8.8.1/* /opt/ghc/8.8.1/lib/ghc-8.8.1/
2222
ENTRYPOINT ["/protobuf/bin/protoc", "-I/protobuf", "--plugin=protoc-gen-haskell=/usr/local/bin/proto-lens-protoc"]
2323

2424
# Build semantic
25-
FROM haskell:8.8 as build
25+
FROM haskell:8.8.1 as build
2626
WORKDIR /build
2727

2828
# Build all of semantic

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ Available options:
3535

3636
#### Diff
3737
```
38-
Usage: semantic diff ([--sexpression] | [--json] | [--json-graph] | [--toc] |
38+
Usage: semantic diff ([--sexpression] | [--json] | [--json-graph] |
3939
[--dot] | [--show]) [FILE_A] [FILE_B]
4040
Compute changes between paths
4141
4242
Available options:
4343
--sexpression Output s-expression diff tree (default)
4444
--json Output JSON diff trees
4545
--json-graph Output JSON diff trees
46-
--toc Output JSON table of contents diff summary
4746
--dot Output the diff as a DOT graph
4847
--show Output using the Show instance (debug only, format
4948
subject to change without notice)
@@ -75,19 +74,20 @@ Available options:
7574

7675
## Language support
7776

78-
| Priority | Language | Parse | Assign | Diff | ToC | Symbols | Import graph | Call graph | Control flow graph |
79-
| :---: | :------------- | :---: | :---: | :---: | :--:| :---: | :---: | :---: | :---: |
80-
| 1 | Ruby ||||||| 🚧 | |
81-
| 2 | JavaScript ||||||| 🚧 | |
82-
| 3 | TypeScript ||||||| 🚧 | |
83-
| 4 | Python ||||||| 🚧 | |
84-
| 5 | Go ||||||| 🚧 | |
85-
| | PHP | 🚧 | 🚧 | 🚧 | 🚧| 🚧 | | | |
86-
| | Java | 🚧 | N/A | 🚧 | 🚧 || | | |
87-
| | JSON || N/A || N/A | N/A | N/A | N/A| |
88-
| | JSX |||| 🔶 | | | | |
89-
| | Haskell | 🚧 | 🚧 | 🚧 | 🔶 | 🚧 | | | |
90-
| | Markdown | 🚧 | 🚧 | 🚧 | 🚧 | N/A | N/A | N/A |   |
77+
| Priority | Language | Parse | Assign | Diff | Symbols | Import graph | Call graph | Control flow graph |
78+
| :---: | :------------- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
79+
| 1 | Ruby |||||| 🚧 | |
80+
| 2 | JavaScript |||||| 🚧 | |
81+
| 3 | TypeScript |||||| 🚧 | |
82+
| 4 | Python |||||| 🚧 | |
83+
| 5 | Go |||||| 🚧 | |
84+
| | PHP | 🚧 | 🚧 | 🚧 | 🚧 | | | |
85+
| | Java | 🚧 | N/A | 🚧 || | | |
86+
| | JSON || N/A || N/A | N/A | N/A | |
87+
| | JSX |||| | | | |
88+
| | Haskell | 🚧 | 🚧 | 🚧 | 🚧 | | | |
89+
| | Markdown | 🚧 | 🚧 | 🚧 | N/A | N/A | N/A |   |
90+
| | CodeQL || N/A | 🚧 || | | |
9191

9292
* ✅ — Supported
9393
* 🔶 — Partial support
@@ -109,7 +109,7 @@ cabal v2-test
109109
cabal v2-run semantic -- --help
110110
```
111111

112-
`stack` as a build tool is not officially supported; there is an unofficial [`stack.yaml`](https://gist.github.com/jkachmar/f200caee83280f1f25e9cfa2dd2b16bb) available, though we cannot make guarantees as to its stability.
112+
`stack` as a build tool is not officially supported; there is [unofficial `stack.yaml` support](https://github.com/jkachmar/semantic-stack-yaml) available, though we cannot make guarantees as to its stability.
113113

114114
[nix]: https://www.haskell.org/cabal/users-guide/nix-local-build-overview.html
115115
[ghcup]: https://www.haskell.org/ghcup/

bench/Evaluation.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ callGraphProject' :: ( Language.SLanguage lang
3838
callGraphProject' session proxy path
3939
| Just (SomeParser parser) <- parserForLanguage analysisParsers lang = fmap (bimap show (const ())) . runTask session $ do
4040
blob <- readBlobFromPath (Path.toAbsRel path)
41-
package <- fmap snd <$> runParse (Duration.fromSeconds 10) (parsePackage parser (Project (Path.toString (Path.takeDirectory path)) [blob] lang []))
41+
package <- fmap snd <$> runParse (Duration.fromSeconds 10) (parsePackage parser (Project (Path.toAbsRel (Path.takeDirectory path)) [blob] lang []))
4242
modules <- topologicalSort <$> runImportGraphToModules proxy package
4343
runCallGraph proxy False modules package
4444
| otherwise = error $ "Analysis not supported for: " <> show lang

bench/Tagging.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import qualified System.Path as Path
1616

1717
import qualified Analysis.File as File
1818
import Data.Flag
19-
import Proto.Semantic as P hiding (Blob, BlobPair)
19+
import Proto.Semantic as P hiding (Blob)
2020
import Semantic.Api.Symbols (parseSymbols)
2121
import Semantic.Config as Config
2222
import Semantic.Task

cabal.project

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
packages: .
55
semantic-analysis
66
semantic-ast
7+
semantic-codeql
78
semantic-core
89
semantic-go
910
semantic-java
@@ -16,6 +17,7 @@ packages: .
1617
semantic-tsx
1718
semantic-typescript
1819
semantic-tags
20+
semantic-rust
1921

2022
-- Packages brought in from other repos instead of hackage
2123
-- ATTENTION: remember to update cabal.project.ci when bumping SHAs here!
@@ -28,8 +30,3 @@ source-repository-package
2830
type: git
2931
location: https://github.com/antitypical/fused-syntax.git
3032
tag: d11e14581217590a5c67f79cbaeee35ac8acee6a
31-
32-
source-repository-package
33-
type: git
34-
location: https://github.com/fused-effects/fused-effects-readline.git
35-
tag: 7a96949c77c73c6e5975c8d6171ffb63eb76b467

cabal.project.ci

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
packages: .
55
semantic-analysis
66
semantic-ast
7+
semantic-codeql
78
semantic-core
89
semantic-go
910
semantic-java
@@ -12,6 +13,7 @@ packages: .
1213
semantic-php
1314
semantic-python
1415
semantic-ruby
16+
semantic-rust
1517
semantic-scope-graph
1618
semantic-tsx
1719
semantic-typescript
@@ -29,12 +31,6 @@ source-repository-package
2931
location: https://github.com/antitypical/fused-syntax.git
3032
tag: d11e14581217590a5c67f79cbaeee35ac8acee6a
3133

32-
source-repository-package
33-
type: git
34-
location: https://github.com/fused-effects/fused-effects-readline.git
35-
tag: 7a96949c77c73c6e5975c8d6171ffb63eb76b467
36-
37-
3834
-- Treat warnings as errors for CI builds
3935
package semantic
4036
ghc-options: -Werror
@@ -45,6 +41,9 @@ package semantic-analysis
4541
package semantic-ast
4642
ghc-options: -Werror
4743

44+
package semantic-codeql
45+
ghc-options: -Werror
46+
4847
package semantic-core
4948
ghc-options: -Werror
5049

0 commit comments

Comments
 (0)