Giter VIP home page Giter VIP logo

Comments (7)

soywod avatar soywod commented on June 22, 2024 1

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.

andys8 avatar andys8 commented on June 22, 2024 1

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.

nwolverson avatar nwolverson commented on June 22, 2024 1

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.

nwolverson avatar nwolverson commented on June 22, 2024

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.

milesfrain avatar milesfrain commented on June 22, 2024

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.

thomashoneyman avatar thomashoneyman commented on June 22, 2024

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.

andys8 avatar andys8 commented on June 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.