haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.72k stars 368 forks source link

Adding placeholders for non-implemented class methods adds non-existant methods #4450

Open fendor opened 1 week ago

fendor commented 1 week ago

Your environment

GHC 9.6.6, arch linux, HLS 2.9.0.1 installed via ghcup

Steps to reproduce

cabal-version:      3.12
name:               hls-megaparsec-bug
version:            0.1.0.0
-- synopsis:
-- description:
license:            NONE
author:             Fendor
maintainer:         fendor@posteo.de
-- copyright:
build-type:         Simple
extra-doc-files:    CHANGELOG.md
-- extra-source-files:

common warnings
    ghc-options: -Wall

library
    import:           warnings
    exposed-modules:  MyLib
    -- other-modules:
    -- other-extensions:
    build-depends:
        base,
        megaparsec

    hs-source-dirs:   src
    default-language: Haskell2010
{-# LANGUAGE FlexibleInstances #-}
module MyLib where
import Text.Megaparsec

instance VisualStream [Int] where

image

Expected behaviour

Should add methods showTokens

Actual behaviour

{-# LANGUAGE FlexibleInstances #-}
module MyLib where
import Text.Megaparsec

instance VisualStream [Int] where
  p1VisualStream = _
  showTokens = _
  tokensLength = _

No idea where p1VisualStream is coming from.