angelozerr / eclipse-wtp-webresources

Provides completion, hyperlink, hover inside WTP HTML editor for Web Resources (CSS, JS, Images)
Eclipse Public License 1.0
13 stars 9 forks source link

Implements completion for script/@src, link/@ref, img/@src #5

Closed angelozerr closed 10 years ago

angelozerr commented 10 years ago

Implements completion for script/@src, link/@ref, img/@src

angelozerr commented 10 years ago

See screenshot at https://github.com/angelozerr/eclipse-wtp-htmlcss#user-content-css-files-completion

kaloyan-raev commented 10 years ago

I've just checked the current progress on this. It's really cool to have this feature.

Currently it seems that the suggestions are sorted by in reversed alphabetical order, i.e. Z->A. Could you change the order to A->Z?

And, perhaps, if there are files in the current folder they should precede any subfolders in the list.

angelozerr commented 10 years ago

Currently it seems that the suggestions are sorted by in reversed alphabetical order, i.e. Z->A. Could you change the order to A->Z?

Could retry it please, now I'm using WTP CustomCompeltionProposal which should manage that.

And, perhaps, if there are files in the current folder they should precede any subfolders in the list.

I don't understan dvery well? You wish to have subfolders in a completion? Why? If I write img/src, I want to have image files and not folder?

kaloyan-raev commented 10 years ago

I pulled and the order is A->Z now.

Consider the situation on the screenshot: image

I believe it would be more intuitive if zexport_zpk.png is immediately below exportzpk2.png. Same for public/breakpoint_compare.png and public/zbreakpoint_preferences.png. Otherwise, if you have hundreds of images in the project, it would be hard to focus on those in a particular folder.

angelozerr commented 10 years ago

Thank's for the screenshot, I see your idea, but I don't know how to manage that?

Completion proposal is managed with WebResourcesCompletionProposal which extends WTP CustomCompletionProposal which implements IRelevanceCompletionProposal (getRelevance which returns 0)

Sort is done with WTP org.eclipse.wst.xml.ui.internal.contentassist.ProposalComparator which compar eat first relevance and if comparaison resilt is equal to 0 it uses String compare.

I have tried to ovveride getRelevance by returing the occurence of '/' but it doesn't work very well. Any PR are welcome!

angelozerr commented 10 years ago

I close this issue.

For sort problem @kaloyan-raev pelase create a new issue, but today I don't know how to manage that.