Giter Site home page Giter Site logo

Comments (9)

manateelazycat avatar manateelazycat commented on June 20, 2024

我看了看 LSP 的协议 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#formattingOptions

目前 LSP 协议还不支持指定区域格式化, 因为格式化的调整有可能会调整换行的情况, 目前也没法通过对比LSP Server返回的信息, 在Elisp端精确控制格式化区域。

from lsp-bridge.

manateelazycat avatar manateelazycat commented on June 20, 2024

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_rangeFormatting

from lsp-bridge.

manateelazycat avatar manateelazycat commented on June 20, 2024

Range Format 协议已经支持

977d344

请更新测试, 有任何问题欢迎反馈。

from lsp-bridge.

zijianyue avatar zijianyue commented on June 20, 2024

我用的后端是clangd 18.1,选中区域执行 lsp-bridge-code-format,报错
[LSP-Bridge] Current server not support range format

from lsp-bridge.

manateelazycat avatar manateelazycat commented on June 20, 2024

那就是clangd lsp server不支持局部格式化这个功能

from lsp-bridge.

zijianyue avatar zijianyue commented on June 20, 2024

通过lsp-mode的诊断来看clangd应该是有这个功能的
image

from lsp-bridge.

manateelazycat avatar manateelazycat commented on June 20, 2024

lsp-mode可以支持区域格式化,能否帮忙确认下? 谢谢

from lsp-bridge.

manateelazycat avatar manateelazycat commented on June 20, 2024

我推送了 dd70010

这是补丁解决不同LSP Server range format返回格式不一致的问题, pyright/ruff 返回的是 documentRangeFormattingProvider/rangesSupport, clangd 返回的是 documentRangeFormattingProvider

from lsp-bridge.

zijianyue avatar zijianyue commented on June 20, 2024

太好了,现在正常工作了

from lsp-bridge.

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.