| 1 | package PLS::Server::Method::TextDocument; | ||||||||||
| 2 | |||||||||||
| 3 | 13 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 13 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 13 | ▶ | use PLS::Server::Request::TextDocument::Completion; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 13 | ▶ | use PLS::Server::Request::TextDocument::Definition; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 13 | ▶ | use PLS::Server::Request::TextDocument::DidChange; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 13 | ▶ | use PLS::Server::Request::TextDocument::DidClose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 13 | ▶ | use PLS::Server::Request::TextDocument::DidOpen; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 13 | ▶ | use PLS::Server::Request::TextDocument::DidSave; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 13 | ▶ | use PLS::Server::Request::TextDocument::DocumentSymbol; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 13 | ▶ | use PLS::Server::Request::TextDocument::Formatting; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 13 | ▶ | use PLS::Server::Request::TextDocument::Hover; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 13 | ▶ | use PLS::Server::Request::TextDocument::SignatureHelp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 13 | ▶ | use PLS::Server::Request::TextDocument::RangeFormatting; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | =head1 NAME | ||||||||||
| 19 | |||||||||||
| 20 | PLS::Server::Method::TextDocument | ||||||||||
| 21 | |||||||||||
| 22 | =head1 DESCRIPTION | ||||||||||
| 23 | |||||||||||
| 24 | This module redirects requests starting with C<textDocument/> to the appropriate | ||||||||||
| 25 | subclass of L<PLS::Server::Request> for the type of request. | ||||||||||
| 26 | |||||||||||
| 27 | Requests currently implemented: | ||||||||||
| 28 | |||||||||||
| 29 | =over | ||||||||||
| 30 | |||||||||||
| 31 | =item textDocument/definition - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition> | ||||||||||
| 32 | |||||||||||
| 33 | L<PLS::Server::Request::TextDocument::Definition> | ||||||||||
| 34 | |||||||||||
| 35 | =item textDocument/documentSymbol - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol> | ||||||||||
| 36 | |||||||||||
| 37 | L<PLS::Server::Request::TextDocument::DocumentSymbol> | ||||||||||
| 38 | |||||||||||
| 39 | =item textDocument/hover - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover> | ||||||||||
| 40 | |||||||||||
| 41 | L<PLS::Server::Request::TextDocument::Hover> | ||||||||||
| 42 | |||||||||||
| 43 | =item textDocument/signatureHelp - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_signatureHelp> | ||||||||||
| 44 | |||||||||||
| 45 | L<PLS::Server::Request::TextDocument::SignatureHelp> | ||||||||||
| 46 | |||||||||||
| 47 | =item textDocument/didOpen - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didOpen> | ||||||||||
| 48 | |||||||||||
| 49 | L<PLS::Server::Request::TextDocument::DidOpen> | ||||||||||
| 50 | |||||||||||
| 51 | =item textDocument/didChange - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didChange> | ||||||||||
| 52 | |||||||||||
| 53 | L<PLS::Server::Request::TextDocument::DidChange> | ||||||||||
| 54 | |||||||||||
| 55 | =item textDocument/didClose - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didClose> | ||||||||||
| 56 | |||||||||||
| 57 | L<PLS::Server::Request::TextDocument::DidClose> | ||||||||||
| 58 | |||||||||||
| 59 | =item textDocument/didSave - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didSave> | ||||||||||
| 60 | |||||||||||
| 61 | L<PLS::Server::Request::TextDocument::DidSave> | ||||||||||
| 62 | |||||||||||
| 63 | =item textDocument/formatting - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting> | ||||||||||
| 64 | |||||||||||
| 65 | L<PLS::Server::Request::TextDocument::Formatting> | ||||||||||
| 66 | |||||||||||
| 67 | =item textDocument/rangeFormatting - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rangeFormatting> | ||||||||||
| 68 | |||||||||||
| 69 | L<PLS::Server::Request::TextDocument::RangeFormatting> | ||||||||||
| 70 | |||||||||||
| 71 | =item textDocument/completion - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion> | ||||||||||
| 72 | |||||||||||
| 73 | L<PLS::Server::Request::TextDocument::Completion> | ||||||||||
| 74 | |||||||||||
| 75 | =back | ||||||||||
| 76 | |||||||||||
| 77 | =cut | ||||||||||
| 78 | |||||||||||
| 79 | sub get_request | ||||||||||
| 80 | 3 | ▶ | { | ||||||||
|
Subroutine
get_request: called CC=12 SCAR=34.0
Pod
undocumented
| |||||||||||
| 81 | 3 | my ($request) = @_; | |||||||||
| 82 | |||||||||||
| 83 | 3 | my (undef, $method) = split m{/}, $request->{method}; | |||||||||
| 84 | |||||||||||
| 85 | 3 | ▶ | if ($method eq 'definition') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 86 | { | ||||||||||
| 87 | 0 | return PLS::Server::Request::TextDocument::Definition->new($request); | |||||||||
| 88 | } | ||||||||||
| 89 | 3 | ▶ | if ($method eq 'documentSymbol') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 90 | { | ||||||||||
| 91 | 0 | return PLS::Server::Request::TextDocument::DocumentSymbol->new($request); | |||||||||
| 92 | } | ||||||||||
| 93 | 3 | ▶ | if ($method eq 'hover') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 94 | { | ||||||||||
| 95 | 0 | return PLS::Server::Request::TextDocument::Hover->new($request); | |||||||||
| 96 | } | ||||||||||
| 97 | 3 | ▶ | if ($method eq 'signatureHelp') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 98 | { | ||||||||||
| 99 | 0 | return PLS::Server::Request::TextDocument::SignatureHelp->new($request); | |||||||||
| 100 | } | ||||||||||
| 101 | 3 | ▶ | if ($method eq 'didOpen') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 102 | { | ||||||||||
| 103 | 2 | return PLS::Server::Request::TextDocument::DidOpen->new($request); | |||||||||
| 104 | } | ||||||||||
| 105 | 1 | ▶ | if ($method eq 'didChange') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 106 | { | ||||||||||
| 107 | 0 | return PLS::Server::Request::TextDocument::DidChange->new($request); | |||||||||
| 108 | } | ||||||||||
| 109 | 1 | ▶ | if ($method eq 'didClose') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 110 | { | ||||||||||
| 111 | 0 | return PLS::Server::Request::TextDocument::DidClose->new($request); | |||||||||
| 112 | } | ||||||||||
| 113 | 1 | ▶ | if ($method eq 'didSave') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 114 | { | ||||||||||
| 115 | 0 | return PLS::Server::Request::TextDocument::DidSave->new($request); | |||||||||
| 116 | } | ||||||||||
| 117 | 1 | ▶ | if ($method eq 'formatting') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 118 | { | ||||||||||
| 119 | 1 | return PLS::Server::Request::TextDocument::Formatting->new($request); | |||||||||
| 120 | } | ||||||||||
| 121 | 0 | ▶ | if ($method eq 'rangeFormatting') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 122 | { | ||||||||||
| 123 | 0 | return PLS::Server::Request::TextDocument::RangeFormatting->new($request); | |||||||||
| 124 | } | ||||||||||
| 125 | 0 | ▶ | if ($method eq 'completion') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 126 | { | ||||||||||
| 127 | 0 | return PLS::Server::Request::TextDocument::Completion->new($request); | |||||||||
| 128 | } | ||||||||||
| 129 | } ## end sub get_request | ||||||||||
| 130 | |||||||||||
| 131 | 13 | 1; | |||||||||