handleGetDeclaredTypeOfSymbol returns the declared type of a symbol (e.g. the type alias body for type alias symbols).
(ctx context.Context, params *GetTypeOfSymbolParams)
| 1282 | |
| 1283 | // handleGetDeclaredTypeOfSymbol returns the declared type of a symbol (e.g. the type alias body for type alias symbols). |
| 1284 | func (s *Session) handleGetDeclaredTypeOfSymbol(ctx context.Context, params *GetTypeOfSymbolParams) (*TypeResponse, error) { |
| 1285 | setup, err := s.setupChecker(ctx, params.Snapshot, params.Project) |
| 1286 | if err != nil { |
| 1287 | return nil, err |
| 1288 | } |
| 1289 | defer setup.done() |
| 1290 | |
| 1291 | symbol, err := setup.resolveSymbolHandle(params.Symbol) |
| 1292 | if err != nil { |
| 1293 | return nil, err |
| 1294 | } |
| 1295 | if symbol == nil { |
| 1296 | return nil, nil |
| 1297 | } |
| 1298 | |
| 1299 | t := setup.checker.GetDeclaredTypeOfSymbol(symbol) |
| 1300 | if t == nil { |
| 1301 | return nil, nil |
| 1302 | } |
| 1303 | |
| 1304 | return setup.newTypeResponse(t), nil |
| 1305 | } |
| 1306 | |
| 1307 | // handleResolveName resolves a name to a symbol at a given location. |
| 1308 | func (s *Session) handleResolveName(ctx context.Context, params *ResolveNameParams) (*SymbolResponse, error) { |
no test coverage detected