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

LSP: Show an error message on an invalid named module #3972

Open
ghivert opened this issue Dec 9, 2024 · 5 comments
Open

LSP: Show an error message on an invalid named module #3972

ghivert opened this issue Dec 9, 2024 · 5 comments
Labels
good first issue Good for newcomers help wanted Contributions encouraged priority:medium

Comments

@ghivert
Copy link

ghivert commented Dec 9, 2024

Hi!

Currently, when the LSP opens a Gleam file whose name is incorrect (something like my-module.gleam for instance), nothing happens. It could be nice to let the LSP indicates it as a bug (because gleam build will fail) with a message like "my-module is not a valid name for a Gleam module. You should switch to my_module instead."

@lpil lpil changed the title Show an error message on an invalid named module LSP: Show an error message on an invalid named module Dec 9, 2024
@lpil
Copy link
Member

lpil commented Dec 9, 2024

Good idea! Thank you

@lpil lpil added help wanted Contributions encouraged good first issue Good for newcomers priority:medium labels Dec 9, 2024
@ahuangg
Copy link

ahuangg commented Dec 24, 2024

hello @lpil, would I be able to pick up this issue?

@lpil
Copy link
Member

lpil commented Dec 28, 2024

That would be wonderful! Yes please!

@ahuangg
Copy link

ahuangg commented Dec 30, 2024

I was thinking of implementing the module name validation in the language server engine.rs file within the compile function. The idea is to check if module names are valid similar to this and, if not, add them to the results. Before moving forward and submitting a pull request, I'd love to hear your thoughts on this approach and if there is an alternative solution I missed.

@lpil
Copy link
Member

lpil commented Jan 8, 2025

Wouldn't we want an error to be shown for the command line too? I could see it being useful in that case also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Contributions encouraged priority:medium
Projects
None yet
Development

No branches or pull requests

3 participants