Skip to content

Commit 1b0ef42

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
1 parent 1db6b7b commit 1b0ef42

File tree

10 files changed

+0
-257
lines changed

10 files changed

+0
-257
lines changed

README.md

-3
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

-1
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

-20
This file was deleted.

fixtures/format_expected.php

-19
This file was deleted.

src/Formatter.php

-107
This file was deleted.

src/LanguageServer.php

-2
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

-13
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

-14
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

-28
This file was deleted.

tests/Server/TextDocument/FormattingTest.php

-50
This file was deleted.

0 commit comments

Comments
 (0)