Magnus pushed to branch wip/mangoiv/ghc-9.12-bp at Glasgow Haskell Compiler / GHC

Commits:

4 changed files:

Changes:

  • compiler/GHC/Core/Utils.hs
    ... ... @@ -345,7 +345,7 @@ mkTick t orig_expr = mkTick' id orig_expr
    345 345
         -- unfoldings. We therefore make an effort to put everything into
    
    346 346
         -- the right place no matter what we start with.
    
    347 347
         Cast e co   -> mkCast (mkTick' rest e) co
    
    348
    -    Coercion co -> Tick t $ rest (Coercion co)
    
    348
    +    Coercion co -> Coercion co
    
    349 349
     
    
    350 350
         Lam x e
    
    351 351
           -- Always float through type lambdas. Even for non-type lambdas,
    

  • testsuite/tests/profiling/should_compile/T27121.hs
    1
    +module T27121 where
    
    2
    +
    
    3
    +import T27121_aux
    
    4
    +
    
    5
    +updateFileDiagnostics
    
    6
    +  :: LanguageContextEnv ()
    
    7
    +  -> IO ()
    
    8
    +updateFileDiagnostics env = do
    
    9
    +  withTrace $ \ _tag ->
    
    10
    +    runLspT env $ do
    
    11
    +      sendNotification SMethod_TextDocumentPublishDiagnostics
    
    12
    +        PublishDiagnosticsParams

  • testsuite/tests/profiling/should_compile/T27121_aux.hs
    1
    +{-# LANGUAGE DataKinds #-}
    
    2
    +{-# LANGUAGE DerivingStrategies #-}
    
    3
    +{-# LANGUAGE DuplicateRecordFields #-}
    
    4
    +{-# LANGUAGE FunctionalDependencies #-}
    
    5
    +{-# LANGUAGE LambdaCase #-}
    
    6
    +{-# LANGUAGE RoleAnnotations #-}
    
    7
    +{-# LANGUAGE TypeFamilies #-}
    
    8
    +
    
    9
    +module T27121_aux
    
    10
    +  ( withTrace
    
    11
    +  , sendNotification
    
    12
    +  , LspT, runLspT
    
    13
    +  , SMethod(..)
    
    14
    +  , LanguageContextEnv
    
    15
    +  , PublishDiagnosticsParams(..)
    
    16
    +  )
    
    17
    + where
    
    18
    +
    
    19
    +-- base
    
    20
    +import Control.Monad.IO.Class ( MonadIO, liftIO )
    
    21
    +import Data.Kind ( Type )
    
    22
    +import GHC.TypeLits ( Symbol )
    
    23
    +
    
    24
    +--------------------------------------------------------------------------------
    
    25
    +
    
    26
    +withTrace :: Monad m => ((String -> String -> m ()) -> m a) -> m a
    
    27
    +withTrace act
    
    28
    +  | myUserTracingEnabled
    
    29
    +  = return undefined
    
    30
    +  | otherwise = act (\_ _ -> pure ())
    
    31
    +{-# NOINLINE withTrace #-}
    
    32
    +
    
    33
    +myUserTracingEnabled :: Bool
    
    34
    +myUserTracingEnabled = False
    
    35
    +{-# NOINLINE myUserTracingEnabled #-}
    
    36
    +
    
    37
    +type Text = String
    
    38
    +
    
    39
    +newtype LspT config a = LspT {unLspT :: LanguageContextEnv config -> IO a}
    
    40
    +
    
    41
    +instance Functor (LspT config) where
    
    42
    +  fmap f (LspT g) = LspT (fmap f . g)
    
    43
    +
    
    44
    +instance Applicative (LspT config) where
    
    45
    +  pure = LspT . const . pure
    
    46
    +  LspT f <*> LspT a = LspT $ \ env -> f env <*> a env
    
    47
    +instance Monad (LspT config) where
    
    48
    +  LspT a >>= f = LspT $ \ env -> do
    
    49
    +    b <- a env
    
    50
    +    unLspT ( f b ) env
    
    51
    +instance MonadIO (LspT config) where
    
    52
    +  liftIO = LspT . const . liftIO
    
    53
    +
    
    54
    +type role LspT representational nominal
    
    55
    +
    
    56
    +runLspT :: LanguageContextEnv config -> LspT config a -> IO a
    
    57
    +runLspT env (LspT f) = f env
    
    58
    +{-# INLINE runLspT #-}
    
    59
    +
    
    60
    +data PublishDiagnosticsParams = PublishDiagnosticsParams
    
    61
    +
    
    62
    +data LanguageContextEnv config =
    
    63
    +  LanguageContextEnv
    
    64
    +    { resSendMessage :: FromServerMessage -> IO () }
    
    65
    +
    
    66
    +
    
    67
    +sendNotification ::
    
    68
    +  forall (m :: Method ServerToClient Notification) f config.
    
    69
    +  MonadLsp config f =>
    
    70
    +  SServerMethod m ->
    
    71
    +  MessageParams m ->
    
    72
    +  f ()
    
    73
    +sendNotification m params =
    
    74
    +  let msg = TNotificationMessage { _method = m, _params = params }
    
    75
    +   in case splitServerMethod m of
    
    76
    +        IsServerNot -> sendToClient $ fromServerNot msg
    
    77
    +
    
    78
    +type Method :: MessageDirection -> MessageKind -> Type
    
    79
    +data Method f t where
    
    80
    +  Method_TextDocumentImplementation :: Method ClientToServer Request
    
    81
    +  Method_TextDocumentTypeDefinition :: Method ClientToServer Request
    
    82
    +  Method_WorkspaceWorkspaceFolders :: Method ServerToClient Request
    
    83
    +  Method_WorkspaceConfiguration :: Method ServerToClient Request
    
    84
    +  Method_TextDocumentDocumentColor :: Method ClientToServer Request
    
    85
    +  Method_TextDocumentColorPresentation :: Method ClientToServer Request
    
    86
    +  Method_TextDocumentFoldingRange :: Method ClientToServer Request
    
    87
    +  Method_TextDocumentDeclaration :: Method ClientToServer Request
    
    88
    +  Method_TextDocumentSelectionRange :: Method ClientToServer Request
    
    89
    +  Method_WindowWorkDoneProgressCreate :: Method ServerToClient Request
    
    90
    +  Method_TextDocumentPrepareCallHierarchy :: Method ClientToServer Request
    
    91
    +  Method_CallHierarchyIncomingCalls :: Method ClientToServer Request
    
    92
    +  Method_CallHierarchyOutgoingCalls :: Method ClientToServer Request
    
    93
    +  Method_TextDocumentSemanticTokensFull :: Method ClientToServer Request
    
    94
    +  Method_TextDocumentSemanticTokensFullDelta :: Method ClientToServer Request
    
    95
    +  Method_TextDocumentSemanticTokensRange :: Method ClientToServer Request
    
    96
    +  Method_WorkspaceSemanticTokensRefresh :: Method ServerToClient Request
    
    97
    +  Method_WindowShowDocument :: Method ServerToClient Request
    
    98
    +  Method_TextDocumentLinkedEditingRange :: Method ClientToServer Request
    
    99
    +  Method_WorkspaceWillCreateFiles :: Method ClientToServer Request
    
    100
    +  Method_WorkspaceWillRenameFiles :: Method ClientToServer Request
    
    101
    +  Method_WorkspaceWillDeleteFiles :: Method ClientToServer Request
    
    102
    +  Method_TextDocumentMoniker :: Method ClientToServer Request
    
    103
    +  Method_TextDocumentPrepareTypeHierarchy :: Method ClientToServer Request
    
    104
    +  Method_TypeHierarchySupertypes :: Method ClientToServer Request
    
    105
    +  Method_TypeHierarchySubtypes :: Method ClientToServer Request
    
    106
    +  Method_TextDocumentInlineValue :: Method ClientToServer Request
    
    107
    +  Method_WorkspaceInlineValueRefresh :: Method ServerToClient Request
    
    108
    +  Method_TextDocumentInlayHint :: Method ClientToServer Request
    
    109
    +  Method_InlayHintResolve :: Method ClientToServer Request
    
    110
    +  Method_WorkspaceInlayHintRefresh :: Method ServerToClient Request
    
    111
    +  Method_TextDocumentDiagnostic :: Method ClientToServer Request
    
    112
    +  Method_WorkspaceDiagnostic :: Method ClientToServer Request
    
    113
    +  Method_WorkspaceDiagnosticRefresh :: Method ServerToClient Request
    
    114
    +  Method_ClientRegisterCapability :: Method ServerToClient Request
    
    115
    +  Method_ClientUnregisterCapability :: Method ServerToClient Request
    
    116
    +  Method_Initialize :: Method ClientToServer Request
    
    117
    +  Method_Shutdown :: Method ClientToServer Request
    
    118
    +  Method_WindowShowMessageRequest :: Method ServerToClient Request
    
    119
    +  Method_TextDocumentWillSaveWaitUntil :: Method ClientToServer Request
    
    120
    +  Method_TextDocumentCompletion :: Method ClientToServer Request
    
    121
    +  Method_CompletionItemResolve :: Method ClientToServer Request
    
    122
    +  Method_TextDocumentHover :: Method ClientToServer Request
    
    123
    +  Method_TextDocumentSignatureHelp :: Method ClientToServer Request
    
    124
    +  Method_TextDocumentDefinition :: Method ClientToServer Request
    
    125
    +  Method_TextDocumentReferences :: Method ClientToServer Request
    
    126
    +  Method_TextDocumentDocumentHighlight :: Method ClientToServer Request
    
    127
    +  Method_TextDocumentDocumentSymbol :: Method ClientToServer Request
    
    128
    +  Method_TextDocumentCodeAction :: Method ClientToServer Request
    
    129
    +  Method_CodeActionResolve :: Method ClientToServer Request
    
    130
    +  Method_WorkspaceSymbol :: Method ClientToServer Request
    
    131
    +  Method_WorkspaceSymbolResolve :: Method ClientToServer Request
    
    132
    +  Method_TextDocumentCodeLens :: Method ClientToServer Request
    
    133
    +  Method_CodeLensResolve :: Method ClientToServer Request
    
    134
    +  Method_WorkspaceCodeLensRefresh :: Method ServerToClient Request
    
    135
    +  Method_TextDocumentDocumentLink :: Method ClientToServer Request
    
    136
    +  Method_DocumentLinkResolve :: Method ClientToServer Request
    
    137
    +  Method_TextDocumentFormatting :: Method ClientToServer Request
    
    138
    +  Method_TextDocumentRangeFormatting :: Method ClientToServer Request
    
    139
    +  Method_TextDocumentOnTypeFormatting :: Method ClientToServer Request
    
    140
    +  Method_TextDocumentRename :: Method ClientToServer Request
    
    141
    +  Method_TextDocumentPrepareRename :: Method ClientToServer Request
    
    142
    +  Method_WorkspaceExecuteCommand :: Method ClientToServer Request
    
    143
    +  Method_WorkspaceApplyEdit :: Method ServerToClient Request
    
    144
    +  Method_WorkspaceDidChangeWorkspaceFolders :: Method ClientToServer Notification
    
    145
    +  Method_WindowWorkDoneProgressCancel :: Method ClientToServer Notification
    
    146
    +  Method_WorkspaceDidCreateFiles :: Method ClientToServer Notification
    
    147
    +  Method_WorkspaceDidRenameFiles :: Method ClientToServer Notification
    
    148
    +  Method_WorkspaceDidDeleteFiles :: Method ClientToServer Notification
    
    149
    +  Method_NotebookDocumentDidOpen :: Method ClientToServer Notification
    
    150
    +  Method_NotebookDocumentDidChange :: Method ClientToServer Notification
    
    151
    +  Method_NotebookDocumentDidSave :: Method ClientToServer Notification
    
    152
    +  Method_NotebookDocumentDidClose :: Method ClientToServer Notification
    
    153
    +  Method_Initialized :: Method ClientToServer Notification
    
    154
    +  Method_Exit :: Method ClientToServer Notification
    
    155
    +  Method_WorkspaceDidChangeConfiguration :: Method ClientToServer Notification
    
    156
    +  Method_WindowShowMessage :: Method ServerToClient Notification
    
    157
    +  Method_WindowLogMessage :: Method ServerToClient Notification
    
    158
    +  Method_TelemetryEvent :: Method ServerToClient Notification
    
    159
    +  Method_TextDocumentDidOpen :: Method ClientToServer Notification
    
    160
    +  Method_TextDocumentDidChange :: Method ClientToServer Notification
    
    161
    +  Method_TextDocumentDidClose :: Method ClientToServer Notification
    
    162
    +  Method_TextDocumentDidSave :: Method ClientToServer Notification
    
    163
    +  Method_TextDocumentWillSave :: Method ClientToServer Notification
    
    164
    +  Method_WorkspaceDidChangeWatchedFiles :: Method ClientToServer Notification
    
    165
    +  Method_TextDocumentPublishDiagnostics :: Method ServerToClient Notification
    
    166
    +  Method_SetTrace :: Method ClientToServer Notification
    
    167
    +  Method_LogTrace :: Method ServerToClient Notification
    
    168
    +  Method_CancelRequest :: Method f Notification
    
    169
    +  Method_Progress :: Method f Notification
    
    170
    +  Method_CustomMethod :: Symbol -> Method f t
    
    171
    +
    
    172
    +type SMethod :: forall f t . Method f t -> Type
    
    173
    +data SMethod m where
    
    174
    +  SMethod_TextDocumentImplementation :: SMethod Method_TextDocumentImplementation
    
    175
    +  SMethod_TextDocumentTypeDefinition :: SMethod Method_TextDocumentTypeDefinition
    
    176
    +  SMethod_WorkspaceWorkspaceFolders :: SMethod Method_WorkspaceWorkspaceFolders
    
    177
    +  SMethod_WorkspaceConfiguration :: SMethod Method_WorkspaceConfiguration
    
    178
    +  SMethod_TextDocumentDocumentColor :: SMethod Method_TextDocumentDocumentColor
    
    179
    +  SMethod_TextDocumentColorPresentation :: SMethod Method_TextDocumentColorPresentation
    
    180
    +  SMethod_TextDocumentFoldingRange :: SMethod Method_TextDocumentFoldingRange
    
    181
    +  SMethod_TextDocumentDeclaration :: SMethod Method_TextDocumentDeclaration
    
    182
    +  SMethod_TextDocumentSelectionRange :: SMethod Method_TextDocumentSelectionRange
    
    183
    +  SMethod_WindowWorkDoneProgressCreate :: SMethod Method_WindowWorkDoneProgressCreate
    
    184
    +  SMethod_TextDocumentPrepareCallHierarchy :: SMethod Method_TextDocumentPrepareCallHierarchy
    
    185
    +  SMethod_CallHierarchyIncomingCalls :: SMethod Method_CallHierarchyIncomingCalls
    
    186
    +  SMethod_CallHierarchyOutgoingCalls :: SMethod Method_CallHierarchyOutgoingCalls
    
    187
    +  SMethod_TextDocumentSemanticTokensFull :: SMethod Method_TextDocumentSemanticTokensFull
    
    188
    +  SMethod_TextDocumentSemanticTokensFullDelta :: SMethod Method_TextDocumentSemanticTokensFullDelta
    
    189
    +  SMethod_TextDocumentSemanticTokensRange :: SMethod Method_TextDocumentSemanticTokensRange
    
    190
    +  SMethod_WorkspaceSemanticTokensRefresh :: SMethod Method_WorkspaceSemanticTokensRefresh
    
    191
    +  SMethod_WindowShowDocument :: SMethod Method_WindowShowDocument
    
    192
    +  SMethod_TextDocumentLinkedEditingRange :: SMethod Method_TextDocumentLinkedEditingRange
    
    193
    +  SMethod_WorkspaceWillCreateFiles :: SMethod Method_WorkspaceWillCreateFiles
    
    194
    +  SMethod_WorkspaceWillRenameFiles :: SMethod Method_WorkspaceWillRenameFiles
    
    195
    +  SMethod_WorkspaceWillDeleteFiles :: SMethod Method_WorkspaceWillDeleteFiles
    
    196
    +  SMethod_TextDocumentMoniker :: SMethod Method_TextDocumentMoniker
    
    197
    +  SMethod_TextDocumentPrepareTypeHierarchy :: SMethod Method_TextDocumentPrepareTypeHierarchy
    
    198
    +  SMethod_TypeHierarchySupertypes :: SMethod Method_TypeHierarchySupertypes
    
    199
    +  SMethod_TypeHierarchySubtypes :: SMethod Method_TypeHierarchySubtypes
    
    200
    +  SMethod_TextDocumentInlineValue :: SMethod Method_TextDocumentInlineValue
    
    201
    +  SMethod_WorkspaceInlineValueRefresh :: SMethod Method_WorkspaceInlineValueRefresh
    
    202
    +  SMethod_TextDocumentInlayHint :: SMethod Method_TextDocumentInlayHint
    
    203
    +  SMethod_InlayHintResolve :: SMethod Method_InlayHintResolve
    
    204
    +  SMethod_WorkspaceInlayHintRefresh :: SMethod Method_WorkspaceInlayHintRefresh
    
    205
    +  SMethod_TextDocumentDiagnostic :: SMethod Method_TextDocumentDiagnostic
    
    206
    +  SMethod_WorkspaceDiagnostic :: SMethod Method_WorkspaceDiagnostic
    
    207
    +  SMethod_WorkspaceDiagnosticRefresh :: SMethod Method_WorkspaceDiagnosticRefresh
    
    208
    +  SMethod_ClientRegisterCapability :: SMethod Method_ClientRegisterCapability
    
    209
    +  SMethod_ClientUnregisterCapability :: SMethod Method_ClientUnregisterCapability
    
    210
    +  SMethod_Initialize :: SMethod Method_Initialize
    
    211
    +  SMethod_Shutdown :: SMethod Method_Shutdown
    
    212
    +  SMethod_WindowShowMessageRequest :: SMethod Method_WindowShowMessageRequest
    
    213
    +  SMethod_TextDocumentWillSaveWaitUntil :: SMethod Method_TextDocumentWillSaveWaitUntil
    
    214
    +  SMethod_TextDocumentCompletion :: SMethod Method_TextDocumentCompletion
    
    215
    +  SMethod_CompletionItemResolve :: SMethod Method_CompletionItemResolve
    
    216
    +  SMethod_TextDocumentHover :: SMethod Method_TextDocumentHover
    
    217
    +  SMethod_TextDocumentSignatureHelp :: SMethod Method_TextDocumentSignatureHelp
    
    218
    +  SMethod_TextDocumentDefinition :: SMethod Method_TextDocumentDefinition
    
    219
    +  SMethod_TextDocumentReferences :: SMethod Method_TextDocumentReferences
    
    220
    +  SMethod_TextDocumentDocumentHighlight :: SMethod Method_TextDocumentDocumentHighlight
    
    221
    +  SMethod_TextDocumentDocumentSymbol :: SMethod Method_TextDocumentDocumentSymbol
    
    222
    +  SMethod_TextDocumentCodeAction :: SMethod Method_TextDocumentCodeAction
    
    223
    +  SMethod_CodeActionResolve :: SMethod Method_CodeActionResolve
    
    224
    +  SMethod_WorkspaceSymbol :: SMethod Method_WorkspaceSymbol
    
    225
    +  SMethod_WorkspaceSymbolResolve :: SMethod Method_WorkspaceSymbolResolve
    
    226
    +  SMethod_TextDocumentCodeLens :: SMethod Method_TextDocumentCodeLens
    
    227
    +  SMethod_CodeLensResolve :: SMethod Method_CodeLensResolve
    
    228
    +  SMethod_WorkspaceCodeLensRefresh :: SMethod Method_WorkspaceCodeLensRefresh
    
    229
    +  SMethod_TextDocumentDocumentLink :: SMethod Method_TextDocumentDocumentLink
    
    230
    +  SMethod_DocumentLinkResolve :: SMethod Method_DocumentLinkResolve
    
    231
    +  SMethod_TextDocumentFormatting :: SMethod Method_TextDocumentFormatting
    
    232
    +  SMethod_TextDocumentRangeFormatting :: SMethod Method_TextDocumentRangeFormatting
    
    233
    +  SMethod_TextDocumentOnTypeFormatting :: SMethod Method_TextDocumentOnTypeFormatting
    
    234
    +  SMethod_TextDocumentRename :: SMethod Method_TextDocumentRename
    
    235
    +  SMethod_TextDocumentPrepareRename :: SMethod Method_TextDocumentPrepareRename
    
    236
    +  SMethod_WorkspaceExecuteCommand :: SMethod Method_WorkspaceExecuteCommand
    
    237
    +  SMethod_WorkspaceApplyEdit :: SMethod Method_WorkspaceApplyEdit
    
    238
    +  SMethod_WorkspaceDidChangeWorkspaceFolders :: SMethod Method_WorkspaceDidChangeWorkspaceFolders
    
    239
    +  SMethod_WindowWorkDoneProgressCancel :: SMethod Method_WindowWorkDoneProgressCancel
    
    240
    +  SMethod_WorkspaceDidCreateFiles :: SMethod Method_WorkspaceDidCreateFiles
    
    241
    +  SMethod_WorkspaceDidRenameFiles :: SMethod Method_WorkspaceDidRenameFiles
    
    242
    +  SMethod_WorkspaceDidDeleteFiles :: SMethod Method_WorkspaceDidDeleteFiles
    
    243
    +  SMethod_NotebookDocumentDidOpen :: SMethod Method_NotebookDocumentDidOpen
    
    244
    +  SMethod_NotebookDocumentDidChange :: SMethod Method_NotebookDocumentDidChange
    
    245
    +  SMethod_NotebookDocumentDidSave :: SMethod Method_NotebookDocumentDidSave
    
    246
    +  SMethod_NotebookDocumentDidClose :: SMethod Method_NotebookDocumentDidClose
    
    247
    +  SMethod_Initialized :: SMethod Method_Initialized
    
    248
    +  SMethod_Exit :: SMethod Method_Exit
    
    249
    +  SMethod_WorkspaceDidChangeConfiguration :: SMethod Method_WorkspaceDidChangeConfiguration
    
    250
    +  SMethod_WindowShowMessage :: SMethod Method_WindowShowMessage
    
    251
    +  SMethod_WindowLogMessage :: SMethod Method_WindowLogMessage
    
    252
    +  SMethod_TelemetryEvent :: SMethod Method_TelemetryEvent
    
    253
    +  SMethod_TextDocumentDidOpen :: SMethod Method_TextDocumentDidOpen
    
    254
    +  SMethod_TextDocumentDidChange :: SMethod Method_TextDocumentDidChange
    
    255
    +  SMethod_TextDocumentDidClose :: SMethod Method_TextDocumentDidClose
    
    256
    +  SMethod_TextDocumentDidSave :: SMethod Method_TextDocumentDidSave
    
    257
    +  SMethod_TextDocumentWillSave :: SMethod Method_TextDocumentWillSave
    
    258
    +  SMethod_WorkspaceDidChangeWatchedFiles :: SMethod Method_WorkspaceDidChangeWatchedFiles
    
    259
    +  SMethod_TextDocumentPublishDiagnostics :: SMethod Method_TextDocumentPublishDiagnostics
    
    260
    +  SMethod_SetTrace :: SMethod Method_SetTrace
    
    261
    +  SMethod_LogTrace :: SMethod Method_LogTrace
    
    262
    +  SMethod_CancelRequest :: SMethod Method_CancelRequest
    
    263
    +  SMethod_Progress :: SMethod Method_Progress
    
    264
    +
    
    265
    +type SServerMethod (m :: Method ServerToClient t) = SMethod m
    
    266
    +
    
    267
    +data MessageDirection = ServerToClient | ClientToServer
    
    268
    +
    
    269
    +data MessageKind = Notification | Request
    
    270
    +
    
    271
    +
    
    272
    +type ServerNotOrReq :: forall t. Method ServerToClient t -> Type
    
    273
    +data ServerNotOrReq m where
    
    274
    +  IsServerNot ::
    
    275
    +    ( TMessage m ~ TNotificationMessage m
    
    276
    +    ) =>
    
    277
    +    ServerNotOrReq (m :: Method ServerToClient Notification)
    
    278
    +  IsServerReq ::
    
    279
    +    forall (m :: Method ServerToClient Request).
    
    280
    +    ( TMessage m ~ TRequestMessage m
    
    281
    +    ) =>
    
    282
    +    ServerNotOrReq m
    
    283
    +
    
    284
    +type TMessage :: forall f t. Method f t -> Type
    
    285
    +type family TMessage m where
    
    286
    +  TMessage (Method_CustomMethod s :: Method f t) = ()
    
    287
    +  TMessage (m :: Method f Request) = TRequestMessage m
    
    288
    +  TMessage (m :: Method f Notification) = TNotificationMessage m
    
    289
    +
    
    290
    +
    
    291
    +data TNotificationMessage (m :: Method f Notification) = TNotificationMessage
    
    292
    +  { _method :: SMethod m
    
    293
    +  , _params :: MessageParams m
    
    294
    +  }
    
    295
    +
    
    296
    +data TRequestMessage (m :: Method f Request) = TRequestMessage
    
    297
    +
    
    298
    +type MessageParams :: forall f t . Method f t -> Type
    
    299
    +type family MessageParams (m ::  Method f t) where
    
    300
    +  MessageParams Method_TextDocumentPublishDiagnostics = PublishDiagnosticsParams
    
    301
    +
    
    302
    +class MonadIO m => MonadLsp config m | m -> config where
    
    303
    +  getLspEnv :: m (LanguageContextEnv config)
    
    304
    +
    
    305
    +instance MonadLsp config (LspT config) where
    
    306
    +  {-# INLINE getLspEnv #-}
    
    307
    +  getLspEnv = LspT pure
    
    308
    +
    
    309
    +
    
    310
    +{-# INLINE splitServerMethod #-}
    
    311
    +splitServerMethod :: SServerMethod m -> ServerNotOrReq m
    
    312
    +splitServerMethod = \case
    
    313
    +  SMethod_TextDocumentPublishDiagnostics -> IsServerNot
    
    314
    +  SMethod_WindowShowMessage -> IsServerNot
    
    315
    +  SMethod_WindowShowMessageRequest -> IsServerReq
    
    316
    +  SMethod_WindowShowDocument -> IsServerReq
    
    317
    +  SMethod_WindowLogMessage -> IsServerNot
    
    318
    +  SMethod_WindowWorkDoneProgressCreate -> IsServerReq
    
    319
    +  SMethod_Progress -> IsServerNot
    
    320
    +  SMethod_TelemetryEvent -> IsServerNot
    
    321
    +  SMethod_ClientRegisterCapability -> IsServerReq
    
    322
    +  SMethod_ClientUnregisterCapability -> IsServerReq
    
    323
    +  SMethod_WorkspaceWorkspaceFolders -> IsServerReq
    
    324
    +  SMethod_WorkspaceConfiguration -> IsServerReq
    
    325
    +  SMethod_WorkspaceApplyEdit -> IsServerReq
    
    326
    +  SMethod_LogTrace -> IsServerNot
    
    327
    +  SMethod_CancelRequest -> IsServerNot
    
    328
    +  SMethod_WorkspaceCodeLensRefresh -> IsServerReq
    
    329
    +  SMethod_WorkspaceSemanticTokensRefresh -> IsServerReq
    
    330
    +  SMethod_WorkspaceInlineValueRefresh -> IsServerReq
    
    331
    +  SMethod_WorkspaceInlayHintRefresh -> IsServerReq
    
    332
    +  SMethod_WorkspaceDiagnosticRefresh -> IsServerReq
    
    333
    +
    
    334
    +fromServerNot ::
    
    335
    +  forall (m :: Method ServerToClient Notification).
    
    336
    +  TMessage m ~ TNotificationMessage m =>
    
    337
    +  TNotificationMessage m ->
    
    338
    +  FromServerMessage
    
    339
    +fromServerNot m@TNotificationMessage{_method = meth} = FromServerMess meth m
    
    340
    +
    
    341
    +
    
    342
    +data FromServerMessage' a where
    
    343
    +  FromServerMess :: forall t (m :: Method ServerToClient t) a. SMethod m -> TMessage m -> FromServerMessage' a
    
    344
    +  FromServerRsp :: forall (m :: Method ClientToServer Request) a. a m -> TResponseMessage m -> FromServerMessage' a
    
    345
    +
    
    346
    +type FromServerMessage = FromServerMessage' SMethod
    
    347
    +
    
    348
    +data TResponseMessage (m :: Method f Request) = TResponseMessage
    
    349
    +
    
    350
    +sendToClient :: MonadLsp config m => FromServerMessage -> m ()
    
    351
    +sendToClient msg = do
    
    352
    +  f <- resSendMessage <$> getLspEnv
    
    353
    +  liftIO $ f msg
    
    354
    +{-# INLINE sendToClient #-}

  • testsuite/tests/profiling/should_compile/all.T
    ... ... @@ -20,3 +20,4 @@ test('T14931', [test_opts, unless(have_dynamic(), skip)],
    20 20
     test('T15108', [test_opts], compile, ['-O -prof -fprof-auto'])
    
    21 21
     test('T19894', [test_opts, extra_files(['T19894'])], multimod_compile, ['Main', '-v0 -O2 -prof -fprof-auto -iT19894'])
    
    22 22
     test('T20938', [test_opts], compile, ['-O -prof'])
    
    23
    +test('T27121', [test_opts, extra_files(['T27121_aux.hs'])], multimod_compile, ['T27121', '-v0 -O -prof -fprof-auto'])