diff options
-rw-r--r-- | ghc/GHCi/UI.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T10576a.stdout | 2 | ||||
-rwxr-xr-x | testsuite/tests/ghci/scripts/all.T | 6 |
3 files changed, 14 insertions, 7 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 7dc253b894..97b5f57447 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -3466,9 +3466,18 @@ completeMacro = wrapIdentCompleter $ \w -> do completeIdentifier line@(left, _) = -- Note: `left` is a reversed input case left of - (x:_) | isSymbolChar x -> wrapCompleter (specials ++ spaces) complete line - _ -> wrapIdentCompleter complete line + ('.':_) -> wrapCompleter (specials ++ spaces) complete line + -- operator or qualification + (x:_) | isSymbolChar x -> wrapCompleter (specials ++ spaces) + complete (takeOpChars line) -- operator + _ -> wrapIdentCompleter complete (takeIdentChars line) where + takeOpChars (l, r) = (takeWhile isSymbolChar l, r) -- #10576 + -- An operator contains only symbol characters + takeIdentChars (l, r) = (takeWhile notOpChar l, r) + -- An identifier doesn't contain symbol characters with the + -- exception of a dot + notOpChar c = (not .isSymbol ) c || c == '.' complete w = do rdrs <- GHC.getRdrNamesInScope dflags <- GHC.getSessionDynFlags diff --git a/testsuite/tests/ghci/scripts/T10576a.stdout b/testsuite/tests/ghci/scripts/T10576a.stdout index 8949cff3e4..1069c6ac77 100644 --- a/testsuite/tests/ghci/scripts/T10576a.stdout +++ b/testsuite/tests/ghci/scripts/T10576a.stdout @@ -1,2 +1,2 @@ 1 1 "" -"\2600\2600"
\ No newline at end of file +"\9728\9728"
\ No newline at end of file diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 13b2b73b6c..64f87bc7e2 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -240,10 +240,8 @@ 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', [extra_files(['T10576.hs']), expect_broken(10576)], - ghci_script, ['T10576a.script']) -test('T10576b', [extra_files(['T10576.hs']), expect_broken(10576)], - ghci_script, ['T10576b.script']) +test('T10576a', extra_files(['T10576.hs']), ghci_script, ['T10576a.script']) +test('T10576b', extra_files(['T10576.hs']), ghci_script, ['T10576b.script']) test('T11051a', normal, ghci_script, ['T11051a.script']) test('T11051b', normal, ghci_script, ['T11051b.script']) test('T11266', ignore_stdout, ghci_script, ['T11266.script']) |