Comments (7)
Well, the text formatting is part of the LSP spec, so I guess it makes sense to add one. For eg. the client Coc.vim has implemented the formatting. No matter the language I use, it will call the format function (if exists) from the language server.
from purescript-language-server.
In my opinion it would be nice to provide a format handler and delegate the work to purty
. Fail if not installed. The advantage is that there is no need to configure formatting or have a plugin for putty per editor.
from purescript-language-server.
I've definitely come around to the idea that we should "just do it" (before the PR :) ), can always make the option enabled in config if required.
from purescript-language-server.
I'm as yet unconvinced whether this should be in the language server or something external with editor integration; I guess the fact that there only seems to be 1 option does lean towards simply including it.
Welcome opinions
from purescript-language-server.
A few related links that are mostly related to purty with vscode IDE:
There's a vscode extension for purty formatting:
https://github.com/mvakula/vscode-purty
Discussion on consolidating vscode extensions:
nwolverson/vscode-language-purescript#10
purty issue on integration with vscode:
https://gitlab.com/joneshf/purty/-/issues/124
Discourse thread on purty integration with IDE:
https://discourse.purescript.org/t/purty-ide-integration-to-format-on-save/1272
from purescript-language-server.
I'm as yet unconvinced whether this should be in the language server or something external with editor integration; I guess the fact that there only seems to be 1 option does lean towards simply including it.
If we do end up with multiple code formatters that's also not a problem; afaik the language server API is designed to accommodate this. In VSCode, for example, if you have multiple code formatters on your system that can be used for the same language then the editor will ask you to choose which one you want to use (or it can be configured in your settings).
from purescript-language-server.
haskell-ide-engine
(and haskell-language-server
) give the user configuration options to select the formatting provider. elm-language-server
does not because there is only elm-format
.
One could try to detect if purty
is on the PATH
and conditionally set the the formatting provider capability but I haven't seen that before. I think it's easier to fail silently (log) or with an user facing error once the user executes code formatting with the language server.
from purescript-language-server.
Related Issues (20)
- Support configuring spago file/target
- Neovim configuration HOT 6
- BUG: Deleting/renaming modules does NOT purge them from the cache HOT 3
- Support completion for qualified do imports
- Docs: Update formatter section HOT 1
- Organizeing imports deletes comments HOT 1
- Hover (show documentation) does not work with recent coc.nvim HOT 8
- Suggestion: Extend diagnostics on type to buffer switches HOT 1
- Support multiple spans per diagnostic
- Incorrect "Go to definition" behavior for the `Bind` data type.
- E715: Dictionary required when trying to apply sourse.sortImports code action HOT 2
- Breakpoints?
- Use with spaghetto (spago@next)
- amazing stuff; just wondering if it supports eval? like in -- >> HOT 1
- Warning/Error reporting not working? HOT 5
- Action to export HOT 1
- Find references returns no references HOT 1
- Should optional field return null? HOT 1
- Stale errors/warnings stick around after a full build
- Presence of VTA prevents LSP functionality
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 purescript-language-server.