Closed pmwals09 closed 11 months ago
This is amazing!! 💜 🚀 I'm going to review this tonight or tomorrow morning. I've got some ideas to use this PR as the foundation for for some new features for a 2.0 release (more details on that to come)
I'm seeing some issues w/ TS2332 - working debugging now.
I'm seeing this in tsc.nvim:
components/market-dashboards/markets/aave-pool-v2/AavePoolV2DashboardCharts.tsx|181 col 11 error| TS2322: I was expecting a type matching 'data', but instead you passed 'data'.
In vscode I'm seeing:
I was expecting a type matching IntrinsicAttributes & Readonly<{ data: Series | readonly Series[] | unique symbol; option?: Readonly<{ heightPx?: number | undefined; widthPx?: number | undefined; priceFormatter?: PriceFormatterFn | undefined; timeFormatter?: TimeFormatterFn | undefined; }> | undefined; title?: ReactNode; toolbarOptions?: Readonly<..., but instead you passed { data: Readonly<{ kind: "area"; data: readonly SingleValueSeriesDatum[]; options?: Readonly<{ color?: Color | undefined; lastPriceAnimation?: "continuous" | "disabled" | undefined; markers?: readonly SeriesMarker[] | undefined; }> | undefined; }>; options: Readonly<...>; title: Element; toolbarOptions: { ...; }; }.
I've narrowed it down to a bug with these line(s):
local idx = md_original_message:find(slots[i])
local match = original_message:match("%w+", idx)
This code assumes that the actual error message will be the same length as the better error message templates. This actually works for better errors with only one slot (b/c the first capture group will always be at the same index as the slot).
I've got some WIP on a solution, but might not get around to finishing it immediately.
@dmmulroy I did some work on this that I pushed up. It's kind of ugly but it gets the job done. I added a test case for the longer error messages you posted above.
Here's a quick overview of what I've put together:
slot
variable for later.slot
for our return value, clear out slot
for our next capture, and jump the cursor to the end of that in-between string to start looking for the next one.Made some changes to the implementation to be a bit closer to the implementation in Matt's repo! Sorry this took so long to get reviewed and in, I appreciate all of your effort and work!
This resolves #7.
The provided test file can be run with
:PlenaryBustedFile %
.The MD files are pulled from Matt Pocock's repo, on which this concept was based.
Thanks!