-
Notifications
You must be signed in to change notification settings - Fork 1
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
+0x - Plus Symbol Used In Hexadecimal Constant #12
Comments
core/src/language_service/scanner.rs Line 250 in 10101e9
|
The +0x highlighting is working but other issues have popped up. The text for all constants in the CONST..END construct is not highlighted unless that line is selected. Eventually it all fills in. When switching between SCR and SAv1 edit modes, the highlighting for text of constants breaks. The highlighting that was enabled by scrolling over the line is removed when that line is selected. Update: I'm currently using SB v3.8.0. Just used the upgrade tool. Need to retest. |
After retesting with a current SB build; the +0x highlighting is working and no new issues are immediately apparent. I still have problems with larger text scripts. If I edit a line with a constant the highlighting disappears for all constants until I scroll to the const..end construct and edit a line. I suspect this might be resolved by adjusting Sanny's scanning range option but haven't tested the idea. (Never mind, scanning range 1000 fixed this issue.) For some odd reason, these two constants from ePickupType never highlight.
IIRC, this is expected behavior.
text_font is not highlighted. |
Thank you for testing!
can you show how you define and use them ?
|
Um... Well? I defined them shortly before:
Defining the constant twice should break the highlighting. So everything seems to be working properly. |
Curious: In SB v3.8.5, BREAK is highlighting but CONTINUE is not. Nether is defined in keywords.ini since the update. Both are listed under compiler.ini. |
add Break & Continue to keywords.ini |
break is highlighting in SA SCR because of 084C=BREAK |
Is there anything in particular I should be looking for? |
check your example with here is a updated version |
you should find an optimal value for scanning range that works best for you. |
The highlighting seems smoother when loading a large script. It could be that the slower 1000 scan range gives a nice impression when loading. It's difficult to compare the difference though. Everything seems to be highlighting properly. I've got a couple of scripts that are creeping up on the 1000 line scan limit. When working with the default scan range of 250 I was a bit frustrated with the highlighting disappearing from all constants when I edited any line. I kept jumping to the top of the script to tweak a constant definition to get the highlighting back and then struggling to find my place again without breaking the highlighting. The highlighting serves as an automatic spell check - I miss it when it's not up to date. Have you considered a hotkey to manually refresh the highlighting? |
I missed this note before - but it wasn't working until the latest core was installed. |
Tested the new core.dll with mockups for... chained constants. String and Variable types are highlighting too. I'm assuming the the chains actually work when compiled - they did before; this was only a issue with highlighting. An observation that... highlights the advantage of highlighting. When I switched to SCR mode some of the R* constants I pulled out of the Dealer.sc script were highlighted as keywords, suggesting a potential conflict.
sa_scr\keywords.txt
I haven't tried using these constants in SCR mode so I'm not sure what will happen. But it will be a little disappointing if I can't use standard R* constants in SCR scripts. |
|
Rounding out the easy tests: Constants defined in constants.txt are highlighting. I thought I read that this didn't work so I'm glad I ran the test. This time around I'm trying to avoid modifying Sanny's default configuration files. The strategy inevitably leads to problem when sharing scripts with other players. I tend to avoid defining constants in $Include files anyway. Highlighting doesn't work, and there's too much risk of conflicts. Instead. I just copy the constants I intend to use and paste them into the scripts header. I might change this strategy if Sanny included standard sets of definitions. Previous tests suggest that defining large sets of constants in constants.txt can cause a lot of lag in SB. If used conservatively, there are a lot of standard constants that could be defined here, but if everyone doesn't have the same list I don't want to use them. |
they should be highlighted. I just checked and it worked for me. Are you sure they are in the scanning range? Simple test:
script.txt
|
Oh wow! This is so cool. After saving the (Untitled) file Sanny was able to find the path to the $Include file and the highlighting filled in. Now I need to research SB's search path to find the best place to group my enums and constants. Awesome!!!!! |
Everything is highlighting except for "alloc" in |
I was going to say that the only thing that didn't quite seem perfect, were the constants highlighted as keywords from SCR mode. The hint text can clearly tell the difference; maybe the scanner could too. But after thinking about it for a while, I made this mockup of a hybrid SA/SCR snippet to see how it looks in practice.
Given an example like this, a coder might correctly assume that the appropriate constant to use for the task parameter of 062E has the same name as the keyword for 05C9. I am not familiar with task commands; are there other commands and constants that show a similar relationship? I'm thinking, don't change it and call it a feature - Working as Intended. |
it really depends on Coloring Theme. Try other themes, they could highlight them using different colors |
looks like any
|
A bit of a tangent but... I've been searching in vain through the SA source files, looking for enums or constant definitions for the tasks, and finally figured out the easy trick - converting the constants to hex with Ctrl-H.
sa_scr\keywords.txt
The task ID is the same as the associated opcode number. |
The + is used in documentation to indicate a relative offset.
This format works when used as a constant in SB, but the highlighting is lost for the text of the constant.
The text was updated successfully, but these errors were encountered: