Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Add handleServerStderr method + default logging #158

Merged
merged 3 commits into from
Dec 18, 2017

Conversation

alexheretic
Copy link
Contributor

@alexheretic alexheretic commented Dec 7, 2017

As discussed a little in #157 this PR adds stderr handling to a new public method:

/**
 * Called on language server stderr output.
 * @param stderr a chunk of stderr from a language server instance
 */
handleServerStderr(stderr: string, projectPath: string) {
  stderr.split('\n').filter(l => l).forEach(line => this.logger.warn(`stderr ${line}`));
}
  • Restored stderr / childProcess error handling code.
  • Sends stderr chunks to new method, default impl warns per line

Resolves #157

@@ -270,16 +269,6 @@ export default class AutoLanguageClient {
});
}

handleSpawnFailure(err: any): void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need this to report when starting a language server fails to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work though, node processes don't seem to have an error event as the previous (unused) code used to call this method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right thanks, I was looking at process rather than child-

*/
handleServerStderr(stderr: string, projectPath: string) {
this.logger.debug(`stderr ${stderr}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with us logging by default. I wonder if we should chose .error ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was warn in the unused code previously. I don't mind!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be for each line too, the console handles it much better.

@alexheretic
Copy link
Contributor Author

warn instead of error makes sense as stderr could be used for all sorts really.

@alexheretic
Copy link
Contributor Author

@damieng I've squashed the change down and I think we've addressed all the issues. Are there any further problems do you think?

@damieng damieng merged commit 70b8b24 into atom:master Dec 18, 2017
alexheretic added a commit to rust-lang/atom-ide-rust that referenced this pull request Jan 15, 2018
Remove Rls stderr logging code, upstreamed in
atom/atom-languageclient#158
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants