dylan-lang / lsp-dylan

Language Server for Dylan (alpha)
MIT License
8 stars 2 forks source link

Improve the flow when abnormal conditions occur in message handlers #15

Open pedro-w opened 1 year ago

pedro-w commented 1 year ago

Just a comment for later: I think our code will be easier to follow if we make invoke-message-handler handle two special kinds of errors, "error" and "aborted"?, which send the error's error message with show-error and show-info respectively. Then we can get rid of all the if/else nesting and use early return style:

if (problem-one)
  signal-lsp-error("i had problem one";
end;
...
if (problem-two)
  signal-lsp-info("i had problem two");
end;
... all good; handle the message...

_Originally posted by @cgay in https://github.com/dylan-lang/lsp-dylan/pull/14#discussion_r967898671_

pedro-w commented 1 year ago

Just put this here so we don't forget