Comments (8)
lsp-bridge代码用的是最新的commit。
我的tailwindcss.json配置如下:
{ "name": "tailwindcss", "languageId": "html", "command": ["tailwindcss-language-server", "--stdio"], "settings": {}, "initializationOptions": { "configuration": { "tailwindCSS": { "emmetCompletions": false, "showPixelEquivalents": true, "rootFontSize": 16, "validate": true, "lint": { "invalidScreen": "error", "invalidVariant": "error", "invalidTailwindDirective": "error", "invalidApply": "error", "invalidConfigPath": "error", "cssConflict": "warning", "recommendedVariantOrder": "warning" }, "experimental": { "classRegex": "" }, "classAttributes": ["class", "className", "ngClass"] } } } }其中的 initializationOptions 是tailwindcss必须要传递的。
从lsp-bridge的日志上看,初始化的参数配置如下:
{ "id": 28384, "method": "initialize", "params": { "processId": 1352672, "rootPath": "/home/evanmeek/Documents/code/project/web/domeland-ui", "clientInfo": { "name": "emacs", "version": "GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)\n of 2022-04-28" }, "rootUri": "file:///home/evanmeek/Documents/code/project/web/domeland-ui", "capabilities": { "workspace": { "configuration": true }, "textDocument": { "completion": { "completionItem": { "snippetSupport": true, "deprecatedSupport": true, "tagSupport": { "valueSet": [ 1 ] } } } } }, "initializationOptions": { "configuration": { "tailwindCSS": { "emmetCompletions": false, "showPixelEquivalents": true, "rootFontSize": 16, "validate": true, "lint": { "invalidScreen": "error", "invalidVariant": "error", "invalidTailwindDirective": "error", "invalidApply": "error", "invalidConfigPath": "error", "cssConflict": "warning", "recommendedVariantOrder": "warning" }, "experimental": { "classRegex": "" }, "classAttributes": [ "class", "className", "ngClass" ] } } } }, "jsonrpc": "2.0" }可以看到自动加上了 capabilities 还做了一些额外的配置,例如 textDocument/completion
但是初始化失败了,得到如下返回数据:
{ "jsonrpc": "2.0", "id": 28384, "error": { "code": -32603, "message": "Request initialize failed with message: Cannot read properties of undefined (reading 'dynamicRegistration')" } }我参考了一下 lsp 的文档 textDocument_completion 。
解决方法可能是: 还得加上 dynamicRegistration 字段? 从报错日志上来看是没有读取到这个属性才出现的问题。
我尝试修改了源码,为 capabilities 的 textDocument/completion 加上 dynamicRegistration 字段 ,仍然会提示这个错误,看来得从tailwindcss server的源码入手了。
from lsp-bridge.
可以研究 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize 关于 dynamicRegistration 的描述
from lsp-bridge.
可以研究 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize 关于 dynamicRegistration 的描述
我仔细看了你所提到的 dynamicRegistration 部分。
我的理解是: dynamicRegistration必须得由client支持才能使用,那么目前lsp-bridge是不支持 dynamicRegistration 所以也间接无法支持tailwindcss server是么?
from lsp-bridge.
可以研究 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize 关于 dynamicRegistration 的描述
我仔细看了你所提到的 dynamicRegistration 部分。
我的理解是: dynamicRegistration必须得由client支持才能使用,那么目前lsp-bridge是不支持 dynamicRegistration 所以也间接无法支持tailwindcss server是么?
你可以先把 initialize 请求中加入 dynamicRegistration 选项,先让 tailwindcss 启动起来,然后他会发送 dynamicRegistration 请求给 lsp-bridge , 到时候我们再看怎么响应它。
先让他启动起来。
from lsp-bridge.
可以研究 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize 关于 dynamicRegistration 的描述
我仔细看了你所提到的 dynamicRegistration 部分。
我的理解是: dynamicRegistration必须得由client支持才能使用,那么目前lsp-bridge是不支持 dynamicRegistration 所以也间接无法支持tailwindcss server是么?你可以先把 initialize 请求中加入 dynamicRegistration 选项,先让 tailwindcss 启动起来,然后他会发送 dynamicRegistration 请求给 lsp-bridge , 到时候我们再看怎么响应它。
先让他启动起来。
我尝试过这么做了。但是server仍然返回提示找不到 dynamicRegistration 这个属性。
from lsp-bridge.
可以研究 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize 关于 dynamicRegistration 的描述
我仔细看了你所提到的 dynamicRegistration 部分。
我的理解是: dynamicRegistration必须得由client支持才能使用,那么目前lsp-bridge是不支持 dynamicRegistration 所以也间接无法支持tailwindcss server是么?你可以先把 initialize 请求中加入 dynamicRegistration 选项,先让 tailwindcss 启动起来,然后他会发送 dynamicRegistration 请求给 lsp-bridge , 到时候我们再看怎么响应它。
先让他启动起来。我尝试过这么做了。但是server仍然返回提示找不到 dynamicRegistration 这个属性。
我的做法是为 https://github.com/evanmeek/lsp-bridge/tree/3e17a8423a844030d685235dfb0476e5f1ce123e/core/lspserver.py 添加 dynamicRegistration属性
"textDocument": {
"completion": {
"dynamicRegistration": False,
"completionItem": {
"snippetSupport": False if not is_snippet_support else True,
"deprecatedSupport": True,
"tagSupport": {"valueSet": [1]},
},
}
},
from lsp-bridge.
试着加上definition/reference等的key,值可以是{},和completion同级的。
错误消息已经告诉了是读undefined的dynamicxxx属性
from lsp-bridge.
先关闭吧,等大佬新作。
from lsp-bridge.
Related Issues (20)
- lsp-bridge-workspace-list-symbols 查询结果集,如果是以 jdt:// 开始,无法正常跳转 HOT 7
- 补全消失 HOT 23
- (redisplay t) is consuming lots of cpu HOT 1
- Question: lsp-bridge-workspace-list-symbols can find the symbol, but lsp-bridge-find-def does not HOT 4
- 在latex启动lsp-bridge-mode后只能补全yasnippet中的模板,不能连接latex lsp服务器 HOT 2
- lsp-bridge-find-def not working with remote HOT 5
- Inlay hints HOT 8
- outdated diagnostic HOT 4
- 能加入mojo支持吗? HOT 8
- enabling lsp-bridge breaks syntax highlighting HOT 3
- I found how to fix Tailwindcss HOT 30
- Pop up buffer stuck on screen HOT 3
- No signature help when using lsp-bridge within org babel source block HOT 3
- Using eldoc & xref for finding references & showing function signature HOT 7
- LSP signature help does not display for most symbols, only when point is inside function parameters [Typescript] HOT 1
- AttributeError: 'NoneType' object has no attribute 'strip' HOT 3
- 安装说明中是否可以增加spacemacs? HOT 2
- acm popup menu not align well with cursor on KDE plasma 6 wayland HOT 5
- 提供选中区域格式化的功能 HOT 9
- Can we reduce the frequency of `redisplay` execution? HOT 4
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 lsp-bridge.