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

Support file link in hover #376

Closed
CppCXY opened this issue Jun 20, 2024 · 21 comments · Fixed by #379
Closed

Support file link in hover #376

CppCXY opened this issue Jun 20, 2024 · 21 comments · Fixed by #379
Assignees
Labels
enhancement New feature or request hover
Milestone

Comments

@CppCXY
Copy link
Contributor

CppCXY commented Jun 20, 2024

image
When I press x trying to jump, a vscode pops up:
image
I hope that IDEA can jump on its own.

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 20, 2024

In VSCode, the supported URI format is "{uri}#{line}:{col}-{line}:{col}", I hope IDEA can also support this.

@angelozerr
Copy link
Contributor

Could you please share your lsp trace hover.

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 20, 2024

Could you please share your lsp trace hover.

[Trace - 17:22:27] Received response 'textDocument/hover - (45)' in 9ms.
Result: {
  "contents": {
    "kind": "markdown",
    "value": "```lua\nlocal t : ambiguous\n```\n\n___\n[x](file:///C:/Users/zc/Desktop/learn/test2.lua)"
  }
}

@angelozerr
Copy link
Contributor

@CppCXY when you write your issue could you please add it the content of your file too.

It will avoid for me to rewriting your sample file by seeing your screenshot. Thanks!

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 20, 2024

@CppCXY when you write your issue could you please add it the content of your file too.

It will avoid for me to rewriting your sample file by seeing your screenshot. Thanks!

ok, the file:
learn.zip

@angelozerr
Copy link
Contributor

angelozerr commented Jun 20, 2024

In VSCode, the supported URI format is "{uri}#{line}:{col}-{line}:{col}", I hope IDEA can also support this.

You mean that you can write this syntax in your comment?

If yes could you give me a sample?

@angelozerr
Copy link
Contributor

Could you please share your lsp trace hover.

[Trace - 17:22:27] Received response 'textDocument/hover - (45)' in 9ms.
Result: {
  "contents": {
    "kind": "markdown",
    "value": "```lua\nlocal t : ambiguous\n```\n\n___\n[x](file:///C:/Users/zc/Desktop/learn/test2.lua)"
  }
}

Thanks!

@fbricon fbricon added enhancement New feature or request hover labels Jun 20, 2024
@angelozerr
Copy link
Contributor

@CppCXY when you write your issue could you please add it the content of your file too.
It will avoid for me to rewriting your sample file by seeing your screenshot. Thanks!

ok, the file: learn.zip

Sorry I wanted to say to add your content file in the issue like:

--- [x](file:///C:/Users/zc/Desktop/learn/test.lua)
local t

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 20, 2024

@CppCXY when you write your issue could you please add it the content of your file too.
It will avoid for me to rewriting your sample file by seeing your screenshot. Thanks!

ok, the file: learn.zip

Sorry I wanted to say to add your content file in the issue like:

--- [x](file:///C:/Users/zc/Desktop/learn/test.lua)
local t

This file uri is pointing to the file itself.

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 20, 2024

In VSCode, the supported URI format is "{uri}#{line}:{col}-{line}:{col}", I hope IDEA can also support this.

I'm sorry, I was wrong, VSCode only supports {uri}#line.

@angelozerr
Copy link
Contributor

--- [x](file:///C:/Users/zc/Desktop/learn/test.lua)
local t

So you can write this lua file content:

--- [x](file:///C:/Users/zc/Desktop/learn/test.lua#10)
local t

Is that?

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 20, 2024

--- [x](file:///C:/Users/zc/Desktop/learn/test.lua)
local t

So you can write this lua file content:

--- [x](file:///C:/Users/zc/Desktop/learn/test.lua#10)
local t

Is that?

yes

@angelozerr
Copy link
Contributor

Ok and could you write relative path?

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 20, 2024

image
We use this feature to implement Go to types in hover

@angelozerr angelozerr changed the title [feat] support link in hover [feat] support file link in hover Jun 20, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 20, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr added this to the 0.0.3 milestone Jun 21, 2024
@angelozerr
Copy link
Contributor

@CppCXY I have played in vscode with uri

[x](file:///C:/Users/zc/Desktop/learn/test.lua#10)

is working

[x](file:///C:/Users/zc/Desktop/learn/test.lua#10:5)

doen't work (it doesnt' jump to 5 clumnà)

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 21, 2024

[x](file:///C:/Users/zc/Desktop/learn/test.lua#10:5)

doen't work (it doesnt' jump to 5 clumnà)

Indeed, it does not support column.

angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 21, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr self-assigned this Jun 21, 2024
@angelozerr angelozerr moved this to 🏗 In progress in IDE Cloudaptors Jun 21, 2024
@angelozerr angelozerr changed the title [feat] support file link in hover Support file link in hover Jun 21, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 21, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 21, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 21, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 22, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 22, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 22, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 22, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 22, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 23, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
Fixes redhat-developer#376

Signed-off-by: azerr <azerr@redhat.com>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDE Cloudaptors Jun 25, 2024
@angelozerr
Copy link
Contributor

@CppCXY @FalsePattern the PR about supporting file link in markdown has been merged.

You can install https://github.com/redhat-developer/lsp4ij?tab=readme-ov-file#testing-the-ci-builds to test this feature.

Please play with this feature and give us feedback, thanks!

@angelozerr
Copy link
Contributor

angelozerr commented Jun 26, 2024

@CppCXY have you tried this feature ? Is it working for your all usecases?

@CppCXY
Copy link
Contributor Author

CppCXY commented Jun 26, 2024

@CppCXY have you tried this feature ? Is it working for your all usecases?

I've tried it and found that the format is #L{line}:{col}. In fact, VSCode supports both #{line} and #L{line}, but I've decided to switch to the version you support.

@angelozerr
Copy link
Contributor

I've tried it and found that the format is #L{line}:{col}

I support the both syntax:

  • #L{line}
  • #L{line}:{col}

@angelozerr
Copy link
Contributor

Could you create please an issue to support too #{line} syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hover
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants