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

feat: allow context to be stored in location export #187

Closed
wants to merge 1 commit into from

Conversation

crisidev
Copy link
Contributor

I have created a LSP server based on Bacon (great software btw) called bacon-ls (blog post) that makes use of the location export.

This PR allows a new setting called add_context_to_message changing the line export to include all the context from the compiler.

@Canop
Copy link
Owner

Canop commented May 19, 2024

Rather than a add_context_to_message setting, I'd prefer to allow changing the line_format to

line_format = "{kind} {path}:{line}:{column} {message}{context}"

The purpose of the line_format parameter is to allow selecting and partially format what's in the exported line.

This doesn't prevent optimization: we can check whether the format contains {context} before calling extract_diagnostic_context.

If you prefer I do the change, I can do it.

@crisidev
Copy link
Contributor Author

This is fine by me, it achieves the same result and it's a better approach. If you want to implement the change, be my guest :)

@Canop
Copy link
Owner

Canop commented May 19, 2024

Follow up: #188

@crisidev crisidev closed this May 19, 2024
@crisidev
Copy link
Contributor Author

Superseded by #188

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