Skip to content

Unify request naming #208

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

Merged
merged 1 commit into from
Dec 14, 2019
Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Dec 13, 2019

The naming of notification and request types was inconsistent so far, sometimes having a Request suffix and sometimes missing it.

This PR makes the naming consistent with requests always having the Request suffix and notifications always having the Notification suffix.

It also moves the request types into their own folder and the notification types as well. Some files were split up to allow that separation (e.g. ShutdownRequest and ExitNotification now live in different files).

The only weird naming that came out of this naming scheme is CancelRequestNotification since CancelRequest is the name of the notification as described in the LSP spec.

Renames

Requests

DocumentFormatting -> DocumentFormattingRequest
DocumentRangeFormatting -> DocumentRangeFormattingRequest
DocumentOnTypeFormatting -> DocumentOnTypeFormattingRequest
PollIndex -> PollIndexRequest

Notifications

Exit -> ExitNotification
CancelRequest -> CancelRequestNotification
LogMessage -> LogMessageNotification
DidChangeConfiguration -> DidChangeConfigurationNotification
DidChangeWorkspaceFolders -> DidChangeWorkspaceFoldersNotification
DidOpenTextDocument -> DidOpenTextDocumentNotification
DidCloseTextDocument -> DidCloseTextDocumentNotification
DidChangeTextDocument -> DidChangeTextDocumentNotification
DidSaveTextDocument -> DidSaveTextDocumentNotification
WillSaveTextDocument -> WillSaveTextDocumentNotification
PublishDiagnostics -> PublishDiagnosticsNotification

@ahoppen ahoppen requested a review from benlangmuir as a code owner December 13, 2019 01:25
@ahoppen
Copy link
Member Author

ahoppen commented Dec 13, 2019

@swift-ci Please test

@ahoppen ahoppen force-pushed the unify-request-naming branch from 8da5fb8 to d50df1e Compare December 13, 2019 21:31
@ahoppen
Copy link
Member Author

ahoppen commented Dec 13, 2019

@swift-ci Please test

Request types should always have the suffix Request and notifications
should end with Notification.

Also moved all request and notification types into separate folders to
reduce the number of files in the LanguageServerProtocol folder.
@ahoppen ahoppen force-pushed the unify-request-naming branch from d50df1e to e2d7eed Compare December 13, 2019 21:56
@ahoppen
Copy link
Member Author

ahoppen commented Dec 13, 2019

@swift-ci Please test

@ahoppen ahoppen merged commit beb284f into swiftlang:master Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant