Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-26114

Completion items are messed up

    XMLWordPrintable

Details

    Description

      With the haskell-language-server, completing "getKeys" in my project gives:

      14:29:01.639 Client
      {"id":"{2a2cbd5c-1b23-4e55-a64b-857b3c971c83}","jsonrpc":"2.0","method":"textDocument/completion","params":{"context":{"triggerKind":1},"position":{"character":17,"line":14},"textDocument":{"uri":"file://****/paddle/Paddle1.hs"}}}
      
      14:29:01.715 Server
      {"result":{"items":[{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'Common'*\n* * *\n\n"},"insertText":"getKeys ${1:Keys}","detail":":: Keys -> Set Keysym","label":"getKeys"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL.Raw'*\n* * *\n\n"},"insertText":"getKeyFromScancode","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL.Raw","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyFromScancode","thingParent":null}]},"label":"getKeyFromScancode"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL.Raw.Event'*\n* * *\n\n"},"insertText":"getKeyFromScancode","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL.Raw.Event","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyFromScancode","thingParent":null}]},"label":"getKeyFromScancode"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL.Raw.Event'*\n* * *\n\n"},"insertText":"getKeyboardFocus","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL.Raw.Event","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyboardFocus","thingParent":null}]},"label":"getKeyboardFocus"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL.Raw'*\n* * *\n\n"},"insertText":"getKeyboardFocus","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL.Raw","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyboardFocus","thingParent":null}]},"label":"getKeyboardFocus"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL.Input.Keyboard'*\n* * *\n\n"},"insertText":"getKeyboardState","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL.Input.Keyboard","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyboardState","thingParent":null}]},"label":"getKeyboardState"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL.Raw'*\n* * *\n\n"},"insertText":"getKeyboardState","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL.Raw","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyboardState","thingParent":null}]},"label":"getKeyboardState"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL.Input'*\n* * *\n\n"},"insertText":"getKeyboardState","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL.Input","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyboardState","thingParent":null}]},"label":"getKeyboardState"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL.Raw.Event'*\n* * *\n\n"},"insertText":"getKeyboardState","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL.Raw.Event","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyboardState","thingParent":null}]},"label":"getKeyboardState"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'SDL'*\n* * *\n\n"},"insertText":"getKeyboardState","command":{"title":"extend import","command":"50595:ghcide-completions:extendImport","arguments":[{"importQual":null,"importName":"SDL","doc":"file://****/paddle/Paddle1.hs","newThing":"getKeyboardState","thingParent":null}]},"label":"getKeyboardState"},{"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"*Defined in 'Common'*\n* * *\n\n"},"insertText":"getPressedKeys ${1:KeyPressState}","detail":":: KeyPressState -> Set Keysym","label":"getPressedKeys"}],"isIncomplete":true},"id":"{2a2cbd5c-1b23-4e55-a64b-857b3c971c83}","jsonrpc":"2.0"}
      

      Qt Creator

      • messes up the order, putting "getKeys" at the bottom
      • removes "getKeyFromScancode"

      I understand that it is nice that Qt Creator improves completion for servers that don't return a sensible list themselves, but it should at least optionally possible to just pass through the result in cases where the server does a good job (and possibly better than Qt Creator )

      In this specific case "getKeys" should be the preferred completion result even when Qt Creator fiddles with the results.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            davschul David Schulz
            con Eike Ziller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes