code-d
code-d copied to clipboard
auto import
not sure if feasible, but one could possibly suggest imports for methods that are within current includes + stdlib.
Can you explain this further or give an example? I already implemented a function to add imports in workspace-d now which will add many new features but I'm waiting for my PR on libdparse to get merged before I push it. Maybe the new planned release already has that feature. Also check https://github.com/Pure-D/workspace-d/issues for the features I had planned
I think he meant that when you use a symbol from currently not imported module, the import would automatically be added to the source file.
Hm I have that already if you explicitly go to the error and press the code lens. I could also add a command doing that for all issues in the file too though
Would it be possible to add non-imported symbols to the intellisense and import them when a programmer would use them?
That should be possible, I need to see how to optimize it though to avoid lag
👍
@WebFreak001 can you elaborate how to use "code lens" if iam writing writefln
somewhere where i do not import std.stdio i cannot seem to automatically import?
You need to save and there needs to be a red squiggly line under it. If it marks it as error it will trigger a search when you go to the error with the code cursor
i see the squiggly line yes. nothing happens though when i put the cursor there... :(
you've got code-d 2.16.0 right? Only released it yesterday
This would be very nice! I know it's done tremendously well for Java. I would suggest combining this with squiggly lines for unused imports & a 'remove unused imports' command (or automatically removing unused imports upon using the sort imports command).
(Assuming Intellisense finds what you're looking for, I'm having some issues but I may have broken my project)
fixed in serve-d nightly/beta, will get release for all in next code-d + stable serve-d release