Skip to content

Commit

Permalink
move synonyms to new module
Browse files Browse the repository at this point in the history
  • Loading branch information
wz1000 committed May 8, 2020
1 parent a7ffa3e commit ddd8555
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 260 deletions.
1 change: 1 addition & 0 deletions haskell-lsp-types/haskell-lsp-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ library
, Language.Haskell.LSP.Types.Message
, Language.Haskell.LSP.Types.Progress
, Language.Haskell.LSP.Types.Symbol
, Language.Haskell.LSP.Types.Synonyms
, Language.Haskell.LSP.Types.TextDocument
, Language.Haskell.LSP.Types.Types
, Language.Haskell.LSP.Types.Uri
Expand Down
2 changes: 2 additions & 0 deletions haskell-lsp-types/src/Language/Haskell/LSP/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module Language.Haskell.LSP.Types
, module Language.Haskell.LSP.Types.Message
, module Language.Haskell.LSP.Types.Progress
, module Language.Haskell.LSP.Types.Symbol
, module Language.Haskell.LSP.Types.Synonyms
, module Language.Haskell.LSP.Types.TextDocument
, module Language.Haskell.LSP.Types.Types
, module Language.Haskell.LSP.Types.Uri
Expand All @@ -38,6 +39,7 @@ import Language.Haskell.LSP.Types.MarkupContent
import Language.Haskell.LSP.Types.Message
import Language.Haskell.LSP.Types.Progress
import Language.Haskell.LSP.Types.Symbol
import Language.Haskell.LSP.Types.Synonyms
import Language.Haskell.LSP.Types.TextDocument
import Language.Haskell.LSP.Types.Types
import Language.Haskell.LSP.Types.Uri
Expand Down
1 change: 0 additions & 1 deletion haskell-lsp-types/src/Language/Haskell/LSP/Types/Color.hs
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,3 @@ data ColorPresentation =

deriveJSON lspOptions ''ColorPresentation


Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,23 @@ fmServerLogMessageNotification mt msg

-- ----------------------------------------------------------------------

fmServerWorkDoneProgressBeginNotification :: J.ProgressParams J.WorkDoneProgressBeginParams -> J.WorkDoneProgressBeginNotification
fmServerWorkDoneProgressBeginNotification :: J.ProgressParams J.WorkDoneProgressBeginParams -> J.ProgressNotification
fmServerWorkDoneProgressBeginNotification params
= J.NotificationMessage "2.0" J.SProgress (J.Begin <$> params)

-- ----------------------------------------------------------------------

fmServerWorkDoneProgressReportNotification :: J.ProgressParams J.WorkDoneProgressReportParams -> J.WorkDoneProgressReportNotification
fmServerWorkDoneProgressReportNotification :: J.ProgressParams J.WorkDoneProgressReportParams -> J.ProgressNotification
fmServerWorkDoneProgressReportNotification params
= J.NotificationMessage "2.0" J.SProgress (J.Report <$> params)

-- ----------------------------------------------------------------------

fmServerWorkDoneProgressEndNotification :: J.ProgressParams J.WorkDoneProgressEndParams -> J.WorkDoneProgressEndNotification
fmServerWorkDoneProgressEndNotification :: J.ProgressParams J.WorkDoneProgressEndParams -> J.ProgressNotification
fmServerWorkDoneProgressEndNotification params
= J.NotificationMessage "2.0" J.SProgress (J.End <$> params)

fmServerWorkDoneProgressCreateRequest :: J.LspId J.WindowWorkDoneProgressCreate -> J.WorkDoneProgressCreateParams -> J.WorkDoneProgressCreateRequest
fmServerWorkDoneProgressCreateRequest :: J.LspId J.WindowWorkDoneProgressCreate -> J.WorkDoneProgressCreateParams -> J.WindowWorkDoneProgressCreateRequest
fmServerWorkDoneProgressCreateRequest rid params
= J.RequestMessage "2.0" rid J.SWindowWorkDoneProgressCreate params

Expand Down
174 changes: 174 additions & 0 deletions haskell-lsp-types/src/Language/Haskell/LSP/Types/Synonyms.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
{-# LANGUAGE DataKinds #-}
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}

module Language.Haskell.LSP.Types.Synonyms where

import Language.Haskell.LSP.Types.Message
import Language.Haskell.LSP.Types.Types

-- Server Messages

-- Window
type ShowMessageNotification = Message WindowShowMessage

type ShowMessageRequest = Message WindowShowMessageRequest
type ShowMessageResponse = ResponseMessage WindowShowMessageRequest

type LogMessageNotification = Message WindowLogMessage

type WindowWorkDoneProgressCreateRequest = Message WindowWorkDoneProgressCreate
type WindowWorkDoneProgressCreateResponse = ResponseMessage WindowWorkDoneProgressCreate

type ProgressNotification = Message Progress

type TelemetryNotification = Message TelemetryEvent

-- Capability
type RegisterCapabilityRequest = Message ClientRegisterCapability
type RegisterCapabilityResponse = ResponseMessage ClientRegisterCapability

type UnregisterCapabilityRequest = Message ClientUnregisterCapability
type UnregisterCapabilityResponse = ResponseMessage ClientUnregisterCapability

-- Workspace
type WorkspaceFoldersRequest = Message WorkspaceWorkspaceFolders
type WorkspaceFoldersResponse = ResponseMessage WorkspaceWorkspaceFolders

type ConfigurationRequest = Message WorkspaceConfiguration
type ConfigurationResponse = ResponseMessage WorkspaceConfiguration

type ApplyWorkspaceEditRequest = Message WorkspaceApplyEdit
type ApplyWorkspaceEditResponse = ResponseMessage WorkspaceApplyEdit

-- Document/Diagnostic
type PublishDiagnosticsNotification = Message TextDocumentPublishDiagnostics

-- Cancel
type CancelNotificationServer = Message CancelRequest

-- Custom
type CustomServerNotification = Message CustomMethod
type CustomServerRequest = Message CustomMethod

-- Client Messages

-- General
type InitializeRequest = Message Initialize
type InitializeResponse = ResponseMessage Initialize

type InitializedNotification = Message Initialized

type ShutdownRequest = Message Shutdown
type ShutdownResponse = ResponseMessage Shutdown

type ExitNotification = Message Exit
type CancelNotification = Message CancelRequest

-- Workspace
type DidChangeWorkspaceFoldersNotification = Message WorkspaceDidChangeWorkspaceFolders
type DidChangeConfigurationNotification = Message WorkspaceDidChangeConfiguration
type DidChangeWatchedFilesNotification = Message WorkspaceDidChangeWatchedFiles

type WorkspaceSymbolRequest = Message WorkspaceSymbol
type WorkspaceSymbolsResponse = ResponseMessage WorkspaceSymbol

type ExecuteCommandRequest = Message WorkspaceExecuteCommand
type ExecuteCommandResponse = ResponseMessage WorkspaceExecuteCommand

type WorkDoneProgressCancelNotification = Message WorkDoneProgressCancel

-- Document/Sync
type DidOpenTextDocumentNotification = Message TextDocumentDidOpen
type DidChangeTextDocumentNotification = Message TextDocumentDidChange
type WillSaveTextDocumentNotification = Message TextDocumentWillSave

type WillSaveWaitUntilTextDocumentRequest = Message TextDocumentWillSaveWaitUntil
type WillSaveWaitUntilTextDocumentResponse = ResponseMessage TextDocumentWillSaveWaitUntil

type DidSaveTextDocumentNotification = Message TextDocumentDidSave
type DidCloseTextDocumentNotification = Message TextDocumentDidClose

-- Completion

type CompletionRequest = Message TextDocumentCompletion
type CompletionResponse = ResponseMessage TextDocumentCompletion

type CompletionItemResolveRequest = Message CompletionItemResolve
type CompletionItemResolveResponse = ResponseMessage CompletionItemResolve

-- Queries
type HoverRequest = Message TextDocumentHover
type HoverResponse = ResponseMessage TextDocumentHover

type SignatureHelpRequest = Message TextDocumentSignatureHelp
type SignatureHelpResponse = ResponseMessage TextDocumentSignatureHelp

type DefinitionRequest = Message TextDocumentDefinition
type DefinitionResponse = ResponseMessage TextDocumentDefinition

type TypeDefinitionRequest = Message TextDocumentTypeDefinition
type TypeDefinitionResponse = ResponseMessage TextDocumentTypeDefinition

type ImplementationRequest = Message TextDocumentImplementation
type ImplementationResponse = ResponseMessage TextDocumentImplementation

type ReferencesRequest = Message TextDocumentReferences
type ReferencesResponse = ResponseMessage TextDocumentReferences

type DocumentHighlightRequest = Message TextDocumentDocumentHighlight
type DocumentHighlightsResponse = ResponseMessage TextDocumentDocumentHighlight

type DocumentSymbolRequest = Message TextDocumentDocumentSymbol
type DocumentSymbolsResponse = ResponseMessage TextDocumentDocumentSymbol

-- Code Lens/Action/Link

type CodeActionRequest = Message TextDocumentCodeAction
type CodeActionResponse = ResponseMessage TextDocumentCodeAction

type CodeLensRequest = Message TextDocumentCodeLens
type CodeLensResponse = ResponseMessage TextDocumentCodeLens

type CodeLensResolveRequest = Message CodeLensResolve
type CodeLensResolveResponse = ResponseMessage CodeLensResolve

type DocumentLinkRequest = Message TextDocumentDocumentLink
type DocumentLinkResponse = ResponseMessage TextDocumentDocumentLink

type DocumentLinkResolveRequest = Message DocumentLinkResolve
type DocumentLinkResolveResponse = ResponseMessage DocumentLinkResolve

-- Color/Syntax

type DocumentColorRequest = Message TextDocumentDocumentColor
type DocumentColorResponse = ResponseMessage TextDocumentDocumentColor

type ColorPresentationRequest = Message TextDocumentColorPresentation
type ColorPresentationResponse = ResponseMessage TextDocumentColorPresentation


-- Formatting
type DocumentFormattingRequest = Message TextDocumentFormatting
type DocumentFormattingResponse = ResponseMessage TextDocumentFormatting

type DocumentRangeFormattingRequest = Message TextDocumentRangeFormatting
type DocumentRangeFormattingResponse = ResponseMessage TextDocumentRangeFormatting

type DocumentOnTypeFormattingRequest = Message TextDocumentOnTypeFormatting
type DocumentOnTypeFormattingResponse = ResponseMessage TextDocumentOnTypeFormatting

-- Rename
type RenameRequest = Message TextDocumentRename
type RenameResponse = ResponseMessage TextDocumentRename

type PrepareRenameRequest = Message TextDocumentPrepareRename
type PrepareRenameResponse = ResponseMessage TextDocumentPrepareRename

-- Folding
type FoldingRangeRequest = Message TextDocumentFoldingRange
type FoldingRangeResponse = ResponseMessage TextDocumentFoldingRange

-- Custom
type CustomClientNotification = Message CustomMethod
type CustomClientRequest = Message CustomMethod
type CustomResponse = ResponseMessage CustomMethod
Loading

0 comments on commit ddd8555

Please sign in to comment.