Open gusinacio opened 3 weeks ago
I think that's the error for when you have imported a module but there is no module with that name. Would it be a code action that edits the import to the one that exists with the closest name?
See the following example:
pub fn main() {
io.print("Hello world")
}
I haven't imported gleam/io
yet and that's why I receive the "Unknown module" error.
I'd like to go with my cursor over the io
and have a code action to import it from gleam/io
or other module suggestions.
Should this be quite straightforward now that we have this? https://github.com/gleam-lang/gleam/pull/3219
I'd like to go with my cursor over the
io
and have a code action to import it fromgleam/io
or other module suggestions.
FWIW the behavior you are describing here is almost exactly what the new completion behavior is with #3219 though it still has that issue with duplicating the module name. That being said, once #3240 is merged I think this can be closed as completed
I think it could still be useful to have a code action for when you did not use the autocompletion, though not as high a priority.
I agree, lots of situations where you copy and paste code and need to add imports, rather than typing the code and tab completing
Right now, if I use a module that exists but was not imported yet I receive an error message:
It would be great if we could import directly using a code action