Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some bugs when processing my own project #45

Merged
merged 2 commits into from
Jun 27, 2024
Merged
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
2 changes: 1 addition & 1 deletion Akku.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!r6rs ; -*- mode: scheme; coding: utf-8 -*-
(import (akku format manifest))

(akku-package ("scheme-langserver" "1.2.0")
(akku-package ("scheme-langserver" "1.2.1")
(synopsis
"This package is a language server protocol implementation helping scheme programming.")
(authors "WANG Zheng")
Expand Down
4 changes: 2 additions & 2 deletions analysis/identifier/rules/library-export.sls
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
(let* ([ann (index-node-datum/annotations index-node)]
[expression (annotation-stripped ann)])
(match expression
[('rename (internal-names external-names) **1)
[('rename ((? symbol? internal-names) (? symbol? external-names)) **1)
(fold-left
(lambda (result current-item)
(let* ([current-children (index-node-children current-item)]
Expand Down Expand Up @@ -81,7 +81,7 @@
`(,@result ,external-index-node)))
'()
(cdr (index-node-children index-node)))]
[identifier
[(? symbol? identifier)
(let* ([references (find-available-references-for document index-node identifier)]
[reference-count (length references)])
(index-node-references-export-to-other-node-set!
Expand Down
12 changes: 6 additions & 6 deletions analysis/identifier/rules/library-import.sls
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
(lambda (reference)
(not (equal? current-identifier (identifier-reference-identifier reference))))
imported-references)))))]
[('except (library-identifier **1) identifier **1)
[('except (library-identifier **1) (? symbol? identifier) **1)
(let ([tmp
(filter
(lambda (reference)
Expand Down Expand Up @@ -177,7 +177,7 @@
(lambda (reference)
(not (equal? current-identifier (identifier-reference-identifier reference))))
imported-references)))))]
[('prefix (library-identifier **1) prefix-id)
[('prefix (library-identifier **1) (? symbol? prefix-id))
(let* ([imported-references (import-references root-library-node library-identifier)]
[prefixed-references
(map
Expand All @@ -194,7 +194,7 @@
imported-references)])
;;todo: add something to export-to-other-node for current-index-node?
(append-references-into-ordered-references-for document grand-parent-index-node prefixed-references))]
[('rename (library-identifier **1) (external-name internal-name) **1 )
[('rename (library-identifier **1) ((? symbol? external-name) (? symbol? internal-name)) **1 )
(let loop ([importion-nodes (cddr (index-node-children index-node))]
[external-names external-name]
[internal-names internal-name]
Expand Down Expand Up @@ -250,7 +250,7 @@
(lambda (reference)
(not (equal? current-external-name (identifier-reference-identifier reference))))
imported-references)))))]
[('alias (library-identifier **1) (external-name internal-name) **1 )
[('alias (library-identifier **1) ((? symbol? external-name) (? symbol? internal-name)) **1 )
(let loop ([importion-nodes (cddr (index-node-children index-node))]
[external-names external-name]
[internal-names internal-name]
Expand Down Expand Up @@ -375,14 +375,14 @@
(let* ([ann (index-node-datum/annotations index-node)]
[expression (annotation-stripped ann)])
(match expression
[('rename (internal-names external-names) **1)
[('rename ((? symbol? internal-names) (? symbol? external-names)) **1)
(let loop ([exportion-nodes (cdr (index-node-children index-node))]
[result '()])
(if (null? exportion-nodes)
result
(loop
(cdr exportion-nodes)
(append result (index-node-references-export-to-other-node (cadr (index-node-children (car exportion-nodes))))))))]
[identifier (index-node-references-export-to-other-node index-node)]
[(? symbol? identifier) (index-node-references-export-to-other-node index-node)]
[else '()])))
)
Loading