At this point there are countless issues about the formatting done by CodeSniffer. It plain out doesn't work in many cases, overrides format options that are contributed by other extensions in VS Code and does not reuse any of our AST parsing. For that reason, I am starting to think there is no reason to keep it in here until we have proper pretty-printing support from https://github.com/Microsoft/tolerant-php-parser that actually reuses our ASTs and can work while editing. For people who want to use CodeSniffer to format their code, there could be a standalone CodeSniffer language server (like there is a TSLint language server and ESLint language server). As said, we don't reuse our state anyway.
BREAKING CHANGE: removes formatting support
closes#501closes#474closes#473closes#468closes#450closes#445closes#443closes#423closes#343closes#296closes#293closes#499closes#471
* Add support for method/property completion
* Move completion fixtures into directory
* Add support for variable suggestions
Refactor logic into CompletionProvider class
* Allow getTypeFromNode() to take Variable nodes
* Use property and constant values
* Fix using @var tag for variables
* Improve completion
* classes
* variables with prefix filtering
* Make FQNs more distinct
* use -> for instance methods/properties
* use ::$ for static properties
* Add tests for static access
* Properly filter completion on empty property
* Fix existing tests
* Add support for static access without prefix
* Fix testFullyQualifiedClass
* Add missing fixtures
* Correct file number in init test
* Only insert backslash if not typed yet
* Completion for keywords and bug fixes
* Correct variable insertion
* Support completion for namespaces
* Use CompletionList
* Always set isIncomplete to true
* Update PHPCodeSniffer
* Remove unused method
* And the call
* Handle case where FQN could not be resolved
This PR decouples the LS from direct file system access by implementing the proposals for workspace/files and textDocument/content under workspace/xfiles and textDocument/xcontent. The requests are only used when the client expressed support for them through ClientCapabilities, otherwise direct FS access is used.
This turns document content retrieval and recursive file search into async operations.
In turn, all server handlers can now operate async by returning a promise.
* Implemented workspace symbol search
* Fixed missing TextEdit using declaration
* Fixed generating uri when parsing next file.
* Cleaned up code. Fixed tests
* Fixed PHPDoc for LanguageServer::initialize()
* Moved utility functions to utils.php
* Added tests for pathToUri and findFilesRecursive
* Added command line argument for socket communication
* Fixed local variable detection and containerName generation in SymbolFinder
* Fixed formatting in ProtocolStreamReader
* Store text content in PHPDocument, removed stmts, regenerate on demand
* Fixed local variable detection and containerName generation in SymbolFinder.
* Added Tests for Project and Workspace
* Added test for didChange event
* Modified lexer error handling
* Removed file that shouldn't have been committed.
* Updated sabre/event dependency to 4.0.0
* Updated readme.md to show tcp option
* make input stream non-blocking
* Correct code style
* Use triple equals
* Revert change in SymbolFinder
* Optimize processFile() a bit
* Use MessageType enum instead of number literal
* Add missing space
* Fixed ProtocolStreamWriter for nonblocking connection.
* Suppress fwrite() notice when not all bytes could be written.
* Fix another code style issue
* Throw Exceotion instead of Error
* Added ProtocolStreamWriter test
* Correct workspace/symbol documentation
* Improve exception in ProtocolStreamWriter::write()