Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No back Code Action ,when cursor in diagostic range. #7

Open
erasin opened this issue Jul 29, 2022 · 0 comments
Open

No back Code Action ,when cursor in diagostic range. #7

erasin opened this issue Jul 29, 2022 · 0 comments

Comments

@erasin
Copy link

erasin commented Jul 29, 2022

When I move cursor to diagostic range, I want get code action, but callback nothing.

If I select diagostic range, lsp will back.

I think if cursor in diagostic range and get back action tip is better.

file: demo1.dot

graph demo {
	"Bowser" ->  {"Chrome" "firefox" "Safari" "..."}
}

cursor in range : no action

 -> {"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[{"code":"DOT4000","message":"Invalid edge operation, use \"--\" in undirected graph","range":{"end":{"character":12,"line":1},"start":{"character":10,"line":1}},"severity":1}]},"range":{"end":{"character":11,"line":1},"start":{"character":10,"line":1}},"textDocument":{"uri":"file:///Users/erasin/Development/uml-demo/demo1.dot"}},"id":41}
 <- {"jsonrpc":"2.0","id":41,"result":null}
 <- null
 -> {"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[{"code":"DOT4000","message":"Invalid edge operation, use \"--\" in undirected graph","range":{"end":{"character":12,"line":1},"start":{"character":10,"line":1}},"severity":1}]},"range":{"end":{"character":12,"line":1},"start":{"character":11,"line":1}},"textDocument":{"uri":"file:///Users/erasin/Development/uml-demo/demo1.dot"}},"id":42}
 <- {"jsonrpc":"2.0","id":42,"result":null}
 <- null

cursor select diagnostics: have action back

 -> {"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[{"code":"DOT4000","message":"Invalid edge operation, use \"--\" in undirected graph","range":{"end":{"character":12,"line":1},"start":{"character":10,"line":1}},"severity":1}]},"range":{"end":{"character":12,"line":1},"start":{"character":10,"line":1}},"textDocument":{"uri":"file:///Users/erasin/Development/uml-demo/demo1.dot"}},"id":43}
 <- {"jsonrpc":"2.0","id":43,"result":[{"title":"Change \"->\" to \"--\".","command":"DOT.changeEdgeOp","arguments":[23,25,"--","file:///Users/erasin/Development/uml-demo/demo1.dot"]},{"title":"Fix all edges to match graph","command":"DOT.convertGraphType","arguments":[[{"start":23,"end":25}],"--",{"start":0,"end":5},"graph","file:///Users/erasin/Development/uml-demo/demo1.dot"]},{"title":"Convert graph to digraph","command":"DOT.convertGraphType","arguments":[[],"->",{"start":0,"end":5},"digraph","file:///Users/erasin/Development/uml-demo/demo1.dot"]}]}
 <- [{"arguments":[23,25,"--","file:///Users/erasin/Development/uml-demo/demo1.dot"],"command":"DOT.changeEdgeOp","title":"Change \"->\" to \"--\"."},{"arguments":[[{"end":25,"start":23}],"--",{"end":5,"start":0},"graph","file:///Users/erasin/Development/uml-demo/demo1.dot"],"command":"DOT.convertGraphType","title":"Fix all edges to match graph"},{"arguments":[[],"->",{"end":5,"start":0},"digraph","file:///Users/erasin/Development/uml-demo/demo1.dot"],"command":"DOT.convertGraphType","title":"Convert graph to digraph"}]

node
v18.6.0

lsp version
1.1.17

os
Macos

termial
Alacritty

editor
helix editor

lang support add ~/.config/helix/language.toml

[[language]]
name = "dot"
scope = "source.dot"
injection-regex = "dot"
file-types = ["dot"]
roots = []
comment-token = "//"
indent = { tab-width = 4, unit = "    " }
language-server = { command = "dot-language-server", args = ["--stdio"] }

[[grammar]]
name = "dot"
source = { git = "https://github.com/rydesun/tree-sitter-dot", rev = "917230743aa10f45a408fea2ddb54bbbf5fbe7b7" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant