Skip to content

Commit

Permalink
fix: Don't assume 1 entity per text location
Browse files Browse the repository at this point in the history
  • Loading branch information
travisstebbins committed Dec 9, 2024
1 parent 2b5a797 commit bf86ed5
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/components/query/QueryBuilderStateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,17 @@ export const getMinimalEntities = async (
},
GET_ENTITY_TEXT_LOCATION_RESPONSE,
);
const entitiesInTextLocation = await postAndWaitForMessage<Entity[]>(
{
command: GET_PROJECT_ENTITIES,
msg: {
entityTextLocations: [currentEntityTextLocation],
},
},
GET_PROJECT_ENTITIES_RESPONSE,
);
const currentEntity = guaranteeNonNullable(
(
await postAndWaitForMessage<Entity[]>(
{
command: GET_PROJECT_ENTITIES,
msg: {
entityTextLocations: [currentEntityTextLocation],
},
},
GET_PROJECT_ENTITIES_RESPONSE,
)
)[0],
entitiesInTextLocation.find((entity) => entity.path === entityId),
`Can't find entity with ID ${entityId}`,
);

Expand Down

0 comments on commit bf86ed5

Please sign in to comment.