Skip to content

Commit 648dd25

Browse files
committed
fix(formatting): drop PHP CodeSniffer
BREAKING CHANGE: removes formatting support closes #501 closes #474 closes #473 closes #468 closes #450 closes #445 closes #443 closes #423 closes #343 closes #296 closes #293 closes #499 closes #471
1 parent 1db6b7b commit 648dd25

11 files changed

+0
-258
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ For Parameters, it will return the `@param` tag.
4141
The query is matched case-insensitively against the fully qualified name of the symbol.
4242
Non-Standard: An empty query will return _all_ symbols found in the workspace.
4343

44-
### [Document Formatting](https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#document-formatting-request)
45-
![Document Formatting demo](images/formatDocument.gif)
46-
4744
### Error reporting through [Publish Diagnostics](https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#publishdiagnostics-notification)
4845
![Error reporting demo](images/publishDiagnostics.png)
4946

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"phpdocumentor/reflection-docblock": "^4.0.0",
3131
"sabre/event": "^5.0",
3232
"sabre/uri": "^2.0",
33-
"squizlabs/php_codesniffer": "3.0.0RC3",
3433
"webmozart/glob": "^4.1",
3534
"webmozart/path-util": "^2.3"
3635
},

fixtures/format.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

fixtures/format_expected.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Formatter.php

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/LanguageServer.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ public function initialize(ClientCapabilities $capabilities, string $rootPath =
265265
$serverCapabilities->documentSymbolProvider = true;
266266
// Support "Find all symbols in workspace"
267267
$serverCapabilities->workspaceSymbolProvider = true;
268-
// Support "Format Code"
269-
$serverCapabilities->documentFormattingProvider = true;
270268
// Support "Go to definition"
271269
$serverCapabilities->definitionProvider = true;
272270
// Support "Find all references"

src/PhpDocument.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,6 @@ public function updateContent(string $content)
166166
$this->sourceFileNode = $treeAnalyzer->getSourceFileNode();
167167
}
168168

169-
/**
170-
* Returns array of TextEdit changes to format this document.
171-
*
172-
* @return \LanguageServer\Protocol\TextEdit[]
173-
*/
174-
public function getFormattedText()
175-
{
176-
if (empty($this->getContent())) {
177-
return [];
178-
}
179-
return Formatter::format($this->getContent(), $this->uri);
180-
}
181-
182169
/**
183170
* Returns this document's text content.
184171
*

src/Server/TextDocument.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,6 @@ public function didClose(TextDocumentIdentifier $textDocument)
159159
$this->documentLoader->close($textDocument->uri);
160160
}
161161

162-
/**
163-
* The document formatting request is sent from the server to the client to format a whole document.
164-
*
165-
* @param TextDocumentIdentifier $textDocument The document to format
166-
* @param FormattingOptions $options The format options
167-
* @return Promise <TextEdit[]>
168-
*/
169-
public function formatting(TextDocumentIdentifier $textDocument, FormattingOptions $options)
170-
{
171-
return $this->documentLoader->getOrLoad($textDocument->uri)->then(function (PhpDocument $document) {
172-
return $document->getFormattedText();
173-
});
174-
}
175-
176162
/**
177163
* The references request is sent from the client to the server to resolve project-wide references for the symbol
178164
* denoted by the given text document position.

tests/FormatterTest.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/LanguageServerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public function testInitialize()
3434
$serverCapabilities->textDocumentSync = TextDocumentSyncKind::FULL;
3535
$serverCapabilities->documentSymbolProvider = true;
3636
$serverCapabilities->workspaceSymbolProvider = true;
37-
$serverCapabilities->documentFormattingProvider = true;
3837
$serverCapabilities->definitionProvider = true;
3938
$serverCapabilities->referencesProvider = true;
4039
$serverCapabilities->hoverProvider = true;

tests/Server/TextDocument/FormattingTest.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)