File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -451,8 +451,6 @@ func (l *LanguageServer) StartCommandWorker(ctx context.Context) {
451
451
params ,
452
452
)
453
453
case "regal.eval" :
454
- fmt .Fprintf (os .Stderr , "regal.eval called with params: %v\n " , params )
455
-
456
454
if len (params .Arguments ) != 3 {
457
455
l .logError (fmt .Errorf ("expected three arguments, got %d" , len (params .Arguments )))
458
456
@@ -1068,7 +1066,7 @@ func (l *LanguageServer) handleTextDocumentCodeLens(
1068
1066
Command : "regal.eval" ,
1069
1067
Arguments : & []any {
1070
1068
module .Package .Location .File ,
1071
- module .Package .Path .String () + "." + string (rule . Head . Name ),
1069
+ module .Package .Path .String () + "." + getRuleName (rule ),
1072
1070
rule .Head .Location .Row ,
1073
1071
},
1074
1072
},
@@ -1080,6 +1078,20 @@ func (l *LanguageServer) handleTextDocumentCodeLens(
1080
1078
return codeLenses , nil
1081
1079
}
1082
1080
1081
+ func getRuleName (rule * ast.Rule ) string {
1082
+ parts := make ([]string , 0 , len (rule .Head .Ref ()))
1083
+
1084
+ for i , part := range rule .Head .Ref () {
1085
+ if ! part .Value .IsGround () && i > 0 {
1086
+ break
1087
+ }
1088
+
1089
+ parts = append (parts , part .Value .String ())
1090
+ }
1091
+
1092
+ return strings .Join (parts , "." )
1093
+ }
1094
+
1083
1095
func (l * LanguageServer ) handleTextDocumentCompletion (
1084
1096
_ context.Context ,
1085
1097
_ * jsonrpc2.Conn ,
You can’t perform that action at this time.
0 commit comments