Skip to content

Commit d0e99b5

Browse files
authored
Rewrite hover provider in Rego (#1951)
And get rid of all related code previously written in Go. The biggest win here is IMO how this allows us to entirely get rid of one of our continuous "watcher" processes, and instead use only data from input and storage, like we do in all Rego handlers. Quite an improvement! Notable other changes: - Move ast.keywords to lsp.hover.keywords as they're only used in hover - Move lsp.completion.location to lsp.location as useful outside completion handlers Besides the tests, also manually tested hovering both built-ins and keywords and all seem to work well! Fixes #1905 Signed-off-by: Anders Eknert <anders.eknert@apple.com>
1 parent 0a0f1f8 commit d0e99b5

49 files changed

Lines changed: 721 additions & 1093 deletions

Some content is hidden

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

.github/workflows/update-example-index.yaml

Lines changed: 0 additions & 70 deletions
This file was deleted.

build/workflows/update_example_index.rego

Lines changed: 0 additions & 69 deletions
This file was deleted.

bundle/regal/ast/keywords_test.rego

Lines changed: 0 additions & 216 deletions
This file was deleted.

bundle/regal/lsp/completion/providers/booleans/booleans.rego

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
package regal.lsp.completion.providers.booleans
44

55
import data.regal.lsp.completion.kind
6-
import data.regal.lsp.completion.location
6+
import data.regal.lsp.location
77

88
# METADATA
99
# description: completion suggestions for true/false

bundle/regal/lsp/completion/providers/builtins/builtins.rego

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
package regal.lsp.completion.providers.builtins
44

55
import data.regal.lsp.completion.kind
6-
import data.regal.lsp.completion.location
6+
import data.regal.lsp.location
77

88
# METADATA
99
# description: suggest built-in functions matching typed ref

bundle/regal/lsp/completion/providers/commonrule/commonrule.rego

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package regal.lsp.completion.providers.commonrule
55

66
import data.regal.lsp.completion.kind
7-
import data.regal.lsp.completion.location
7+
import data.regal.lsp.location
88

99
_suggested_names := {
1010
"allow",

bundle/regal/lsp/completion/providers/default/default.rego

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package regal.lsp.completion.providers.default
55
import data.regal.ast
66

77
import data.regal.lsp.completion.kind
8-
import data.regal.lsp.completion.location
8+
import data.regal.lsp.location
99

1010
# METADATA
1111
# description: all completion suggestions for default keyword

0 commit comments

Comments
 (0)