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

Incompatiblity with maptz.regionfolder #56

Open
TheOnly8Z opened this issue Sep 29, 2023 · 2 comments
Open

Incompatiblity with maptz.regionfolder #56

TheOnly8Z opened this issue Sep 29, 2023 · 2 comments

Comments

@TheOnly8Z
Copy link

I tried using RegionFolder with a custom configuration to be able to fold my code blocks. GLua files seem to prevent this extension from creating fold spaces even though the same file and configuration works with regular Lua.
https://marketplace.visualstudio.com/items?itemName=maptz.regionfolder

To Replicate

I am using the following configuration for this extension in settings.json. This setup is identical to the one in the extension, but renamed for glua instead of lua.

    "maptz.regionfolder": {
        "[glua]": {
            "foldEnd": "--#endregion",
            "foldEndRegex": "--[\\s]*#endregion",
            "foldStart": " --#region [NAME]",
            "foldStartRegex": "--[\\s]*#region[\\s]*(.*)"
        }
    },

When the file is configured as GLua (bottom right language setting), the folding widgets do not appear even though regions are defined correctly.
image

After switching language to Lua, the fold widgets immediately become visible and can be used to collapse code.
image
image

If I switch back to GLua without folding anything, the fold widgets disappear.

Curiously however, if the fold regions are folded before switching from Lua to GLua, they remain folded and can be used without disappearing, persisting even after the file is closed and reopened and within new windows.

image

The ability to fold certain user-defined regions is super convenient for large, sectioned bulk files that have segments but no code blocks for each. If this can be resolved (or something similar implemented into GLua Enhanced) it'd be a great producibility tool.

@WilliamVenner
Copy link
Owner

The extension has to register a new "language" in order for GLua Enhanced to not load when editing normal Lua files, therefore, extensions for the Lua language will not work with the GLua language

@TheOnly8Z
Copy link
Author

The extension has to register a new "language" in order for GLua Enhanced to not load when editing normal Lua files, therefore, extensions for the Lua language will not work with the GLua language

That is true, and I have set custom configuration for the extension to make it work with GLua.

In addition to the above issue, I also noticed that when both extensions are active, GLua Enhanced can't generate its own folding widgets for functions and code blocks. My guess is that this seems to be related to two extensions modifying folding behavior at the same time.

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

No branches or pull requests

2 participants