Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parentheses around ffi.cdef expressions #22

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

creationix
Copy link

@creationix creationix commented Jan 9, 2025

Problem

The highlighter has really convenient support for embedded C code when it sees the ffi.cdef [[ ... ] pattern, but some codebase styles (including the default in stylua), enforce parentheses around the multiline string which causes the rule to not match.

broken highlighting

working highlighting

Solution

Tweak the regexps to allow optional parentheses around the multiline string.

@creationix creationix marked this pull request as draft January 9, 2025 16:32
@creationix
Copy link
Author

I'm not sure how to test this PR. I was able to checkout the repo and run the build script locally which also updated Syntaxes/Lua.plist, but I have no idea how to actually test the changes in vscode to verify.

@@ -11,7 +11,7 @@
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\build\\build.js",
"program": "${workspaceFolder}/build/build.js",
Copy link
Author

Choose a reason for hiding this comment

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

This is required for this to work on linux or osx, it should still function on windows as node.js fs operations support unix style paths on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant