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

Create a LineHeaderCodeMining at the end of the document #2157

Closed
tobiasmelcher opened this issue Aug 5, 2024 · 1 comment · Fixed by #2660
Closed

Create a LineHeaderCodeMining at the end of the document #2157

tobiasmelcher opened this issue Aug 5, 2024 · 1 comment · Fixed by #2660
Labels
bug Something isn't working

Comments

@tobiasmelcher
Copy link
Contributor

tobiasmelcher commented Aug 5, 2024

LineHeaderCodeMining allows only creation of code minings before a given line number, but not after.
This is needed if a code mining should be shown at the end of a document.
I am giving a concrete example here:
screenshot_code_mining
This screenshot shows a code completion which is shown via two code minings. One AbstractCodeMining "ethods:" at the end of the line where the caret is located and one LineHeaderCodeMining "add importing ..." with the rest of the completion at the end of the document. You can see that there is a whitespace character at line 6 at the very end of the document; this is the workaround I currently do so that the LineHeaderCodeMining can be rendered; before showing the code minings, the document is modified and a line break with an additional space is added at the end of the document so that rendering of the code minings is working. It would be great if this workaround would not be needed.

I would be happy to assist and provide a fix for this issue. But I would need some guidance how this could be achieved. Could you please give me some hints? There are currently two code mining classes CodeMiningLineHeaderAnnotation and CodeMiningLineContentAnnotation. Do we need a third class which represents a code mining at the end of the document (at offset >= document.getLength()) ? Or should CodeMiningLineHeaderAnnotation be extended so that it can also render a mining below a given line?

@tobiasmelcher tobiasmelcher added the bug Something isn't working label Aug 5, 2024
@mickaelistria
Copy link
Contributor

Here, this should be a case to be handled by CodeMiningLineContentAnnotation because you want the content to be shown starting from the line being typed, inside this line, and not "above" it as a header.

tobiasmelcher pushed a commit that referenced this issue Jan 3, 2025
if the last line at the end of the document is empty

Fixes: #2157
tobiasmelcher pushed a commit that referenced this issue Jan 3, 2025
if the last line at the end of the document is empty

Fixes: #2157
mickaelistria pushed a commit that referenced this issue Jan 6, 2025
if the last line at the end of the document is empty

Fixes: #2157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants