M function matcher vue template#4317
Conversation
Co-authored-by: proxy <proxy@stroschein.me>
|
Cursor Agent can help with this pull request. Just |
🦋 Changeset detectedLatest commit: 1c0fcdf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
Co-authored-by: proxy <proxy@stroschein.me>
Co-authored-by: proxy <proxy@stroschein.me>
Co-authored-by: proxy <proxy@stroschein.me>
Co-authored-by: proxy <proxy@stroschein.me>
Co-authored-by: proxy <proxy@stroschein.me>
Co-authored-by: proxy <proxy@stroschein.me>
Co-authored-by: proxy <proxy@stroschein.me>
Co-authored-by: proxy <proxy@stroschein.me>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 196b6ab023
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!sourceCode || !mImportPattern.test(sourceCode)) { | ||
| return []; |
There was a problem hiding this comment.
Avoid false positives when import appears only in comments
Because parsing is now gated only by mImportPattern.test(sourceCode), any file that merely contains the string import { m } in a comment or string literal (even after unrelated m.*() usage) will pass the gate and be fully scanned, producing message references despite no real Paraglide import. Previously, matching only began after the import token, so these cases would return no matches. Example: const m = Math; m.max(1,2); // import { m } from "@/paraglide/messages" now yields a messageId even though m isn’t imported. This creates new false positives.
Useful? React with 👍 / 👎.
Co-authored-by: proxy <proxy@stroschein.me>
Closes opral/sherlock#197
Add a failing unit test to reproduce the issue where the m-function matcher doesn't match calls in Vue templates.
Note
Enhances message matching to better detect usages and reduce false positives.
m()references inside Vue<template>blocks and when used before the import appearsmimport (import * as mor named{ m }) before returning any matchesm, and refactorcreateParserto acceptsourceCodeWritten by Cursor Bugbot for commit 1c0fcdf. This will update automatically on new commits. Configure here.