(ctx context.Context, params *GetSignatureUsagesParams)
| 3149 | } |
| 3150 | |
| 3151 | func (s *Session) handleGetSignatureUsages(ctx context.Context, params *GetSignatureUsagesParams) ([]SignatureUsageResponse, error) { |
| 3152 | sd, err := s.getSnapshotData(params.Snapshot) |
| 3153 | if err != nil { |
| 3154 | return nil, err |
| 3155 | } |
| 3156 | program, err := sd.getProgram(params.Project) |
| 3157 | if err != nil { |
| 3158 | return nil, err |
| 3159 | } |
| 3160 | |
| 3161 | signatureDecl, err := sd.resolveNodeHandle(program, params.SignatureDecl) |
| 3162 | if err != nil { |
| 3163 | return nil, err |
| 3164 | } |
| 3165 | if signatureDecl == nil { |
| 3166 | return nil, nil |
| 3167 | } |
| 3168 | |
| 3169 | langSvc, err := s.setupLanguageService(sd, program, params.Project, "") |
| 3170 | if err != nil { |
| 3171 | return nil, err |
| 3172 | } |
| 3173 | |
| 3174 | usages := langSvc.GetSignatureUsages(ctx, signatureDecl) |
| 3175 | if usages == nil { |
| 3176 | return nil, nil |
| 3177 | } |
| 3178 | |
| 3179 | result := make([]SignatureUsageResponse, 0, len(usages)) |
| 3180 | for _, u := range usages { |
| 3181 | entry := SignatureUsageResponse{ |
| 3182 | Name: sd.nodeHandleFrom(u.Name), |
| 3183 | } |
| 3184 | if u.Call != nil { |
| 3185 | entry.Call = sd.nodeHandleFrom(u.Call) |
| 3186 | } |
| 3187 | result = append(result, entry) |
| 3188 | } |
| 3189 | return result, nil |
| 3190 | } |
| 3191 | |
| 3192 | // handleGetCompletionsAtPosition returns completions at a position in a document. |
| 3193 | func (s *Session) handleGetCompletionsAtPosition(ctx context.Context, params *GetCompletionsAtPositionParams) (*CompletionInfoResponse, error) { |
no test coverage detected