beansoft / iscratch-support

Supports for the Notes IDEA plugin
Other
6 stars 0 forks source link

[Feature Request] Auto-tracked comment notes per file. #26

Open MostHated opened 1 year ago

MostHated commented 1 year ago

Hey there, I can't believe it's been a year already that I have been using this, it definitely has come a long way in its features and increased greatly in overall usefulness, so thanks for all the hard work.

I did want to throw a suggestion out there that would be awesome to have, as I have been hoping for years to find something like this for Rider, but have only seen it on VSCode.

What I would like to do is be able to have a comment, and when including a specific string sequence in it, have that tracked as a note in a tree specific to the file in which the comment was made.

Example, if my string I would use to detect a comment note would be ' --| ', then I have a comment with that string in it:


// --| Variables
private string myString;
private bool myBool;

// --| Logging Methods
private void Log(string msg)
{
   ...
}

// --| Helper Methods
private void MyHelperMethod()
{
    ...
}

private void MyOtherHelperMethod()
{
    ...
}

Then the plugin would detect them because of the --| string included, and then add them into a listing for this file, and display them in the notes section similar to how I created these files in the image below.
Then when I clicked on one of them, it would take me directly to that code section, basically acting as a comment-based "index" for navigation in my code. There would not need to be any actual note associated with the comment, they could just be automatically detected and associated with my file, along with my actual notes.

Hopefully this request makes sense and I explained it well. If there are any questions about it, please do let me know!

Thanks, -MH

beansoft commented 1 year ago

Thank you so much for using the Notes plugin I'm using it daily. I'm using VS Code too, would you mind creating a demo project for me, and is any 3rd party extensions required for VS Code? I'll do an investigation on this feature.

MostHated commented 1 year ago

The VSCode plugin that has (for the most part) similar functionality that I would really like to have is called Comment Anchor (https://github.com/StarlaneStudios/vscode-comment-anchors).

Example images ![](https://github.com/StarlaneStudios/vscode-comment-anchors/raw/HEAD/media/preview.gif) ![](https://github.com/StarlaneStudios/vscode-comment-anchors/raw/HEAD/media/workspace-anchors.png)

The main difference, or thing I would prefer to change is not having to use opening and closing comments. But you can see in their example images how if you make a comment that contains your keyword string, it detects that and places it in an easy to locate place, so that you can simply click on that link in the tree, and it does to that comment in your code.

Similar, I suppose to how JetBrains "ToDo" works, but per-file, not per project, and without any sort of interference with doing anything else, just for ease of navigation within a file.

So being able to have a Notes section for my current file that could automatically add the links to my comments (and possible also show the comment itself, if desired) would be extremely useful for quickly navigating large files with lots of different methods and "sections" of code.

I have started using a good bit of partial files for my Unity projects to help break things up visually, but then it gets even harder to navigate code. If I could simply add a special comment and it would save to a tree-like list in my notes, I would no longer have to search through 4-5 files to find a method or group of methods. It would be great to just have a list I can click on!

beansoft commented 1 year ago

Ok, I got what you need, and the last question: is this function enabled for all files or just some kind of programming language supported by the IDE with smart edit enabled(I mean fully supported like refactor, etc)? This is only about my implementation of this feature.

MostHated commented 1 year ago

As far as I know, at least in VSCode, it worked for any language in which you had editor support , so that it could know what the languages comment characters were such as c# using "//", other languages using "#" etc. I am honestly not sure though, if it did or used any other language features. I personally can't think of any additional things that I would want it to do that might require deeper integration.

I am wondering if the JetBrains "Todo" system might have that type of integration already, which could be "borrowed" for this different use case?

beansoft commented 1 year ago

Wow, a great tip for the TODO system! I think this will save a lot of time on this feature!

beansoft commented 1 year ago

And in the meanwhile, you can create custom tags to let them be collected by the TODO system for a workaround: System Preferences-> Editor -> TODO

Add a new pattern: \b--|\b.*

https://www.jetbrains.com/help/idea/2022.2/using-todo.html#add_pattern_filter_todo

image