Skip to content
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 configuration error display #164

Merged
merged 2 commits into from
Aug 9, 2024
Merged

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Aug 8, 2024

No description provided.

Comment on lines +200 to +203
throw fromZodError(parsed.error, {
prefix: `Error parsing config file ${configURI?.fsPath}:`,
prefixSeparator: "\n",
issueSeparator: ";\n",
unionSeparator: "\n or\n",
});
Copy link
Member Author

Choose a reason for hiding this comment

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

There was a full mechanism for handling thrown errors, but instead a lot of places logged errors instead. Defaulting to throwing in most places now.

Comment on lines +27 to +32
const { sendNotification: originalSendNotification } = connection;
connection.sendNotification = async (...args: [any, ...any[]]) => {
await whenConnectionInitialized;
connection.sendNotification = originalSendNotification;
connection.sendNotification(...args);
};
Copy link
Member Author

Choose a reason for hiding this comment

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

All sendNotification calls before the LSP client was fully started were swallowed previously - this included Debug.error etc.
This queues them instead.

Comment on lines -64 to -65
await whenConnectionInitialized;

Copy link
Member Author

Choose a reason for hiding this comment

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

This was the one place that already had handling for that - we don't need that exception anymore.

@phryneas phryneas force-pushed the pr/fix-configuration-error-display branch from 8423e82 to 4318a11 Compare August 8, 2024 16:27
@phryneas
Copy link
Member Author

phryneas commented Aug 8, 2024

No ideas why tests are failing on this, they pass locally. Gotta take a look tomorrow.

@phryneas phryneas force-pushed the pr/fix-configuration-error-display branch from 258cc99 to af8b2ae Compare August 9, 2024 08:53
@phryneas
Copy link
Member Author

phryneas commented Aug 9, 2024

So... --runInBand fixes this. 🤷

@phryneas phryneas force-pushed the pr/fix-configuration-error-display branch 2 times, most recently from 87c95db to 10d6866 Compare August 9, 2024 11:35
Base automatically changed from pr/better-config-handling to main August 9, 2024 15:28
An error occurred while trying to automatically change base from pr/better-config-handling to main August 9, 2024 15:28
@phryneas phryneas force-pushed the pr/fix-configuration-error-display branch from 10d6866 to 9f461ea Compare August 9, 2024 15:31
@phryneas phryneas merged commit 54316f2 into main Aug 9, 2024
7 checks passed
@phryneas phryneas deleted the pr/fix-configuration-error-display branch August 9, 2024 15:35
@github-actions github-actions bot mentioned this pull request Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants