Implement add-import-statement intention
See original GitHub issueFeature Proposal
Intention Action: Add Import Statement
When the cursor is over an unresolved reference which could be resolved by importing a module in the project, an intention should be provided to easily add the import.
Details
- We should look for candidate modules in the user’s source files as well as from
elm-package.json
. I think this is already handled by the plugin since we treatelm-stuff
as a source-root. - If the selected element is a “dotted” name (e.g.
String.length
), then just the module name should be imported (e.g.import String
) - If the selected element is a “bare” name (e.g.
length
), then the value’s name itself should be imported (e.g.import String exposing (length)
)
The last example, length
, would presumably have many candidates. The user should be shown the list of candidate modules to select from.
Related Work
- optimize imports
- convert between importing a value name in a qualified manner (
String.length
) and unqualified (length
) - assuming that we extend code completion to present currently-unresolvable-references, selecting such a result would add an import in a manner similar to this intention
- add-to-exports (see #18)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Implementation intention - Wikipedia
An implementation intention is a self-regulatory strategy in the form of an "if-then plan" that can lead to better goal attainment, as well...
Read more >Achieve Your Goals: The Simple Trick That Doubles Your ...
Research has revealed a simple strategy that you can use to achieve your goals ... Broadly speaking, the format for creating an implementation...
Read more >Implementation Intention Explained: How to DOUBLE YOUR ...
What is an implementation intention ? Simply put: This is a strategy you can use to follow through with the goals that you...
Read more >Code Quality Assistance Tips and Tricks, or How to Make Your ...
... with the use of PyCharm's code intelligence features. ... Next, press Alt+Enter and choose the intention action Create class 'Solver':.
Read more >Implementation Intentions - Use This Simple Formula To Build ...
In this article you will learn how implementation intentions can help you to form new habits quickly and effectivly.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@klazuka The feature is released. I’ve also made
master
branch the master so you don’t need to worry about Elm 0.16 anymore.Done pending release.