Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hover improvements #97

Closed
alanz opened this issue May 7, 2020 · 5 comments
Closed

hover improvements #97

alanz opened this issue May 7, 2020 · 5 comments
Labels
type: enhancement New feature or request

Comments

@alanz
Copy link
Collaborator

alanz commented May 7, 2020

Some observations from testing with https://github.com/alanz/haskell-language-server/tree/hls-wz1000 at alanz@ebad0a1.

I am using lsp-mode on emacs 26.3, comparing the hover output for Integer in the snippet

{-# LANGUAGE MultiParamTypeClasses #-}
module B where
--
-- TODO2 added by Example2 Plugin directly
--
--
--
foo :: Integer
foo = 4

class Foo a b where
  baz :: a -> b

haskell-ide-engine (1.3)

[Trace - 09:19:58 ] Received response 'textDocument/hover - (47)' in 27ms.
Result: {
  "range": {
    "end": {
      "character": 14,
      "line": 7
    },
    "start": {
      "character": 7,
      "line": 7
    }
  },
  "contents": {
    "value": "Invariant: `Jn#` and `Jp#` are used iff value doesn't fit in `S#`\n\nUseful properties resulting from the invariants:\n\n- \n```haskell\nabs (`S#` _) <= abs (`Jp#` _)\n```\n\n- \n```haskell\nabs (`S#` _) <  abs (`Jn#` _)\n```\n\n\n\n[Documentation](file:///home/alanz/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/share/doc/ghc-8.6.5/html/libraries/integer-gmp-1.0.2.0/GHC-Integer.html#t:Integer)\n\n[Source](file:///home/alanz/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/share/doc/ghc-8.6.5/html/libraries/integer-gmp-1.0.2.0/src/GHC-Integer-Type.html#Integer)\n\ninteger-gmp GHC.Integer.Type",
    "kind": "markdown"
  }
}

The contents of the markdown is

Invariant: `Jn#` and `Jp#` are used iff value doesn't fit in `S#`

Useful properties resulting from the invariants:

- 
```haskell
abs (`S#` _) <= abs (`Jp#` _)
```

- 
```haskell
abs (`S#` _) <  abs (`Jn#` _)
```



[Documentation](file:///home/alanz/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/share/doc/ghc-8.6.5/html/libraries/integer-gmp-1.0.2.0/GHC-Integer.html#t:Integer)

[Source](file:///home/alanz/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/share/doc/ghc-8.6.5/html/libraries/integer-gmp-1.0.2.0/src/GHC-Integer-Type.html#Integer)

integer-gmp GHC.Integer.Type

haskell-language-server as above

[Trace - 09:17:38 ] Received response 'textDocument/hover - (31)' in 12ms.
Result: {
  "range": {
    "end": {
      "character": 14,
      "line": 7
    },
    "start": {
      "character": 7,
      "line": 7
    }
  },
  "contents": {
    "value": "\n```haskell\nInteger\n```\n\n*Defined in ‘GHC.Integer.Type’*\n\n\nInvariant:  `Jn#`  and  `Jp#`  are used iff value doesn't fit in  `S#` \n\nUseful properties resulting from the invariants: \n+ ```haskell\n  abs ( `S#`  _) <= abs ( `Jp#`  _)\n  ```\n\n+ ```haskell\n  abs ( `S#`  _) <  abs ( `Jn#`  _)\n  ```\n\n\n",
    "kind": "markdown"
  }
}

The markdown is

```haskell
Integer
```

*Defined in ‘GHC.Integer.Type’*


Invariant:  `Jn#`  and  `Jp#`  are used iff value doesn't fit in  `S#` 

Useful properties resulting from the invariants: 
+ ```haskell
  abs ( `S#`  _) <= abs ( `Jp#`  _)
  ```

+ ```haskell
  abs ( `S#`  _) <  abs ( `Jn#`  _)
  ```




Emacs renders these as

HIE
hie-hover

HLS
hls-hover

The main problem seems to be that the

```haskell
markup needs to be against the left margin, which is not the case for hls.

@mpickering
Copy link
Contributor

@jneira jneira added the type: enhancement New feature or request label May 25, 2020
@jneira
Copy link
Member

jneira commented Sep 23, 2020

@alanz this one could be closed by #99?

@jneira jneira added the status: needs info Not actionable, because there's missing information label Sep 23, 2020
@alanz
Copy link
Collaborator Author

alanz commented Sep 23, 2020

@jneira I actually think #99 has got lost in the meantime. The Hover info is still not great on emacs, but I have not got round to taking a look again.

@jneira jneira added editor: emacs and removed status: needs info Not actionable, because there's missing information labels Sep 23, 2020
@alanz
Copy link
Collaborator Author

alanz commented Sep 24, 2020

Current master (066ce8b) gives me

image

The red is my emacs highlighting trailing whitespace

pepeiborra pushed a commit that referenced this issue Dec 27, 2020
@michaelpj
Copy link
Collaborator

I'm going to close this as it's very old and unclear if it still is a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants