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

Auto import feature #618

Open
tcak opened this issue Jun 4, 2015 · 3 comments
Open

Auto import feature #618

tcak opened this issue Jun 4, 2015 · 3 comments

Comments

@tcak
Copy link

tcak commented Jun 4, 2015

In Eclipse, we press on "Ctrl+Shift+O", and generally a window comes that lists what classes to import into project. Mono-D is already able to capture what unknown variables or functions are available in the code. Then I thought, if an XML, JSON, or SQLite was used to store full module name of known modules (Phobos' example), it could be possible to bring a window with a list of modules to import into project automatically. At first, defining it for even only "std.stdio" would be quite useful. Later the improvement could be done in time.

@aBothe
Copy link
Owner

aBothe commented Jun 4, 2015

First off: Good idea.
What do you mean with 'import into project' in D terms?
Referencing an include path and a library in the project build configuration?
Or putting in an import package.with.symbol; for all symbols that are unknown in your currently edited code?
[Edit] Or both, i.e. putting in an include path (and import-statement) to the build config when you type a class name that is even unknown to your currently edited project(s)?

I got access to all available module names and such, so the technical solution shouldn't be that difficult to realize.

@tcak
Copy link
Author

tcak commented Jun 4, 2015

I wanted to say import into current code file, not project.

Just to keep everything simple at first, inserting an line "import package.with.symbol" would enough for now. Once the base is ready, other things can be added.

Let's say "writeln" is found, but linker is complaining about it. When "Ctrl+Shift+O" is pressed, check the list with "endsWith" (ignore case for better search maybe) to match "writeln". If there are more than one match, you can ask in a window which one to import.

@aBothe
Copy link
Owner

aBothe commented Jun 4, 2015

I suppose, when starting the 'auto import all unresolved symbols', a list shall popup that shows the modules to import.
Furthermore, single items may be deselected (like when you prefer importing a package.d instead of the actual module).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants