Commit b3eb8fad authored by Geraldus's avatar Geraldus Committed by Ben Gamari
Browse files

Complete operators properly



Fix operator completions: list of suitable completions only rather than
everything from imported modules.
Signed-off-by: Geraldus's avatarArthur Fayzrakhmanov (Артур Файзрахманов) <heraldhoi@gmail.com>

ghc: fix operator completions

Reviewers: austin, hvr, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1058

GHC Trac Issues: #10576
parent d1ce1aa9
# testcase for operator completions, e.g. `:complete repl ">>"`
test('prog017', normal, ghci_script, ['prog017.script'])
:load TopLevel
:complete repl ".."
-- 9 results from all modules including submodules
:complete repl "..+"
-- should list completions from all modules including submodules
:complete repl "..+="
-- should list one result
:complete repl "Lev"
-- should list completions from submodules
:complete repl "Level1"
-- should list completions from submodule
:complete repl "Level1."
-- should give same results
:complete repl "..>"
:complete repl "..!"
-- for all Unicode tests should be returned list of two results
-- General Punctuation
:complete repl "⁐"
-- currencySymbolR
:complete repl "₽"
-- letterLikeSymbolR
:complete repl "⅀"
-- enclosedAlphanumericsR
:complete repl "⒡"
-- enclosedAlphanumericSupplementR
:complete repl "🄐"
-- enclosedIdeographicSupplementR
:complete repl "🈐"
-- arrowsR
:complete repl "←"
-- supplementalArrowsAR
:complete repl "⟹"
-- supplementalArrowsBR
:complete repl "⤴"
-- supplementalArrowsCR
:complete repl "🡘"
-- miscellaneousSymbolsAndArrowsR
:complete repl "⬤"
-- dingbatArrowsR
:complete repl "➾"
-- mathematicalOperators
:complete repl "∀"
-- miscellaneousMathematicalSymbolsAR
:complete repl "⟑"
-- miscellaneousMathematicalSymbolsBR
:complete repl "⧦"
-- supplementalMathematicalOperatorsR
:complete repl "⨶"
-- mathematicalAlphanumericSymbolsR
:complete repl "𝛌"
-- miscellaneousTechnicalR
:complete repl "⌘"
-- controlPicturesR
:complete repl "␘"
-- characterRecognitionR
:complete repl "⑁"
-- byzantineMusicalSymbolsR
:complete repl "𝀐"
-- musicalSymbolsR
:complete repl "𝄢"
-- ancientGreekMusicalNotationR
:complete repl "𝉀"
-- mahjongTilesR
:complete repl "🀐"
-- dominoTilesR
:complete repl "🀱"
-- playingCardsR
:complete repl "🂿"
-- miscellaneousSymbolsR
:complete repl "☀"
-- miscellaneousSymbolsAndPictographsR
:complete repl "🌓"
-- transportAndMapSymbolsR
:complete repl "🚭"
-- dingbatsR
:complete repl "✔"
-- boxDrawingR
:complete repl "━"
-- blockElementsR
:complete repl "▙"
-- geometricShapesR
:complete repl "△"
-- geometricShapesExtendedR
:complete repl "🞋"
-- ornamentalDingbatsR
:complete repl "🙫"
-- arabicMathematicalAlphabeticSymbolsR
:complete repl "𞺂"
-- alchemicalSymbolsR
:complete repl "🜄"
\ No newline at end of file
9 9 ""
"..!>"
"..+"
"..++"
"..+=.."
"..-"
"..-+"
"..--"
"..="
"..>>"
3 3 ""
"..+"
"..++"
"..+=.."
1 1 ""
"..+=.."
4 4 ""
"Level1...++"
"Level1...-+"
"Level1...--"
"Level2.Level2...+=.."
3 3 ""
"Level1...++"
"Level1...-+"
"Level1...--"
3 3 ""
"Level1...++"
"Level1...-+"
"Level1...--"
1 1 ""
"..>>"
1 1 ""
"..!>"
2 2 ""
"\8272"
"\8272\8273"
2 2 ""
"\8381"
"\8381\8364"
2 2 ""
"\8512"
"\8512\8512"
2 2 ""
"\9377"
"\9377\9412"
2 2 ""
"\127248"
"\127248\127248"
2 2 ""
"\127504"
"\127504\127533"
2 2 ""
"\8592"
"\8592\8594"
2 2 ""
"\10233"
"\10233\10239"
2 2 ""
"\10548"
"\10548\10549"
2 2 ""
"\129112"
"\129112\129173"
2 2 ""
"\11044"
"\11044\11057"
2 2 ""
"\10174"
"\10174\10132"
2 2 ""
"\8704"
"\8704\8921"
2 2 ""
"\10193"
"\10193\10193"
2 2 ""
"\10726"
"\10726\10741"
2 2 ""
"\10806"
"\10806\10987"
2 2 ""
"\120524"
"\120524\120152"
2 2 ""
"\8984"
"\8984\8997"
2 2 ""
"\9240"
"\9240\9249"
2 2 ""
"\9281"
"\9281\9285"
2 2 ""
"\118800"
"\118800\118982"
2 2 ""
"\119074"
"\119074\119239"
2 2 ""
"\119360"
"\119360\119314"
2 2 ""
"\126992"
"\126992\127010"
2 2 ""
"\127025"
"\127025\127079"
2 2 ""
"\127167"
"\127167\127200"
2 2 ""
"\9728"
"\9728\9773"
2 2 ""
"\127763"
"\127763\128007"
2 2 ""
"\128685"
"\128685\128640"
2 2 ""
"\10004"
"\10004\10025"
2 2 ""
"\9473"
"\9473\9539"
2 2 ""
"\9625"
"\9625\9631"
2 2 ""
"\9651"
"\9651\9673"
2 2 ""
"\128907"
"\128907\128943"
2 2 ""
"\128619"
"\128619\128610"
2 2 ""
"\126594"
"\126594\126559"
2 2 ""
"\128772"
"\128772\128874"
module T10576 where
(☀☀) :: () -> () -> ()
(☀☀) _ _ = ()
x1 = undefined :: ()
x2 = undefined :: ()
-- When completing operators take into account spaceless cases
:l T10576.hs
:complete repl "x1☀"
\ No newline at end of file
1 1 ""
"\2600\2600"
\ No newline at end of file
-- When completing operators take into account spaceless cases
:l T10576.hs
:complete repl "x1☀☀x"
\ No newline at end of file
2 2 ""
"x1"
"x2"
\ No newline at end of file
......@@ -234,3 +234,6 @@ test('T10989',
test('T11098', normal, ghci_script, ['T11098.script'])
test('T8316', expect_broken(8316), ghci_script, ['T8316.script'])
test('T11252', normal, ghci_script, ['T11252.script'])
test('T10576a', expect_broken(10576), ghci_script, ['T10576a.script'])
test('T10576b', expect_broken(10576), ghci_script, ['T10576b.script'])
\ No newline at end of file
test('T10549', [], ghci_script, ['T10549.script'])
test('T10549a', [], ghci_script, ['T10549a.script'])
test('T10549a', [], ghci_script, ['T10549a.script'])
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment