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 custom (per-link) images? #56

Open
mrlacey opened this issue Jan 14, 2024 · 8 comments
Open

Add custom (per-link) images? #56

mrlacey opened this issue Jan 14, 2024 · 8 comments
Milestone

Comments

@mrlacey
Copy link
Owner

mrlacey commented Jan 14, 2024

Request from the marketplace:

  1. Use custom images for the links.
@mrlacey
Copy link
Owner Author

mrlacey commented Jan 14, 2024

If done:

  • The same image for all links?
  • What image format(s)?
  • How specify the image to use?
  • What other image considerations are there? e.g. size & auto-scaling?
  • What about text, rather than an image?

@mrlacey
Copy link
Owner Author

mrlacey commented Jan 14, 2024

X-Ref #51

@Ami-Mizuno
Copy link

Ami-Mizuno commented Jan 14, 2024

If done:

  • The same image for all links?
  • What image format(s)?
  • How specify the image to use?
  • What other image considerations are there? e.g. size & auto-scaling?
  • What about text, rather than an image?

I would like to see individual images. One way I use images is for types (classes, functions, etc...) See Screengrab below.

Screenshot 2024-01-14 144201

As for formats i'm not particular. I would think the usual suspects however svg would be nice. If not (I suspect that would be difficult) png, jpg, and bmp. Maybe ico?

Specifying the image perhaps could be a defaulted argument using a parser character.

Link:{ImageFile,[Option1,...]}:JumpLocation:DisplayLabel. With No ImageFile just fallback to the default Maybe allowing a option in settings to specify the default image. With no options just scale to a size set in the settings dialog? Some options could differ based on the image type. For example changing the image color for svg files (if possible). Another option could be to use an image list in settings. User adds images to the list and can assign a name or number. Also an option to collapse the display down to just image and text (maybe even hide the comment starter i.e. // or /*)

Some examples:

Displays a struct type image with the text label "Goto Structures" Image foreground color is black.
//Link:{MyStructImage,Width=128,Height=128,ClrFG=RGB(0,0,0)}:v:"Structures Used in this file":Goto Structures"

Jumps to "Text in this file" using first image in image list (or second if 0 based lol). Also uses default size or perhaps the image actual size?
//Link:{1}:"Text in this file"

Just text based links would also be a great idea. It would be nice to display them the same way you would an "" link. With a text decoration option such as hover, visited color ... It could use the Image section except have an option for text.

//Link:{"Textual link",type=text|image}
You could make no options default to text. In this way the first parameter can be a textual link, An image from an iml (specifying type=image), Could even use the same param for predefined jumps

//Link:{"GoTo Top",option=Jump-Top|Jump-Bottom|Jump-Next|Jump-Prev}: ...

I'm not really sure how possible any of this actually is and I'm certain it will be a lot of work. I'm glad you are considering it though. As it stands CommentLinks is already one of the more productive extensions I use.

@mrlacey
Copy link
Owner Author

mrlacey commented Jan 19, 2024

The current implementation uses text for the arrow "icon". Using a text character (including emoji) would be a lot simpler than dealing with separate image files and could be specified inline

@Ami-Mizuno
Copy link

I'm not quite sure what you mean. Does that mean the images would be predefined and one would choose an image via particular characters?

@mrlacey
Copy link
Owner Author

mrlacey commented Jan 19, 2024

Inspired by your suggestion of something like link:[path/to.img]:filename.ext

What about something like link:docs/filename.ext[📖] ?

This would use the book emoji instead of the arrow. (To better indicate it's a docs link.)

In the same file, you could also have link:filename.ext[✅] to show a link to a [unit] test.
Or link:filename.ext[>] if you just wanted the GreaterThan sign. (Doesn't have to be an emoji.)

Exact syntax to be determined, but I prefer the character at the end of the string so it's less intrusive and doesn't make the file path harder to read.

Additionally, could also make the default/fallback character to use configurable.

@Ami-Mizuno
Copy link

Yes that sounds good. The only real reason I suggested custom images was because of the way I document various code. For example I have it setup as an Objects main page then additional pages for Constructors, Methods, Properties, etc... Which is of course the images I would like to use unless there's a means to use VS's built in images. i.e. Link:filename.ext[vs.method] or similar.

I still say collapsing down to just an image and a label would look best. For example
link:docs/filename.ext[📖] collapses to

📖Documentation

The collapse would be unhidden when the cursor is placed inside the label or on the image for example. When moved away (via mouse or kbd) it re-collapses. Not the most important thing but it would definitely look cleaner.

@mrlacey mrlacey added this to the v3 milestone Nov 14, 2024
@mrlacey mrlacey changed the title Add custom link images? Add custom (per-link) images? Nov 15, 2024
@mrlacey mrlacey modified the milestones: v3, backlog Nov 15, 2024
@mrlacey
Copy link
Owner Author

mrlacey commented Nov 15, 2024

As part of v3 adding the ability to customize the link images (& color) on a universal basis.
This issue has evolved more into focusing on having custom images for specific links or links of different "types", as well as adding different collapsed views of links.

May revisit this in line with #35 and mrlacey/CollapseComments#15

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

2 participants