Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v2
with:
repo: ufo5260987423/scheme-langserver
name: Scheme LangServer Auto-generated Build
tag_name: automated_build
files: |
build/scheme-langserver-x86_64-linux-glibc
build/scheme-langserver-x86_64-linux-musl
body: |
This is an automated release of Scheme LangServer.

**Commit:** ${{ github.sha }}
**Branch:** ${{ github.ref_name }}
**Pipeline Run:** ${{ github.run_id }}

4 changes: 2 additions & 2 deletions Dockerfile.musl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ RUN akku install
FROM alpine:latest

ENV DEBIAN_FRONTEND=noninteractive
RUN apk update && apk add \
git alpine-sdk util-linux-dev libuuid make
RUN apk update && apk add --no-cache \
git alpine-sdk util-linux-dev libuuid make util-linux-static

# add chez scheme
COPY --from=build-chez /usr/bin/scheme /usr/bin/
Expand Down
7 changes: 2 additions & 5 deletions analysis/package-manager/txt-filter.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
(chezscheme)
(scheme-langserver util io)
(scheme-langserver virtual-file-system file-node)
(only (srfi :13 strings) string-suffix? string-prefix? string-contains string-index-right string-index string-take string-drop string-drop-right))
(only (srfi :13 strings) string-suffix?))

(define (generate-txt-file-filter list-path)
(define (generate-txt-file-filter)
(lambda (path)
;; (pretty-print `(DEBUG: ,path))
(cond
[(string-contains path "akku") #f]
[(string-suffix? ".scm.txt" path) #t]
[(file-directory? path) #t]
[else #f])))
)
26 changes: 16 additions & 10 deletions analysis/workspace.sls
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@
(immutable facet)
;only for identifer catching and type inference
(immutable threaded?)
(immutable type-inference?)))
(immutable type-inference?)
(immutable top-environment)))

(define (refresh-workspace workspace-instance)
(let* ([path (file-node-path (workspace-file-node workspace-instance))]
[root-file-node (init-virtual-file-system path '() (generate-akku-acceptable-file-filter (string-append path "/.akku/list")))]
[top-environment (workspace-top-environment workspace-instance)]
[filter
(case top-environment
['r6rs (generate-akku-acceptable-file-filter (string-append path "/.akku/list"))]
['r7rs (generate-txt-file-filter)]
[else (generate-akku-acceptable-file-filter (string-append path "/.akku/list"))])]
[root-file-node (init-virtual-file-system path '() filter)]
[root-library-node (init-library-node root-file-node)]
[file-linkage (init-file-linkage root-file-node root-library-node)]
[batches (get-init-reference-batches file-linkage)])
Expand All @@ -85,18 +92,17 @@
[(path identifier threaded? type-inference?) (init-workspace path identifier 'r6rs threaded? type-inference?)]
[(path identifier top-environment threaded? type-inference?)
;; (pretty-print `(DEBUG: function: init-workspace))
(let* ([root-file-node
(init-virtual-file-system path '()
(cond
;todo:add more filter
[(equal? 'r7rs top-environment) (generate-txt-file-filter (string-append path "/tests/r7rs"))]
[(equal? 'akku identifier) (generate-akku-acceptable-file-filter (string-append path "/.akku/list"))]
[else (generate-akku-acceptable-file-filter (string-append path "/.akku/list"))]))]
(let* ([facet
(case identifier
[txt (generate-txt-file-filter)]
[akku (generate-akku-acceptable-file-filter (string-append path "/.akku/list"))]
[else (generate-akku-acceptable-file-filter (string-append path "/.akku/list"))])]
[root-file-node (init-virtual-file-system path '() facet)]
[root-library-node (init-library-node root-file-node)]
[file-linkage (init-file-linkage root-file-node root-library-node)]
[batches (get-init-reference-batches file-linkage)])
(init-references root-file-node root-library-node file-linkage threaded? batches type-inference?)
(make-workspace root-file-node root-library-node file-linkage identifier threaded? type-inference?))]))
(make-workspace root-file-node root-library-node file-linkage facet threaded? type-inference? top-environment))]))

;; head -[linkage]->files
;; for single file
Expand Down
11 changes: 5 additions & 6 deletions tests/analysis/test-workspace.sps
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@
(test-end)

(test-begin "init-workspace-basic-test")
(let* ([workspace (init-workspace (current-directory) 'akku 'r7rs #f #f)]
[root-file-node (workspace-file-node workspace)]
[root-library-node (workspace-library-node workspace)])
;; (pretty-print `(DEBUG: workspace ,workspace))
(test-equal #f (null? root-file-node))
(test-equal #f (null? root-library-node)))
(let* ([workspace (init-workspace (string-append (current-directory) "/tests/resources/r7rs") 'txt 'r7rs #f #f)]
[root-file-node (workspace-file-node workspace)]
[root-library-node (workspace-library-node workspace)])
(test-equal #f (null? root-file-node))
(test-equal #f (null? root-library-node)))
(test-end)

(exit (if (zero? (test-runner-fail-count (test-runner-get))) 0 1))
Loading