Skip to content

Commit

Permalink
Split the project into a reusable component library LSP-lib and an …
Browse files Browse the repository at this point in the history
…implementation depending on the library (#202)

* Base the code off lib-lsp

* Update .gitmodules and README

* Update CI

* Rename package to `idris2-lsp`; bump package version

* Properly (?) add submodule

* Update Makefile

* Remove a TODO from README
  • Loading branch information
Russoul authored Aug 29, 2023
1 parent 15ebd8d commit 7fa662a
Show file tree
Hide file tree
Showing 72 changed files with 62 additions and 6,363 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
SCHEME: scheme

jobs:
build-idris2-with-api:
build-idris2-with-api:
runs-on: ubuntu-latest
env:
IDRIS2_CG: chez
Expand Down Expand Up @@ -72,6 +72,13 @@ jobs:
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> $GITHUB_PATH
chmod +x $HOME/.idris2/bin/idris2 $HOME/.idris2/bin/idris2_app/*
- name: Get LSP-lib submodule
run: |
git submodule update --init LSP-lib
- name: Build and install LSP-lib
working-directory: LSP-lib
run: |
idris2 --install-with-src
- name: build and test
run: |
make build && make test INTERACTIVE=''
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "Idris2"]
path = Idris2
url = https://github.com/idris-lang/Idris2

[submodule "LSP-lib"]
path = LSP-lib
url = https://github.com/idris-community/LSP-lib
1 change: 1 addition & 0 deletions LSP-lib
Submodule LSP-lib added at fa2b65
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ VERSION_TAG ?= $(GIT_SHA1)
.PHONY: build FORCE

build: src/Server/Generated.idr
$(IDRIS2) --build lsp.ipkg
$(IDRIS2) --build idris2-lsp.ipkg

clean:
$(IDRIS2) --clean lsp.ipkg
$(IDRIS2) --clean idris2-lsp.ipkg
$(RM) -r build

repl: src/Server/Generated.idr
rlwrap $(IDRIS2) --repl lsp.ipkg
rlwrap $(IDRIS2) --repl idris2-lsp.ipkg

testbin:
@${MAKE} -C tests testbin
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# [WIP] idris2-lsp
# idris2-lsp
Language Server for Idris2.

**NOTE: At this stage the LSP server requires an ipkg file to work correctly, for reference material about packages look [here](https://idris2.readthedocs.io/en/latest/tutorial/packages.html) and [here](https://idris2.readthedocs.io/en/latest/reference/packages.html). To start a new project with an ipkg, even for a single file, you can issue the `idris2 --init` command, which provides an interactive interface for package creation.**

## Installation with [Pack](https://github.com/stefan-hoeck/idris2-pack) (Recommended)
```bash
pack install-app lsp
pack install-app idris2-lsp
```

## Manual Installation
Expand All @@ -24,6 +24,10 @@ make install # Install Idris
make install-with-src-libs # Install sources for libraries
make install-with-src-api # Install the API with sources
cd .. # Go back to the idris2-lsp directory
git submodule update --init LSP-lib # Get the associated LSP-lib commit
cd LSP-lib
idris2 --install-with-src # Install the LSP library
cd .. # Go back to the idris2-lsp directory
make install # Install idris2-lsp
```

Expand Down
13 changes: 13 additions & 0 deletions idris2-lsp.ipkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package idris2-lsp
version = 0.6.0

opts = "-Wno-shadowing"

depends = idris2, contrib, lsp-lib

sourcedir = "src"

main = Server.Main
executable = idris2-lsp

prebuild = "make src/Server/Generated.idr"
58 changes: 0 additions & 58 deletions lsp.ipkg

This file was deleted.

40 changes: 0 additions & 40 deletions src/Data/OneOf.idr

This file was deleted.

Loading

0 comments on commit 7fa662a

Please sign in to comment.