GithubHelp home page GithubHelp logo

LSP code action: import module about gleam HOT 6 OPEN

gusinacio avatar gusinacio commented on August 11, 2024 2
LSP code action: import module

from gleam.

Comments (6)

johtso avatar johtso commented on August 11, 2024 3

I agree, lots of situations where you copy and paste code and need to add imports, rather than typing the code and tab completing

from gleam.

lpil avatar lpil commented on August 11, 2024 2

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.

from gleam.

gusinacio avatar gusinacio commented on August 11, 2024 1

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.

from gleam.

lpil avatar lpil commented on August 11, 2024

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?

from gleam.

johtso avatar johtso commented on August 11, 2024

Should this be quite straightforward now that we have this? #3219

from gleam.

Acepie avatar Acepie commented on August 11, 2024

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.

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

from gleam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.