p42ai / js-assistant

120+ refactorings and code-assists for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=p42ai.refactor
MIT License
119 stars 7 forks source link

Issue with "import.meta" syntax #79

Open UserNobody14 opened 4 months ago

UserNobody14 commented 4 months ago

When running the react component refactor in a file with "import.meta.env.WHATEVER" or some other vite env import, I'm getting this issue:

[ERROR] Error: createSingleInteractiveEdit for node 1102-1769-JsxElement failed: forEachChildWithAttribute: unsupported syntax type MetaProperty
    at t.CodeAssistEngine.createSingleInteractiveEdit (/home/benjamin/.vscode/extensions/p42ai.refactor-3.0.1/server/dist/server-node.js:2:549856)
    at async t.TransformationResult.createCodeAssistAction (/home/benjamin/.vscode/extensions/p42ai.refactor-3.0.1/server/dist/server-node.js:2:570610)
    at async /home/benjamin/.vscode/extensions/p42ai.refactor-3.0.1/server/dist/server-node.js:2:1159853
[ERROR] apps/webapp/src/app/components/BuildInfo.tsx - No action received for code assist '0:extract-jsx-element:1102-1769-JsxElement:'.

If the import.meta statements are commented out, it works fine.