atom-plugin icon indicating copy to clipboard operation
atom-plugin copied to clipboard

Pull image-size and locate-file out of atom-plugin and into their own module

Open ramya-rao-a opened this issue 8 years ago • 3 comments

@sergeche

I was looking at your implementation of "Update Image Size" in the atom plugin.

The image-size file has no editor specific code

Any reason the default function in locate-file supports both basepath or the editor? If it is made to take just the base path, then this file will not have any editor specific code either

And so, both these files can be pulled out into a separate module.

This will make the adaption easier for other editors

ramya-rao-a avatar Jun 07 '17 17:06 ramya-rao-a

Don’t remember for sure, but the idea was to provide a custom base path somehow (config, project settings) to locate files. For example, say you edit /src/my/component.html file that has /images/pic.png, which is located in /www/assets/images/pic.png. You could add /www/assets as a search path.

sergeche avatar Jun 07 '17 19:06 sergeche

That can still be pulled out of locate-file to another intermediate utility file.

The less we re-invent the wheel, the better.

ramya-rao-a avatar Jun 07 '17 21:06 ramya-rao-a

Agree, locate-file could accept file path only

sergeche avatar Jun 07 '17 21:06 sergeche