arendvw / ScriptParasite

A component that allows editting of C# definitions in external editors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First line/lines sometimes gets deleted

heba-eiz opened this issue · comments

Sometimes, I still haven't discovered the circumstances in which this happens, the first few lines of code get deleted when saving the .cs in VS.

Although not sure what triggered it or when it happens, it might be when I have multiple script-parasite components in the same canvas and I am opening multiple cs files in the same VS solution (this is kind of something I do often, so this is an assumption).

Sorry, I couldn't recreate the error now but happened so many times already. (will update this post if I recreated it)

Did anyone face the same issue?

Thanks for sharing this problem.

So the order is:

  1. Save in Visual Studio
  2. In grasshopper the first few lines are missing?
  • Is it about the runscript part, namespace part, or additional methods part?
  • Is it intermittent or repeatable?

My main suspect would be that the region parser might not work as well as it should. It uses Regex, which is "good enough" for most cases, but if there are complex comments / strings or other regions, it might mess things up.

Could this explain your problem?

The order is correct (the line gets missing in gh, and subsequently in VS as it updates)

Yes. It happens in the runScript only.

I would say intermittently because sometimes it doesn't happen (I still can't figure out what triggers it - plus, I get accustomed to leaving multiple lines of codes, in the beginning, to avoid anything being deleted, so it might be happening more often than I realize).

Hmm.. the region parser might be the problem. Although it did happen in very simple code (a couple of lines in total).

From now on, if I remember, will try to keep a close look at the situation of when this happens.

Just checking: you're sure you're using the last version of scriptparasite? Because it does sound like some of the issues we solved somewhere earlier this year.