You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if there was a code action for hiding imports which are unused and being shadowed by local declarations.
This is complicated because it requires some detailed information on the provenance of these names in order to hide them (for example if they are record fields).
An example:
Given the following warning:
triangle/Main.hs:83:26: warning: [-Wname-shadowing]
This binding for ‘window’ shadows the existing bindings
imported from ‘Graphics.Vulkan’ at triangle/Main.hs:(29,1)-(45,59)
(and originally defined in ‘Graphics.Vulkan.Extensions.VK_NN_vi_surface’)
imported from ‘Graphics.Vulkan’ at triangle/Main.hs:(29,1)-(45,59)
(and originally defined in ‘Graphics.Vulkan.Extensions.VK_KHR_xlib_surface’)
imported from ‘Graphics.Vulkan’ at triangle/Main.hs:(29,1)-(45,59)
(and originally defined in ‘Graphics.Vulkan.Extensions.VK_KHR_xcb_surface’)
imported from ‘Graphics.Vulkan’ at triangle/Main.hs:(29,1)-(45,59)
(and originally defined in ‘Graphics.Vulkan.Extensions.VK_KHR_android_surface’)
As a first step, we can try to implement a mechanism to hide a symbol that is name shadowing and can improve this with some time!
There are two different implementation paths ahead:
Porting the Hsimport Plugin and adding suitable code-actions (might be hard since the hsimport plugin is a complicated piece of software)
HLS at 0fd73f8 gives really good code actions for resolving ambiguous functions
It would be great to see the same machinery modified for name shadowing cases. At the very least to hide the imported clashing name if it is not actually used in the file.
Initially taken from: haskell/haskell-ide-engine#1191
As a first step, we can try to implement a mechanism to hide a symbol that is name shadowing and can improve this with some time!
There are two different implementation paths ahead:
The text was updated successfully, but these errors were encountered: