File tree Expand file tree Collapse file tree 9 files changed +5513
-1
lines changed Expand file tree Collapse file tree 9 files changed +5513
-1
lines changed Original file line number Diff line number Diff line change 1
1
bindings /typescript /scip.ts linguist-generated =true
2
2
bindings /go /scip /scip.pb.go linguist-generated =true
3
3
bindings /rust /src /scip.rs linguist-generated =true
4
+ bindings /haskell /src /Proto /** .hs linguist-generated =true
4
5
yarn.lock linguist-generated =true
Original file line number Diff line number Diff line change
1
+ name : Haskell
2
+ on :
3
+ pull_request :
4
+ paths :
5
+ - ' .github/workflows/**'
6
+ - ' **.hs'
7
+ - ' **.cabal'
8
+
9
+ jobs :
10
+ ci :
11
+ strategy :
12
+ fail-fast : false
13
+ matrix :
14
+ ghc : [8.10.7]
15
+ runs-on : ubuntu-latest
16
+ container :
17
+ # Ubuntu with ghcup already installed
18
+ image : ghcr.io/facebookincubator/hsthrift/ci-base:ghcup
19
+ steps :
20
+ - name : Checkout code
21
+ uses : actions/checkout@v2
22
+ - name : Install additional tools
23
+ run : |
24
+ apt-get update
25
+ apt install -y unzip
26
+ - name : Install GHC ${{ matrix.ghc }}
27
+ run : ghcup install ghc ${{ matrix.ghc }} --set
28
+ - name : Install cabal-install 3.6
29
+ run : ghcup install cabal 3.6.0.0 --set
30
+ - name : Add GHC and cabal to PATH
31
+ run : echo "$HOME/.ghcup/bin" >> "$GITHUB_PATH"
32
+ - name : Install protoc
33
+ run : |
34
+ PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip
35
+ curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/"$PROTOC_ZIP"
36
+ unzip -o "$PROTOC_ZIP" -d /usr/local bin/protoc
37
+ unzip -o "$PROTOC_ZIP" -d /usr/local 'include/*'
38
+ rm -f $PROTOC_ZIP
39
+ - name : Populate hackage index
40
+ run : cabal update
41
+ working-directory : bindings/haskell
42
+ - name : Build proto-lens-protoc wrapper
43
+ run : cabal install proto-lens-protoc
44
+ working-directory : bindings/haskell
45
+ - name : Generate Haskell
46
+ run : protoc --plugin=protoc-gen-haskell="$HOME/.cabal/bin/proto-lens-protoc" --haskell_out=src --proto_path=../.. scip.proto
47
+ working-directory : bindings/haskell
48
+ - name : Build source
49
+ run : cabal build
50
+ working-directory : bindings/haskell
Original file line number Diff line number Diff line change 4
4
5
5
- [ bindings/] ( ./bindings/ ) : Contains a mix of generated and hand-written
6
6
bindings for different languages.
7
- - The TypeScript and Rust bindings are auto-generated.
7
+ - The TypeScript, Rust and Haskell bindings are auto-generated.
8
8
- The Go bindings include protoc-generated code as well as extra
9
9
functionality, such as for converting a SCIP index into an LSIF index.
10
10
This is used by the CLI below as well as the
24
24
```
25
25
./dev/proto-generate.sh
26
26
```
27
+ For the Haskell bindings, see ` bindings/haskell/README.md ` .
27
28
2 . Regenerating snapshots after making changes to the CLI.
28
29
```
29
30
go test ./cmd -update-snapshots
Original file line number Diff line number Diff line change
1
+ dist-newstyle /
Original file line number Diff line number Diff line change
1
+ ../../LICENSE
Original file line number Diff line number Diff line change
1
+ [ ![ CI] ( https://github.com/sourcegraph/scip/actions/workflows/haskell.yml/badge.svg )] ( https://github.com/sourcegraph/scip/actions/workflows/haskell.yml/badge.svg )
2
+
3
+ # Haskell bindings for SCIP
4
+
5
+ These bindings use [ Google's proto-lens generator for Haskell] ( https://github.com/google/proto-lens ) .
6
+
7
+ Building: see the following workflow file for most up to date:
8
+ https://github.com/sourcegraph/scip/blob/main/.github/workflows/haskell.yml
9
+
10
+ First, get a working GHC environment:
11
+
12
+ ``` sh
13
+ # Linux
14
+ GHCUPVERSION=0.1.17.4
15
+ curl --proto ' =https' --tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/$GHCUPVERSION /x86_64-linux-ghcup-$GHCUPVERSION > /usr/bin/ghcup && \
16
+ chmod +x /usr/bin/ghcup
17
+ ghcup install ghc 8.10.7 --set
18
+ ghcup install cabal 3.6.0.0 --set
19
+ ```
20
+
21
+ ``` sh
22
+ # macOS
23
+ GHCUPVERSION=0.1.17.4
24
+ curl --proto ' =https' --tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/$GHCUPVERSION /x86_64-apple-darwin-ghcup-$GHCUPVERSION > /usr/local/bin/ghcup && \
25
+ chmod +x /usr/local/bin/ghcup
26
+ ghcup install ghc 8.10.7 --set
27
+ ghcup install cabal 3.6.0.0 --set
28
+ ```
29
+
30
+ Next, install Google's ` protoc ` compiler. See: https://github.com/google/proto-lens/blob/master/docs/installing-protoc.md
31
+
32
+ Then install the haskell generator from the proto-lens packages:
33
+
34
+ ```
35
+ cabal install proto-lens-protoc
36
+ ```
37
+
38
+ Finally, generate the source files manually in ` src/* `
39
+
40
+ ``` sh
41
+ # working directory: bindings/haskell
42
+ protoc --plugin=protoc-gen-haskell=` which proto-lens-protoc` --haskell_out=src --proto_path=../.. scip.proto
43
+ ```
44
+
45
+ Build the library as normal:
46
+
47
+ ```
48
+ # working directory: bindings/haskell
49
+ cabal build
50
+ ```
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.6
2
+
3
+ name : scip
4
+ version : 0.1.0.0
5
+ synopsis : Haskell bindings for SCIP Code Intelligence Protocol
6
+ license : Apache-2.0
7
+ license-file : LICENSE
8
+ author : SCIP Maintainers
9
+
10
+ homepage : https://github.com/sourcegraph/scip
11
+ category : Language
12
+ build-type : Simple
13
+
14
+ library
15
+ ghc-options : -Wall
16
+ exposed-modules :
17
+ Proto.Scip,
18
+ Proto.Scip_Fields
19
+ hs-source-dirs : src
20
+ default-language : Haskell2010
21
+ build-depends :
22
+ proto-lens-runtime ^>= 0.7.0.0 ,
23
+ base ^>= 4.14.0.0
You can’t perform that action at this time.
0 commit comments