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

Feature Request: Notes attached with code #16

Open
imHVD opened this issue Jun 4, 2021 · 7 comments
Open

Feature Request: Notes attached with code #16

imHVD opened this issue Jun 4, 2021 · 7 comments

Comments

@imHVD
Copy link

imHVD commented Jun 4, 2021

Feature Request: The note stays with the code and not the line.
After a note is added but the code is moved up or down few lines then the note should also move with that code. This way the note stays attached with the code, even when the codes is moved when new code is added above it changing the line originally at which the note was added

@imHVD imHVD changed the title Notes attached with code Feature Request: Notes attached with code Jun 4, 2021
@zhaobenx
Copy link

zhaobenx commented Jun 1, 2022

I have the same problem and want to add this feature, but I have questions about how to follow the line.
Anyone can give me hint on how to do this? By matching most similar code?

@hsuan9522
Copy link

@zhaobenx Maybe can try to add a function to let the user edit the line number? Will it be easier than match the code?!

@imHVD
Copy link
Author

imHVD commented Jan 11, 2023 via email

@edvardm
Copy link

edvardm commented May 25, 2023

One helpful thing would be to automatically copy selected line(s) to the note, so even if line number would change, then any notes would be still relevant to part in note.

Extension might try to automatically try to match it with appropriate part in the file, but just mere copying of content at the time would be helpful.

@prmichaelsen
Copy link

prmichaelsen commented Sep 1, 2023

I have the same problem and want to add this feature, but I have questions about how to follow the line. Anyone can give me hint on how to do this? By matching most similar code?

Use a UUID, like // <patrick> ce9826ac-bcb5-45be-ab4e-2af96365a840.md

See similar libraries:

Both of these libraries implement this function but they have other issues that make them untenable. I'm a big fan of the way your extension renders in the gutter. Too bad it's not clickable. Of the three, your extension comes out on top. I also appreciate how you receive and respond to feedback.

Pros/Cons

Marginalia

Example: https://storage.googleapis.com/com-f5-parm.appspot.com/parm/images/VqfNjKOA6xom0VpRAbf8.quicktime
Does:

  • Support rendering your note as a Markdown tooltip.
  • Maintain position on line changes

Does not:

  • Provide a command to open your note
  • Allow Cmd + Click to go to your note

Sidenote

Does:

  • Maintain position on line changes

Does not:

  • Provide a command to open your note
  • Allow Cmd + Click to go to your note
  • Support rendering your note as a Markdown tooltip.

Some possible implementations

Option 1

Attach UUID at the end of note line. Cmd + Click action UUID to navigate to note. Store
UUID as comment in MD for easy backlink. Cmd + Click to go to line.

Mockup:
img

img

Note: md footer could alternatively be defined as:

<patrick> <some-uuid>

And it will still not render because these are not valid
HTML tags.

Let me know your thoughts. I haven't looked at the source but I've always been interested in working on a VS Code extension.

@prmichaelsen
Copy link

@imHVD it ended up being a lot more work than I expected (I ended up having to rewrite half the code) but I got it working. I submitted a PR. We'll see if it gets reviewed.

@hashhashu
Copy link

Hi, maybe this vscode plugin :https://marketplace.visualstudio.com/items?itemName=hurly.separable-notes can solve this problem.

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

6 participants