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

If image, show preview. #188

Merged
merged 1 commit into from
Nov 29, 2021
Merged

Conversation

yomybaby
Copy link
Contributor

@yomybaby yomybaby commented Nov 6, 2017

Look below screenshot. Yes, that's it. 😁
screen

If you want to test add below option to 'config.cson'

  "autocomplete-paths":
    scopes: [
      {
        scopes: [
          "source.js"
          "source.js.jsx"
        ]
        prefixes: [
          "require\\(['\"]"
        ]
        extensions: [
          "png"
          "jpg"
        ]
        replaceOnInsert: [
          [
            "(@[2-9]x)\\.png?$"
            ".png"
          ]
        ]
        relative: true
      }
    ]

lib/paths-provider.js Outdated Show resolved Hide resolved
lib/paths-provider.js Outdated Show resolved Hide resolved
Copy link
Member

@aminya aminya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently does not work. It does not show the preview.

I am also concerned with the performance impact of this change.

@OmgImAlexis
Copy link

I can’t see anything that would cause a noticeable “performance impact”?

@aminya
Copy link
Member

aminya commented Nov 4, 2020

I can’t see anything that would cause a noticeable “performance impact”?

The previous implementation only adds a class, but this PR renders images (which can take some time to load). We should make the image rendering concurrent and lazy somehow, so it does not affect other functionalities of autocomplete.

If the performance impact was noticeable, I will hide it behind an optional config that can be enabled by the users.

@OmgImAlexis
Copy link

The images are all local. Not sure loading times are going to be worth taking into account. Maybe only auto show files under x MB?

@aminya
Copy link
Member

aminya commented Nov 4, 2020

I have better solutions for this. As part of building the cache, on a WebWorker, we can make tiny icons from the images that can load very fast.

See #231

@aminya aminya closed this Jul 22, 2021
@aminya aminya closed this Jul 22, 2021
@aminya aminya reopened this Jul 22, 2021
@UziTech UziTech force-pushed the imagepreview branch 5 times, most recently from b6df48c to 17750cd Compare November 29, 2021 06:35
@UziTech UziTech merged commit 5d212e6 into atom-community:master Nov 29, 2021
UziTech added a commit to UziTech/autocomplete-paths that referenced this pull request Nov 29, 2021
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

Successfully merging this pull request may close these issues.

5 participants