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

Add ability for a custom callback function to define the symbols? #35

Open
maegul opened this issue Jan 28, 2022 · 4 comments
Open

Add ability for a custom callback function to define the symbols? #35

maegul opened this issue Jan 28, 2022 · 4 comments

Comments

@maegul
Copy link

maegul commented Jan 28, 2022

Would it be possible to provide a function that generates arbitrary "symbols" to this plugin so that it is not entirely reliant on the symbols list mechanism?

My reason is that the package Comment Marks searches for user generated "symbols" which are just comments containing a special character (eg # >). It would be cool if one could easily plug such a plugin into this Ouline plugin without too much fuss.

Perhaps any function that returns a list of Sublime.SymbolRegion objects would suffice?

How a callback would be provided I'm not entirely sure. Thoughts?

@warmdev
Copy link
Owner

warmdev commented Feb 2, 2022

This is technically possible, but I am also not sure how a callback function would be implemented.

@maegul
Copy link
Author

maegul commented Feb 3, 2022

I'm not an experienced Sublime plugin author ... so I'm sure there's plenty of experience/wisdom either of us could seek (when we've got time of course)! Thanks for responding.

My first thought off the top of my head is refactoring out any call to getsymbols() (I forget what the API interface to that is, but you get what I mean) to call a separate symbols command, which then potentially opens up flexibility through settings and key bindings, which could specify how the symbols command works. Pivotally, a setting could specify the name of another command (from any plugin), which could then be picked up by this symbols command which will function mostly as a proxy.

Don't know if that's really worth doing or what problems it poses. I'm sure other plugins have worked out decent systems for plugin interoperation.

Thanks for your response!

@mattjbloch
Copy link

Replying to say I agree, this would be fantastic. I currently use Table of Comments to add a table of comments / guide to longer programs, but one I have to bring up via a command every time I want to see it or move through it. It would be fantastic to be able to just always have it open on the side in an Outline window!

@Monox18
Copy link

Monox18 commented Jun 17, 2023

I'm not quite sure what you want to do with the "custom callback function"...

But let's see if I get it right, you want the ability to have comments displayed in the Outline, so that you can navigate them by clicking on them? as in this example.
comment navigation

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

4 participants