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

Support haskell-lsp 0.21 #1730

Merged
merged 1 commit into from
Mar 31, 2020
Merged

Support haskell-lsp 0.21 #1730

merged 1 commit into from
Mar 31, 2020

Conversation

sjakobi
Copy link
Collaborator

@sjakobi sjakobi commented Mar 30, 2020

Changelogs:

TODO:

  • Address warnings
/home/simon/src/dhall-haskell/dhall-lsp-server/src/Dhall/LSP/Handlers.hs:271:12: warning: [-Wmissing-fields]
    • Fields of ‘J.Diagnostic’ not initialised: _tags
    • In the expression: J.Diagnostic {..}
      In the expression:      
        let                   
          _range = rangeToJSON range
          _severity = Just J.DsHint
          _source = Just "Dhall.Lint"
          ....                
        in J.Diagnostic {..}  
      In an equation for ‘suggestionToDiagnostic’:
          suggestionToDiagnostic Suggestion {..}
            = let             
                _range = rangeToJSON range
                _severity = Just J.DsHint
                ....          
              in J.Diagnostic {..}
    |                         
271 |         in J.Diagnostic {..}
    |            ^^^^^^^^^^^^^^^^^
                              
/home/simon/src/dhall-haskell/dhall-lsp-server/src/Dhall/LSP/Handlers.hs:283:12: warning: [-Wmissing-fields]
    • Fields of ‘J.Diagnostic’ not initialised: _tags
    • In the expression: J.Diagnostic {..}
      In the expression:      
        let                   
          _range              
            = case range of   
                Just range' -> ...
                Nothing -> ...
          _severity = Just J.DsError
          _source = Just doctor
          ....                
        in J.Diagnostic {..}  
      In an equation for ‘diagnosisToDiagnostic’:
          diagnosisToDiagnostic Diagnosis {..}
            = let             
                _range = ...  
                _severity = Just J.DsError
                ....          
              in J.Diagnostic {..}
    |                         
283 |         in J.Diagnostic {..}
    |            ^^^^^^^^^^^^^^^^^
                              
/home/simon/src/dhall-haskell/dhall-lsp-server/src/Dhall/LSP/Handlers.hs:526:32: warning: [-Wmissing-fields]
    • Fields of ‘J.CompletionItem’ not initialised: _tags
    • In the expression: J.CompletionItem {..}
      In an equation for ‘item’:
          item (Completion {..})
            = J.CompletionItem {..}
            where             
                _label = completeText
                _kind = Nothing
                _detail = fmap pretty completeType
                _documentation = Nothing
                ....          
      In the expression:      
        do let uri = request ^. J.params . J.textDocument . J.uri
               line = request ^. J.params . J.position . J.line
               ....           
           txt <- readUri uri 
           let (completionLeadup, completionPrefix)
                 = completionQueryAt txt ...
           let computeCompletions
                 | "env:" `isPrefixOf` completionPrefix
                 = liftIO completeEnvironmentImport
                 | any (`isPrefixOf` completionPrefix) [...] = ...
                 | (target, _) <- Text.breakOnEnd "." completionPrefix,
                   not (Text.null target)
                 = ...        
                 | otherwise = ...
           ....               
    |                         
526 |   let item (Completion {..}) = J.CompletionItem {..}
    |                                ^^^^^^^^^^^^^^^^^^^^^
  • Address test failures
Tests
  Diagnostics
    Dhall.TypeCheck
      reports unbound variables:       FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
      reports wrong type:              FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
    Dhall.Import
      reports invalid imports:         FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
      reports missing imports:         FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
    Dhall.Parser
      reports invalid syntax:          FAIL (60.02s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
  Linting
    Dhall.Lint
      reports unused bindings:         FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
      reports multiple hints:          FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
  Completion
    Dhall.Completion
      suggests user defined types:     FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
      suggests user defined functions: FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
      suggests user defined bindings:  FAIL (60.05s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
      suggests functions from imports: FAIL (60.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
      suggests union alternatives:     FAIL (120.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
  Hovering
    Dhall.Hover
      reports types on hover:          OK (0.01s)

12 out of 13 tests failed (780.69s)

@@ -267,6 +267,7 @@ diagnosticsHandler uri = do
_source = Just "Dhall.Lint"
_code = Nothing
_message = suggestion
_tags = Nothing
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the new field would require tighter lower bounds on haskell-lsp[-types], but then realized that the record wildcards still work with older versions. That's a plus for -XRecordWildcards I guess! :)

@sjakobi sjakobi changed the title WIP: Support haskell-lsp 0.21 Support haskell-lsp 0.21 Mar 30, 2020
@mergify mergify bot merged commit 7fcd18d into master Mar 31, 2020
@sjakobi sjakobi deleted the sjakobi/haskell-lsp-0.21 branch May 6, 2020 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants