Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on Can all compiler errors be caught by language server?

Parent

Can all compiler errors be caught by language server?

+3
−0

Here is the reasoning:

  1. Compiler error is syntax error
  2. Language server can catch all syntax error
  3. Therefore, all compiler errors can be caught by language server

I have the feeling that this is true, based from my understanding on Language Server Protocol - Wikipedia. But the article doesn't explicitly mention any point of above.

If point 3 is true, then we can say that language server catches compiler error without having a compiler. And as the difference between an IDE and a code editor is just whether the compiler is integrated in it or not, then we can redefine IDE as a code editor with language server. Or we can say that as of today, code editor is IDE, and IDE is code editor, and we only need to use one term. The necessity for using the term IDE has ceased to exist. We only use it as a habit.

Why is VS Code considered as a code editor and not an IDE ? : r/vscode

History

0 comment threads

Post
+3
−0

This started in a comment, but got long and detailed enough that it should be an answer. This answer addresses your first point:

Compiler error is syntax error

No, these are not the same. Syntax errors are errors the compiler catches (I assume that's what you mean by "compiler error".). However, not all errors caught by a compiler are syntax errors.

One example is an assignment to a variable where the expression is a symbol. When that symbol is the name of a variable of the correct type, then that's fine. If the symbol is something that doesn't result in an expression or an expression of the wrong type (depending on language), then it's a compile-time error. However, it is still syntactically correct.

can you give an example for that example? Maybe a piece of code

Consider the Pascal assignment statement:

MyVar := SomeSymbol;

This statement is syntactically correct, since MyVar and SomeSymbol are valid symbol names. If SomeSymbol is the name of a variable that has a compatible type to MyVar, there is no error at all. The same is true if SomeSymbol is the name of a function that returns a value of compatible type. However, it is an error if SomeSymbol is the name of a subroutine, for example.

History

2 comment threads

Using a subroutine name to show something syntactically legal but ultimately an error was only one ex... (2 comments)
Static-type languages vs dynamic-type language (1 comment)
Using a subroutine name to show something syntactically legal but ultimately an error was only one ex...
Olin Lathrop‭ wrote about 1 month ago

Using a subroutine name to show something syntactically legal but ultimately an error was only one example. As noted, even another variable but with incompatible type could be an error in some languages. Also, using symbol names in the first place was to create errors that are syntactically correct was just an example in the first place. In any case, only a single instance show a statement is false is sufficient for the statement to be false. Point 1 in your question is clearly false.

Ooker‭ wrote about 1 month ago · edited about 1 month ago

I get that point 1 is false. I'm just looking for an example that I can understand. If you can provide another one then that is great