-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
[Feature Request] Quick action: add variable "not in scope" to function arguments and as local definition (using where or let) #337
Comments
This was causing the following error when trying to build under MinGW: [28 of 38] Compiling Development.IDE.Core.FileStore C:\Snapshot\src\ghcide\src\Development\IDE\Core\FileStore.hs:142:20: error: Not in scope: `Dir.getModificationTime' No module named `Dir' is imported. | 142 | do time <- Dir.getModificationTime f | ^^^^^^^^^^^^^^^^^^^^^^^
Seems to me this one would be great. |
Another quick action could be test2 :: String
test2 = id x
to test2 :: String
test2 = id x
where x :: String
x = error "not implemented" |
@jneira some people prefer let bindings, would that be a setting or would we have 2 actions? One way to think about it is to have 1 action per possibility
|
totally agree, thanks for noting it |
Cool :) I'm pushing further the thoughts, stop me now if it's not relevant to talk about it here. Say I have a = foo
where
foo = bar baz
where bar = fmap I get a = foo
where
foo = bar baz
where
bar = fmap
baz = error "not implemented" or a = foo
where
foo = bar baz
where
bar = fmap
baz = error "not implemented" ? Same question for |
Well, i think it could be 2 alternatives, not totally exclusive:
First one needs some indirection but it is more elegant and less invasive cause it uses less code actions and their number is fixed, not depending on the subexpression tree deep. |
Say I have:
x
is not defined/not in scope ofprint
Quick action could insert variable inside and change type:
The text was updated successfully, but these errors were encountered: