Skip to content

Commit

Permalink
✨ adding ability to look for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-hurley committed Sep 6, 2023
1 parent 90359e6 commit d9a9c9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions provider/internal/java/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var locationToCode = map[string]int{
"import": 8,
"variable_declaration": 9,
"type": 10,
"package": 11,
}

type javaProvider struct {
Expand Down
6 changes: 5 additions & 1 deletion provider/internal/java/service_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (p *javaServiceClient) Evaluate(cap string, conditionInfo []byte) (provider

symbols := p.GetAllSymbols(cond.Referenced.Pattern, cond.Referenced.Location)

fmt.Printf("\n\n\n%#v\n\n\n", symbols)

incidents := []provider.IncidentContext{}
switch locationToCode[strings.ToLower(cond.Referenced.Location)] {
case 0:
Expand All @@ -72,6 +74,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:

}
Expand Down Expand Up @@ -196,7 +200,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
Expand Down

0 comments on commit d9a9c9c

Please sign in to comment.