Skip to content

M function matcher vue template#4317

Merged
samuelstroschein merged 10 commits intomainfrom
cursor/m-function-matcher-vue-template-a107
Jan 23, 2026
Merged

M function matcher vue template#4317
samuelstroschein merged 10 commits intomainfrom
cursor/m-function-matcher-vue-template-a107

Conversation

@samuelstroschein
Copy link
Member

@samuelstroschein samuelstroschein commented Jan 23, 2026

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.


Open in Cursor Open in Web


Note

Enhances message matching to better detect usages and reduce false positives.

  • Match m() references inside Vue <template> blocks and when used before the import appears
  • Require a real m import (import * as m or named { m }) before returning any matches
  • Strip comments/strings during the import scan to avoid false positives (e.g. commented or stringified imports)
  • Adjust parser to validate the character before m, and refactor createParser to accept sourceCode
  • Update/add tests covering Vue templates, pre-import usage, and ignoring commented/string imports

Written by Cursor Bugbot for commit 1c0fcdf. This will update automatically on new commits. Configure here.

Co-authored-by: proxy <proxy@stroschein.me>
@cursor
Copy link

cursor bot commented Jan 23, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2026

🦋 Changeset detected

Latest commit: 1c0fcdf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@inlang/plugin-m-function-matcher Minor

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

@github-actions
Copy link
Contributor

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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>
@samuelstroschein samuelstroschein marked this pull request as ready for review January 23, 2026 17:36
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 141 to 142
if (!sourceCode || !mImportPattern.test(sourceCode)) {
return [];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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>
@samuelstroschein samuelstroschein merged commit aa28859 into main Jan 23, 2026
2 of 3 checks passed
@samuelstroschein samuelstroschein deleted the cursor/m-function-matcher-vue-template-a107 branch January 23, 2026 18:06
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

m function matcher not matching calls in Vue template

2 participants

Comments