Open Sonderwoods opened 2 years ago
would guess the problem lies here
Can you share a file that you expect to work, but currently does not?
On Wed, Oct 6, 2021, 11:07 Mathias Sønderskov Schaltz < @.***> wrote:
would guess the problem lies here
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/arendvw/ScriptParasite/issues/12#issuecomment-935801492, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL7T5K33E4CUSKUNX3HBI3UFQGWRANCNFSM5FN6GITQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
@Sonderwoods Currently the parser only supports the region that a script component in grasshopper supports as well. (RunInstance region, and additional components region).
I have no way to solve this; I can only give you and error that you have more regions than what fits in a grasshopper component.
@arendvw im not asking for going outside of grasshopper c# components boundaries. but it fails if i use #region and #endregion within the RunScript method!
Without scriptparasize, this works fine in and is legal c# script components..
Awesome. I did not know it is possible to nest regions. Today, I learned.
Right now the problem is that I use the area between > #region Runscript and the first #endregion it encounters to copy paste this code back intro grasshopper.
The nicest way to solve this would be to instead of using regex, to use Roslyn (the microsoft C# compiler).
Another way would be to change the regex to follow howmany #regions it has encountered to get the snippet.
Either way, I will need some time to solve this.
Or continue to the last #endregion and not care about nesting hierarchy. I think that could work as a quick fix. Anyway thanks for looking into this whenever time appears on the other side of December :D enjoy the holidays
Or continue to the last #endregion and not care about nesting hierarchy
The one before the last (that's the additional code region), except if the additional code region also contains nested regions.
I've ported a scriptcomponent to a cs file and opening it in VS.
When I add region and endregion in VS, then the scriptcomponent somehow removes everything after the endregion part, see below.
and suddently all my code after the endregion is gone:![image](https://user-images.githubusercontent.com/19936679/136171895-8fa03ed1-bb98-42de-ac39-ab3affb76a0a.png)