Skip to content

Int maxBound causes non-integer JSON value for outline #726

Closed
@alanz

Description

@alanz

See emacs-lsp/lsp-mode#2435

It comes about from the following

       moduleSymbol = hsmodName >>= \case
                 (L (RealSrcSpan l) m) -> Just $
                   (defDocumentSymbol l :: DocumentSymbol)
                     { _name  = pprText m
                     , _kind  = SkFile
                     , _range = Range (Position 0 0) (Position maxBound 0) -- _ltop is 0 0 0 0
                     }

where the HsModule span does not have a reasonable value, due to the way GHC parses a module.

I think we should either limit it to something that can be represented in JSON without going to floating point, or perhaps leave out this span in the outline. Or get the end from the actual length of the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: ghcidetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions