Skip to content

fix(formatting): drop PHP CodeSniffer #504

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 2 commits into from
Nov 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ For Parameters, it will return the `@param` tag.
The query is matched case-insensitively against the fully qualified name of the symbol.
Non-Standard: An empty query will return _all_ symbols found in the workspace.

### [Document Formatting](https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#document-formatting-request)
![Document Formatting demo](images/formatDocument.gif)

### Error reporting through [Publish Diagnostics](https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#publishdiagnostics-notification)
![Error reporting demo](images/publishDiagnostics.png)

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
"phpdocumentor/reflection-docblock": "^4.0.0",
"sabre/event": "^5.0",
"sabre/uri": "^2.0",
"squizlabs/php_codesniffer": "3.0.0RC3",
"webmozart/glob": "^4.1",
"webmozart/path-util": "^2.3"
},
"require-dev": {
"phpunit/phpunit": "^6.3"
"phpunit/phpunit": "^6.3",
"squizlabs/php_codesniffer": "^3.1"
},
"autoload": {
"psr-4": {
Expand Down
20 changes: 0 additions & 20 deletions fixtures/format.php

This file was deleted.

19 changes: 0 additions & 19 deletions fixtures/format_expected.php

This file was deleted.

Binary file removed images/formatDocument.gif
Binary file not shown.
107 changes: 0 additions & 107 deletions src/Formatter.php

This file was deleted.

2 changes: 0 additions & 2 deletions src/LanguageServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ public function initialize(ClientCapabilities $capabilities, string $rootPath =
$serverCapabilities->documentSymbolProvider = true;
// Support "Find all symbols in workspace"
$serverCapabilities->workspaceSymbolProvider = true;
// Support "Format Code"
$serverCapabilities->documentFormattingProvider = true;
// Support "Go to definition"
$serverCapabilities->definitionProvider = true;
// Support "Find all references"
Expand Down
13 changes: 0 additions & 13 deletions src/PhpDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,6 @@ public function updateContent(string $content)
$this->sourceFileNode = $treeAnalyzer->getSourceFileNode();
}

/**
* Returns array of TextEdit changes to format this document.
*
* @return \LanguageServer\Protocol\TextEdit[]
*/
public function getFormattedText()
{
if (empty($this->getContent())) {
return [];
}
return Formatter::format($this->getContent(), $this->uri);
}

/**
* Returns this document's text content.
*
Expand Down
14 changes: 0 additions & 14 deletions src/Server/TextDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,6 @@ public function didClose(TextDocumentIdentifier $textDocument)
$this->documentLoader->close($textDocument->uri);
}

/**
* The document formatting request is sent from the server to the client to format a whole document.
*
* @param TextDocumentIdentifier $textDocument The document to format
* @param FormattingOptions $options The format options
* @return Promise <TextEdit[]>
*/
public function formatting(TextDocumentIdentifier $textDocument, FormattingOptions $options)
{
return $this->documentLoader->getOrLoad($textDocument->uri)->then(function (PhpDocument $document) {
return $document->getFormattedText();
});
}

/**
* The references request is sent from the client to the server to resolve project-wide references for the symbol
* denoted by the given text document position.
Expand Down
28 changes: 0 additions & 28 deletions tests/FormatterTest.php

This file was deleted.

1 change: 0 additions & 1 deletion tests/LanguageServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function testInitialize()
$serverCapabilities->textDocumentSync = TextDocumentSyncKind::FULL;
$serverCapabilities->documentSymbolProvider = true;
$serverCapabilities->workspaceSymbolProvider = true;
$serverCapabilities->documentFormattingProvider = true;
$serverCapabilities->definitionProvider = true;
$serverCapabilities->referencesProvider = true;
$serverCapabilities->hoverProvider = true;
Expand Down
50 changes: 0 additions & 50 deletions tests/Server/TextDocument/FormattingTest.php

This file was deleted.