[GHC] #11789: Flag suggestion does not always work

#11789: Flag suggestion does not always work -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Driver | Version: 8.1 Keywords: newcomer | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Usually, GHC is very helpfully telling me about misspelled flags, but sometimes it fails. Did not yet look deeper, but when I wrote `-fppr- cols=1000` it did not suggest `-dppr-cols=1000`. I am not sure if this is due to the `=` or whether it branches on `-f` vs. `-d` earlier. This surely can be improved! Likely newcomer-friendly.. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11789 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11789: Flag suggestion does not always work -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Driver | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11429 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * version: 8.1 => 8.0.1 * related: => #11429 Comment: ghc-8.0.1 never suggests alternative spellings for misspelled //warning// flags. This should be fixed as well. With `-Wno-unrecognised-warning-flags` (#11429), unknown warning flags on the command line are now reported as warnings instead of errors, so they never reach the `unknownFlagsErr` function in `ghc/Main.hs`. The issue with `-fppr-cols=1000` vs `-dppr-cols=1000` is that the edit distance is too large. The flag passed to the fuzzy matcher should probably break at the `'='` character. From `fuzzyLookup` in `compiler/utils/Util.hs`: {{{ -- Work out an approriate match threshold: -- We report a candidate if its edit distance is <= the threshold, -- The threshhold is set to about a quarter of the # of characters the user entered -- Length Threshold -- 1 0 -- Don't suggest *any* candidates -- 2 1 -- for single-char identifiers -- 3 1 -- 4 1 -- 5 1 -- 6 2 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11789#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11789: Flag suggestion does not always work -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11429 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * type: feature request => bug -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11789#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11789: Flag suggestion does not always work -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Driver | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11429 | Differential Rev(s): Phab:D2978 Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => patch * differential: => Phab:D2978 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11789#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11789: Flag suggestion does not always work -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Driver | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11429 | Differential Rev(s): Phab:D2978 Wiki Page: | -------------------------------------+------------------------------------- Comment (by nakaji_dayo): Replying to [comment:3 mpickering]: Sorry for the delay in updating ticket. Thank you for code review and updating the ticket! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11789#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11789: Flag suggestion does not always work
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Driver | Version: 8.0.1
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #11429 | Differential Rev(s): Phab:D2978
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11789: Flag suggestion does not always work -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Driver | Version: 8.0.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11429 | Differential Rev(s): Phab:D2978 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11789#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC