Closed yaegassy closed 2 years ago
I think if you can get ansible-language-server's ansibleLint.ts
to handle it properly without using window.showErrorMessage
, this problem will be solved.
https://github.com/ansible/ansible-language-server/blob/main/src/services/ansibleLint.ts#L133-L135
// ...snip
} catch (error) {
if (error instanceof Error) {
const execError = error as ExecException & {
// according to the docs, these are always available
stdout: string;
stderr: string;
};
if (execError.code === 2) {
diagnostics = this.processReport(
execError.stdout,
await ansibleLintConfigPromise,
workingDirectory
);
} else {
// Here
this.connection.window.showErrorMessage(execError.message); // <-- Here
}
if (execError.stderr) {
this.connection.console.info(`[ansible-lint] ${execError.stderr}`);
}
} else {
this.connection.console.error(
`Exception in AnsibleLint service: ${JSON.stringify(error)}`
);
}
}
// ...snip
I reported an issue (feature request) to ansible-language-server
It is likely to be adjusted in the future.
Description
If there are syntax errors problems, you will get a very unimpressive error message. I was surprised to see a bright red error screen. :(
It would be nice if the language server side, could handle it properly... :(
coc-ansible
Same for "VSCode" (vscode-ansible)