From 6ad9f5e29e94ab2c8080c690cf56c5610bb7de08 Mon Sep 17 00:00:00 2001 From: Shawn Hurley Date: Thu, 7 Sep 2023 17:19:16 -0400 Subject: [PATCH] :sparkles: adding ability to look for packages (#316) Allows for the searching of packages. Needs https://github.com/konveyor/java-analyzer-bundle/pull/62 Signed-off-by: Shawn Hurley --- provider/internal/java/provider.go | 1 + provider/internal/java/service_client.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/provider/internal/java/provider.go b/provider/internal/java/provider.go index 016346d5..c2d585f4 100644 --- a/provider/internal/java/provider.go +++ b/provider/internal/java/provider.go @@ -45,6 +45,7 @@ var locationToCode = map[string]int{ "import": 8, "variable_declaration": 9, "type": 10, + "package": 11, } type javaProvider struct { diff --git a/provider/internal/java/service_client.go b/provider/internal/java/service_client.go index 13f87c84..092a30ec 100644 --- a/provider/internal/java/service_client.go +++ b/provider/internal/java/service_client.go @@ -72,6 +72,8 @@ func (p *javaServiceClient) Evaluate(cap string, conditionInfo []byte) (provider incidents, err = p.filterVariableDeclaration(symbols) case 10: incidents, err = p.filterTypeReferences(symbols) + case 11: + incidents, err = p.filterDefault(symbols) default: } @@ -196,7 +198,7 @@ func (p *javaServiceClient) initialization() { } var result protocol.InitializeResult - for i:=0; i < 10; i++ { + for i := 0; i < 10; i++ { if err := p.rpc.Call(p.ctx, "initialize", params, &result); err != nil { p.log.Error(err, "initialize failed") continue