Sublime Forum

Syntax error highlight is not working and no description of error

#1

I installed the Sublime Text, and reinstalled the program (no package was installed).
But I receive abnormal error and/or no description of what I type is wrong.

example:
print("hello
print(“hello”

neither of these are correct.
Only the first row is marked for error; highligted with red, but no description of what is wrong with the code.
The second row is not hinting on any error and has neither highlight nor description of error.

SublimeTextError

0 Likes

#2

Syntax highlighting only tells you what’s wrong, not why (although in this case it’s obvious why; the string is not closed).

If you want diagnostics you need to install a package like LSP and the LSP server for Python, or some other combination of analysis tools.

0 Likes

#4

I guess you mix up things here.

Those tooltips and error markups are dynamically provided by type checkers and linters (a part of what MS calls IntelliSense). They are not part of a syntax definition. Most of Visual Studio’s and VCSs syntax definitions don’t even provide any highlighting of invalid expressions.

Those type checkers and linters are nowerdays provided by so called language-servers with a common interface for text editors to make use of. Hence ST utilizes the same intellisense providers as VSC via LSP package.

Type checking and linting may also be achieved via SublimeLinter.

0 Likes