handlebars-lang / handlebars-lang/handlebars.js
Add source location to HelperOptions
- Dominant language
- JavaScript
- Stars
- 18.7k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
The `options` object passed to a helper contains more information than in the type `HelperOptions`, specifically `name`, `loc` and `lookupProperty`. It's easy enough to add these to the type definition:
```typescript
name: string
loc: {
start: hbs.AST.Position
end: hbs.AST.Position
}
lookupProperty: (object: unknown, propertyName: string) => unknown
```
But the `loc` property isn't a full `SourceLocation`. It's missing the `source: string` property, which I hope will identify the filename of the current template. It would be fantastic to add that property so that a `helperMissing` helper can produce more useful output!
Contributor guide
Research direction
Start by locating the HelperOptions type definition and the code that passes the options object to helpers. Read how loc and SourceLocation are currently represented, then add the requested source information so helperMissing can identify the template filename and verify the resulting helper options behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100