Closed 4Luke4 closed 5 years ago
Quite clear when you look at it, LAF finds END and stops there, everything after that is separated, and the quotes open a new string. I'm not sure how to fix this, though. Need a clear indication that LAF invocation is over.
I'm not sure how to fix this, though. Need a clear indication that LAF invocation is over.
Guess END
should not qualify as the end of a function invocation if it's included in a string (i.e., if it's between two ""
or ~~
......)
Guess
END
should not qualify as the end of a function invocation if it's included in a string (i.e., if it's between two""
or~~
......)
Yeah, only that needs to be in regex terms.
Here's a try... works on the site but not in VScode for some reason. And I don't like how it's 428 steps, anyway.
@burner1024
We must find a solution in any case because this issue is quite annoying IMHO...
I'm open to suggestions.
Probably can color it individually instead of trying to parse the entire invocation. It'll likely bite back at some time, but I don't really see a better option.
Probably can color it individually instead of trying to parse the entire invocation. It'll likely bite back at some time, but I don't really see a better option.
Could you provide a screenshot? What do you mean by "It'll likely bite back at some time"?
It means that it'll likely break again in some other edge cases, and that won't be easily fixable. The core problem is that weidu treats all whitespace the same, while tmlanguage syntax doesn't (specifically, newlines).
@burner1024
What about opening a feature request then?
About what?
About what?
About treating newlines differently from the other whitespace characters (space, TAB and so forth...)
That's impossible, it'll break half the mods.
And just about the same can be accomplished by modders themselves.
I pushed a fix for this. Can you test if nothing else is broken?
I pushed a fix for this. Can you test if nothing else is broken?
There's no available update for the extension.....
Yes, it's not released yet. To use current master, you just clone the repo and press F5 in VScode to run it.
Yes, it's not released yet. To use current master, you just clone the repo and press F5 in VScode to run it.
What should I put under "Select Environment" after pressing F5
?
Huh? Doesn't show that for me. "Launch client", I think.
Huh? Doesn't show that for me. "Launch client", I think.
OK, I'm done.
Unfortunately, now issues occur when the name of a function is a %variable%
(have a look at the attached screenshot)
To tell the truth, %variables% are not correctly identified regardless of your latest fix
LPF
and RET
should be highlighted in red.....
Function name as a variable?! What kind of witchery is this??
Please drop the snippets as text, so I could test.
Function name as a variable?! What kind of witchery is this??
As you probably know, WeiDU's built-in functions (REPLACE_BCS_BLOCK
, search & replace, etc...) are not very reliable when it comes to editing existing scripts.
As a result, DavidW wrote down a series of BCS-editing functions in order to solve that issue. You can find them here.
It was a rethorical question. Anyway, I still need the snippets.
It was a rethorical question. Anyway, I still need the snippets.
What do you mean by "snippets"?
I've already sent you a link to the functions in question.....
The code that you're having problems with, as text.
The code that you're having problems with, as text.
OK, here you go (do you have problems with copy & paste?)
I just need a minimal reproducible example: screenshot and text. That saves time and reduces amount of miscommunication errors.
Pushed an update, how about now? (please test)
I just need a minimal reproducible example: screenshot and text. That saves time and reduces amount of miscommunication errors.
Got it.
So, now there are problems with variable identifiers when launching a function:
After your update – highlighted in white
v1.0.9 – highlighted in orange
What about now?
What about now?
Nope, sorry....
Screenshot and text, please.
Screenshot and text, please.
Text, please.
Text, please.
LAF DELETE_SCRIPT_BLOCK
STR_VAR
script = ~GTSUM00~
match = EVAL "RESPONSE #100[%WNL%%LNL%%MNL%]*END"
END
ACTION_IF !FILE_EXISTS_IN_GAME ~GTGOBRSU.cre~ BEGIN
CREATE "CRE" "GTGOBRSU"
SAY NAME1 @1
SAY NAME2 @1
WRITE_LONG 0x0010 BIT1 // No corpse
WRITE_SHORT 0x0024 30 // Current HP
WRITE_SHORT 0x0026 30 // Maximum HP
WRITE_LONG 0x0028 IDS_OF_SYMBOL (~ANIMATE~ ~GOBLIN_BOW_ELITE~)
END
And now?
And now?
Everything seems to be OK now but a minor issue: you may wanna use different colors for tra references (e.g. @3
) and %variables%
(or vars declaration)....
There are only so many colors. If you have a specific suggestion, I'm listening. Theme editor linked in the topic will help you get an idea about what's possible.
If there are no suggestions, I guess I'm closing this.
If there are no suggestions, I guess I'm closing this.
OK, feel free to close it, I'll think about that for the next update....
Before I forget, there's a minor issue with comments and DEFINE_PATCH_FUNCTION
(or DEFINE_ACTION_FUNCTION
)
Fixed that as well. New release will be up shortly.
Fixed that as well. New release will be up shortly.
Sorry, don't forget about numerical constants (have a look at the same screenshot: they should be highlighted in purple....)
damn, it's back to square one
Let's consider the following example:
All the code that follows this line
match = EVAL "RESPONSE #100[%WNL%%LNL%%MNL%]*END"
is highlighted in yellow (as if a string delimiter is missing).Why!?