Ok, I have learned how to do the trick.
It seems like the editor keeps the last assumed scripting language in memory, and rewriting the declaration, and even reopening the file does not help to redraw the colors.
However, if I copy the code, paste it in new document, and save it as ASP file, the editor changes it’s present assumed scripting language.
Here are the steps for repeating the bug:
1. Start new document (A), write the following code:
2. Start another new document (B)
3. Copy the code from document A to document B.
4. Save the document B as “test.asp”
At this point you should see the ‘AAAA’ in green.
5. Change the scripting language in declaration to JScript in document B. The syntax coloring does not change.
6. Save the document B. The syntax coloring does not change.
7. Close the document B, reopen it from “recently viewed files” list. The syntax coloring does not change.
8. Create new document C, copy the code from document B to document C (it’s not with JScript declaration). Save the document C. The syntax coloring is now updated.
Whenever the editor has assumed the language, if I then open an ASP file, it is displayed with this assumed language coloring, not the one that could be detectable from the file declaration.
Besides that, there are many files that are used as includes in the main file, and those do not have “@” declaration. There should be at least hacky way (ie, keyword in comments) to tell the editor what is the scripting language. Or, the default language could be set up in options somewhere, or the language could be detected with more advanced algorythm.