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

show files in front of attributes on include suggestions #621

Open
eiswind opened this issue Aug 14, 2022 · 2 comments
Open

show files in front of attributes on include suggestions #621

eiswind opened this issue Aug 14, 2022 · 2 comments

Comments

@eiswind
Copy link
Contributor

eiswind commented Aug 14, 2022

I would like to see files show up in front of other attributes on include/image/video autosuggestions.

I would like to set up a PR using the sortOrder attribute.

As @Mogztter suggested

when requesting auto-completion on an include, image, video we should prioritize paths to local ressources then user-defined attributes (where the value can be used in a path), then built-in attributes usually used in path then other built-in attributes.

when requesting auto-completion on the image macro, we should prioritize files with image file extensions: svg, png, jpg, jpeg...
when requesting auto-completion on the video macro, we should prioritize files with video file extensions: mp4, mov...
when requesting auto-completion on the include macro, we should only show paths to text files (i.e., remove binary files)

when using sortOder this would imply that we set an alphabetical prefix in the various providers that are involved, at least this is what could grasp so far.

@ggrossetie
Copy link
Member

when using sortOder this would imply that we set an alphabetical prefix in the various providers that are involved, at least this is what could grasp so far.

That's correct. I think using a numeric values is probably better.

@eiswind
Copy link
Contributor Author

eiswind commented Aug 15, 2022

Currently an a_ prefix is in use, but we could change that. I gave this a try to show the files upfront yesterday and it works like a charm.

I suggest we use

  • 10_ for files
  • 20_ for doc attributes
  • 30_ onwards for built in attributes

are there any other sources that need to be considered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants