How to know if I have a syntax error in my code


#1

Hi, I’m new in atom, and I’d like to know how to configure atom for mark the syntax error in my code. Thanks


#2

Hi there, You’ll have to give us some more details if you want us to help you. Like the language you’re using. Some linters may help you for that, but only if there’s a linter for the language you’re using and if it can detect syntax errors.


#3

Sorry, I did not explain well. Before I used to use Komodo Edit, and when I had a syntax error like does not close a brace properly, komodo warning me the line and the column in the code. Can Atom warning me if I have a syntax error in any language.


#4

As @abe eluded to, there is a package called Linter, which provides this as a service. You install the Linter and e.g. linter-jshint packages (depending on your language of choice) and off you go.


#5

The short answer is no.

The long is that you can’t have a unified validation model that fits every known languages. There’s certainly some rules that are common to many languages, like braces that should always be closed, but you’ll always find a language that have some idioms that breaks these rules. I don’t know how komodo achieve that but I highly doubt that it can detect syntax errors for every languages. It probably supports a wide sets of widely used languages but that doesn’t make it know every languages. What if someone want to write some brainfuck?


#6

It’ll be on a language-by-language basis, is what he’s saying. :stuck_out_tongue:


#7

Thanks for all the answers. Linter is what I was searching.


#8

Thanks for the answer, and you are right, I was reading in komodo that it has some templates like html, php, js, and it detects the syntax error for each language. Thanks for you time.


#9

Is there support for C#?