Comments (8)
Inlay hint running in lsp-bridge-monitor-post-command function, maybe we need submit a inlay hint request to LSP server once we open some file.
from lsp-bridge.
I'm not talking about hints after opening file, I'm fine with current behaviour when opening new file.
This is already in open file that is already showing hints in the buffer, then I start typing new function for example:
![pre_kl](https://private-user-images.githubusercontent.com/3064500/319170887-41bafed3-4eb8-4cae-a626-ff8bd9515f7a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzMzQyMjYsIm5iZiI6MTcyNDMzMzkyNiwicGF0aCI6Ii8zMDY0NTAwLzMxOTE3MDg4Ny00MWJhZmVkMy00ZWI4LTRjYWUtYTYyNi1mZjhiZDk1MTVmN2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjJUMTMzODQ2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTNmN2MwNmNkZjA4YzdhOThkODVmYzQ2YmUwOTQxOTA2NTI1N2E3MThkYTYxMjZkYjZlOWQzYzA2YzViOTU2YiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.9rZ2w3a1b7VyQrhCk2-c4fZJTnah4dDFFcurkQYOKkg)
So, it's not showing hints until I do C-k (kill-line).
After C-k
![post_kl](https://private-user-images.githubusercontent.com/3064500/319171263-55507b85-7655-42b8-8576-d0e93b099066.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzMzQyMjYsIm5iZiI6MTcyNDMzMzkyNiwicGF0aCI6Ii8zMDY0NTAwLzMxOTE3MTI2My01NTUwN2I4NS03NjU1LTQyYjgtODU3Ni1kMGU5M2IwOTkwNjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjJUMTMzODQ2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWZmMWNhNDc3MmQyYjllMzc0YmJkYWRkMDY1OTk4ZDZhNGVlYTFmY2EzZDMzNDYzYWI3Mzg1MmJjMWE0YTQ4YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.JZtQ3Rf2gZCCe76rMrih7WdtohFxv-gaJNpwDhfowvQ)
I can't figure out what is causing this behaviour because sometimes it does work ok (showing hints after Ret).
I'm trying to figure it out by myself but no luck for now, I would appreciate guidance where to look.
Thanks.
from lsp-bridge.
Reference links:
Line 1199 in a3f5610
lsp-bridge/lsp-bridge-inlay-hint.el
Line 92 in a3f5610
lsp-bridge/lsp-bridge-inlay-hint.el
Line 128 in a3f5610
I recommend that you first enable the option lsp-bridge-enable-log
, then observe the return log of *lsp-bridge*
. From my experience, there are only two reasons:
- The lsp server returned an inlay hint message, and we have not fully parsed it.
- The
lsp-bridge-inlay-hint
function is not sending enough; we need to increase the frequency of sending. Currently, inlay hint requests are only sent after modifying the code or scrolling the window.
Note that the lsp-bridge-enable-log
option will affect performance. Please turn it off after debugging to avoid affecting your normal use.
from lsp-bridge.
I'm seeing that LSP-BRIDGE-INLAY-HINT--RENDER is not being called (when I edit file or press RET) until I do 'kill-line'.
LSP-BRIDGE-INLAY-HINT is being called all the time though.
What I'm seeing in project that doesn't work when I press RET is:
Recv message (error): { "jsonrpc": "2.0", "id": 30617, "error": { "code": -32801, "message": "content modified" } }
In project that works I get LSP-BRIDGE-INLAY-HINT--RENDER call all the time and no lsp-server errors like this.
from lsp-bridge.
This is from log, every time before the error I see this sequence, I don't know much about lsp protocol but it looks like second "didChange" call is invalidating "inlayHint" request ?
--- [17:07:55.093370] Send textDocument/inlayHint request (11744) to 'rust-analyzer' for project rsbom
--- [17:07:55.096867] Send textDocument/didChange notification to 'rust-analyzer' for project rsbom
Recv message (error):
{
"jsonrpc": "2.0",
"id": 11744,
"error": {
"code": -32801,
"message": "content modified"
}
}
from lsp-bridge.
This looks like some kind of race condition with LSP-BRIDGE-MONITOR-POST-COMMAND and LSP-BRIDGE-MONITOR-AFTER-CHANGE.
When I insert 50ms sleep in LSP-BRIDGE-MONITOR-POST-COMMAND it does work.
from lsp-bridge.
@milanjovanovic Thanks for the detailed research. I have pushed the patch dfabfc8 to fix this problem. Please update and try again. ;)
from lsp-bridge.
Please re-open this issue if update newest version still have problem.
from lsp-bridge.
Related Issues (20)
- Build a multi-thread backend for CAPF
- completion not working on windows with doomemacs HOT 2
- Submit to GNU ELPA HOT 1
- Rust mode does not show expected diagnostic info HOT 1
- Win10行安装后报错: No compression program defined HOT 1
- completion word from a file HOT 4
- basedpyright_ruff issue HOT 1
- dart中import无法补全库名称 HOT 8
- java 多个工程代码跳转的问题 HOT 5
- markdown default lang sever is incorrect HOT 1
- [Feature-Request]/Question: Tree-like view of symbols from lsp-bridge HOT 3
- vscode-html-language-server日志返回candidates为0 HOT 8
- diagnostic功能无法显示整个project的异常 HOT 3
- 在启用auto-insert-mode之后,在打开新.sh文件时会出错 HOT 1
- How to setup for lisp mode? HOT 2
- Tailwindcss and Eslint working with javascriptreact but not typescriptreact. HOT 1
- Support macro expand for rust HOT 6
- auto-completed content comes to end of the line HOT 5
- [Question] Is it possible to enable plugins for pylsp? HOT 1
- 本地文件跳转报错: Forbidden reentrant call of Tramp HOT 3
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.