-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Fix for multiple build targets at cabal-add #4393
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, do I understand this correctly, we offer to add the dependency to some dependency, even though we should be able to statically tell to which component the filepath belongs to?
let runAvait codeAction = do | ||
executeCodeAction codeAction | ||
skipManyTill anyMessage $ getDocumentEdit cabDoc | ||
mapM_ runAvait selectedCas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let runAvait codeAction = do | |
executeCodeAction codeAction | |
skipManyTill anyMessage $ getDocumentEdit cabDoc | |
mapM_ runAvait selectedCas | |
let runAvail codeAction = do | |
executeCodeAction codeAction | |
skipManyTill anyMessage $ getDocumentEdit cabDoc | |
mapM_ runAvail selectedCas |
Maybe?
Yes, this implementation offers to chose, to what target add the dependency. I think that I can narrow down the list of potential targets using the information from the filepath, but it will take some time to implement. I don't know if it's possible to completely resolve to what target the dependency is related to. |
Fix for multiple build targets at cabal-add
In my current merged solution, cabal-add
CodeAction
is provided only for the main target.This was only a temporary solution due to limitations of the
getBuildTargets
function.For more information, consult this thread.
Now it was fixed, and you can choose to what target add the dependency.
Video with an example:
cabal-add-continuation-cut.mp4
Also, I changed the title for the
CodeAction
, to a hopefully better one.Implementation details
I changed the functions
getBuildTargets
andbuildTargetComponentName
tothe
getBuildTargetComponentNames
that handlesGenericPackageDescription
and givesComponentName
s of all targets.What isn't implemented
CodeAction
. Now this leads to a race condition.