[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 <ben@…>): In [changeset:"181688abae5c0b32237a5bd783dfc9667641cce2/ghc" 181688a/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="181688abae5c0b32237a5bd783dfc9667641cce2" Improve suggestion for misspelled flag including '=' (fixes #11789) Test Plan: Added 2 test cases, verified that ghc can suggest in the following cases: - for misspelled flag containing '=', ghc suggests flags that doesn't contain '=' - for misspelled flag containing '=', ghc suggests flags that contains '=' Reviewers: austin, dfeuer, bgamari Reviewed By: dfeuer, bgamari Subscribers: dfeuer, mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2978 GHC Trac Issues: #11789 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11789#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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