-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(compiler): Return error if SemanticError occures [LNG-356] #1126
Conversation
language-server/language-server-api/src/test/scala/aqua/lsp/AquaLSPSpec.scala
Outdated
Show resolved
Hide resolved
Raw.error("Failed to resolve default service id") | ||
): EitherT[Alg, Raw, ServiceRaw] = { | ||
def errored = ErroredPart(expr.name.value) | ||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If error is always the same, this whole for
could be rewritten to for
on OptionT
and converted to EitherT
at the very end.
@@ -23,4 +24,15 @@ trait Semantics[S[_], C] { | |||
ast: Ast[S], | |||
init: C | |||
): ProcessResult | |||
|
|||
def stateToResult(state: CompilerState[S], ctx: C): ProcessResult = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it method of the CompilerState
or object Semantics
? It is strange for it to be a method of semantics trait, it is connected to it only by return type
Co-authored-by: InversionSpaces <[email protected]>
Description
VSCode shows incorrect errors in exported functions
Proposed Changes
Turn state with errors to
CompileError
Implementation Details
Because lsp creates context on errors too, it breaks on finalising headers and shows incorrect error.
Checklist
Reviewer Checklist