Comments (4)
Method 'textDocument/formatting' needs as response TextEdit array. PHPParser's pretty printer returns always formatted string and simplest solution is to create one TextEdit to replace whole document. If you don't plan to implement it in near future I can try to do this :) or maybe you have different idea how utilize PHPParser.
from php-language-server.
Yes, I think that is the easiest solution. We currently also sync all textdocuments with full content, it doesn't seem to have significant perf impact, but it reduces complexity. We can adjust the implementation later.
Using PHPParser is of course not required for this, we could look at other formatting tools for PHP. But we already have the AST, so it is easier to just use the formatter, and the pretty printer comes included.
I'm super short on free time atm so yeah I would be more than happy if you implement it :)
from php-language-server.
I was looking for alternative but I didn't found anything actively developed/maintained. For now PHPParser's pretty printer is easy to use but is not customizable. I think it will be easy to replace it with different formatting library if something will came up in the future.
from php-language-server.
We could customize it by subclassing it. Or doing a PR to support some options :)
But I would like to get basic features out as quick as possible, customization can be added later.
from php-language-server.
Related Issues (20)
- VS Code error
- PHP intelisense not working with MacOS 11.3
- open source funding available from Gitpod
- Keep getting alert for PHP 7
- Intellisense is "Unable to open" "Unable to read file" "Error: Unable to resolve non-existing file" after a directory is renamed in PHP Project HOT 1
- not found LanguageServer\StderrLogger
- Extension causes high cpu load
- Language Server Crashing and VS Code is hanged when opening Laravel 8 project with PHP 8.0 HOT 1
- File Copy Participants never finishes
- [Feature request] Autocomplete `$variable` without needing to type the `$`
- [FEATURE] Autocomplete classes in PHP DocBlock
- Requirements could not be resolved.
- New Issue HOT 1
- PHP language server crash in VS Code HOT 1
- __callStatic via trait not absorbed HOT 1
- Plugin Not Starting? - Help me please HOT 1
- more open source funding available from Gitpod HOT 1
- PHP (felixfbecker) language server has excited and exceeded the restart limit HOT 4
- "type is missing before a type separator" HOT 2
- is a malware????
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-language-server.