Sublime Forum

JSP syntax highlighting and autocomplete not working for me with build 4126

#1

Updated this morning to Sublime Text Build 4126. Seems to have broken syntax highlighting for my JSP files. JSP highlighting has always been a little wonky, but now it really seems to be off. The file type is set to JSTL. I think the syntax highlighting support comes from a package named st3-jstl-syntax-highlight, so maybe the problem is with that.

The top part of my file, which is a block of Java code, seems to be fine. But when it gets into a mix of CSS/JS/more Java/HTML, the highlighting is off. Keywords and variable names are note highlighted at all. Strings usually have some highlighting, and sometimes, function calls are highlighted. But certainly not useful…

Also, when I starting typing variable or function names, I am no longer getting autocomplete suggestions. That is really slowing me down.

Highlighting and autocomplete are working fine in other file types (like Javascript or Java or HTML).

Any suggestions would be appreciated…

0 Likes

#2

What’s the output of view.syntax() if you execute it in ST console?

0 Likes

#3

Java Server Pages.sublime-syntax has been renamed to HTML (JSP).sublime-syntax.

Maybe the new name causes the syntax from st3-jstl-syntax-highlight to get precedence?

Please try to select Java/HTML (JSP) via “Open all with current extension as…” menu to reassign your jsp extensions to default syntax.

I hope we get https://github.com/sublimehq/Packages/pull/3138 merged in soon. With this PR merged st3-jstl-syntax-highlight package becomes obsolete.

If you still see highlighting issues with HTML (JSP), please feel free to open an issue at https://github.com/sublimehq/Packages/issues with some code examples.

0 Likes

#4

Yes, changing the “Open with current extension as…” menu option to Java / HTML (JSP) corrected my issue. I had previously been set to JSTL, which was probably my closest option when I first started using Sublime.

Autocorrect also working again with this setting.

Thanks!

0 Likes