optional value in CodeAction

24 views
Skip to first unread message

David Smith

unread,
Feb 15, 2019, 12:13:04 PM2/15/19
to Haskell IDE implementation discussion
I was having a look into the code to see how hard it would be to implement https://github.com/haskell/haskell-ide-engine/issues/1086 and I got stuck trying to understand CodeAction. With hsimport I want to have the option to add a symbol, that is the name of the function I want to import. Here is an example GHC error message:

    • Variable not in scope:
        readCreateProcessWithExitCode
          :: process-1.6.3.0:System.Process.Common.CreateProcess
             -> [Char] -> IO (ExitCode, String, String)
    • Perhaps you want to add ‘readCreateProcessWithExitCode’
      to the import list in the import of ‘System.Process’
      (src/Interpreter.hs:11:1-27).

In this case I want to construct 2 CodeActions, one that contains only System.Process and another that contains System.Process and readCreateProcessWithExitCode, how would I construct the second one?

Additionally, does ghc-mod return something extra than the ghc error message? I can't understand from https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Plugin/HsImport.hs#L135 where it is getting the "Perhaps you meant " part from since that isn't in the ghc error. In that case, how can I go about working out what this message looks like?

Alan & Kim Zimmerman

unread,
Feb 15, 2019, 12:21:35 PM2/15/19
to haske...@googlegroups.com
I am going to respond in the issue, as this list is basically not being used.

Alan

--
You received this message because you are subscribed to the Google Groups "Haskell IDE implementation discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-ide...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages