Code Monkey home page Code Monkey logo

eclipse-wtp-webresources's People

Contributors

angelozerr avatar gamerson avatar kaloyan-raev avatar pascalleclercq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eclipse-wtp-webresources's Issues

Skip validation when embedded PHP script is used

Consider the following snippet:

<img src="<?php echo $picture_path ?>">

In this case the src value is marked as error by the validator. This is not useful and actually annoying for users. Since the output of the PHP script cannot be determined during design time, it would be better to skip the validation when we have embedded PHP script in the src value.

Regular Exception since update to Luna 4.4.1 JEE packaging

I updated the Eclipse JEE Package this morning. Since I have regular exception in the console log. I thought that it was an Eclipse Exception but it's link to this plugin. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=457537

Content of my eclipse bug :
Since the update I performed this morning, I have some exceptions in the Error console when I edit some html file or when I move the editor to split my screen in 2 distinct editors.

java.lang.NullPointerException
    at org.eclipse.wst.html.webresources.core.utils.DOMHelper.getAttrByOffset(DOMHelper.java:316)
    at org.eclipse.wst.html.webresources.core.utils.DOMHelper.getAttrByOffset(DOMHelper.java:308)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validateCSS(WebResourcesValidator.java:408)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validate(WebResourcesValidator.java:385)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validateRegions(WebResourcesValidator.java:360)
    at org.eclipse.wst.html.webresources.ui.validation.WebResourcesSourceValidator.validate(WebResourcesSourceValidator.java:88)
    at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.validate(ReconcileStepForValidator.java:381)
    at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.reconcileModel(ReconcileStepForValidator.java:259)
    at org.eclipse.jface.text.reconciler.AbstractReconcileStep.reconcile(AbstractReconcileStep.java:95)
    at org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy.reconcile(ValidatorStrategy.java:269)
    at org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor.process(DocumentRegionProcessor.java:321)
    at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor.process(StructuredRegionProcessor.java:258)
    at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor$BackgroundThread.run(DirtyRegionProcessor.java:691)

When creating a new liferay maven project during the project.open() webresources listener throws NPE

java.lang.NullPointerException
    at org.eclipse.wst.html.webresources.internal.core.WebResourcesFileManager.updateResource(WebResourcesFileManager.java:103)
    at org.eclipse.wst.html.webresources.internal.core.WebResourcesFileManager.visit(WebResourcesFileManager.java:84)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:69)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
    at org.eclipse.wst.html.webresources.internal.core.WebResourcesFileManager.resourceChanged(WebResourcesFileManager.java:56)
    at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
    at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
    at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:378)
    at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1498)
    at org.eclipse.core.internal.resources.Project.open(Project.java:1167)
    at org.eclipse.core.internal.resources.Project.open(Project.java:1178)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.create(ProjectConfigurationManager.java:926)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:150)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:1)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:166)

Unable to disable validation

Unable to disable validation with Validation preference page. For example such snippet:

<html><body>
    <div class="someclass"></div>
</body></html>

will produce "Undefined CSS class" warning. There is no way to disable it because even if "Web Resources Validator" will be disabled (manual and build) warning message is still visible.

Too much proposals with css autocompletion

When I use autocomplete an class attribute I see too much proposals. For example, when I use twitter bootstrap, and I want to use "control-label" class, I didn't see in autocomplete because there are 15 proposals for "container" and 11 for "container-fluid".

In fact if you count all different names, there are only 3 proposals for the string "cont".

  • container
  • container-fluid
  • control-label

These all proposals are in bootstrap.css file. See the next picture to illustrate this issue.
2014-11-21_223730

No way to dynamically contribute stylesheets to be traversed

In my use-case, portlets, we have css files that are not imported in a html/jsp via s but instead of included by the portal container on the portlets behalf. I'd like the ability to extend the traversing class with an extension point so that when a user is in a portlet jsp file in a liferay project, and has css files that will be included by the portal (in a liferay-portlet.xml file) then my plugin could automatically add those files to be traversed.

Mark folders as web root folders

Consider the following project structure:

+ project
  + public
    + img
      - myimage.png
  + deep
    + deep
      + deep
        - template.phtml

The template.phtml file is not directly accessible, but via inclusion in another PHP/HTML resource. Therefore any relative paths does not really follow the project tree hierarchy and are marked as validation errors, e.g. <img src="/img/myimage.png" /> will be marked as error.

This situation can be improved by marking a folder in the project (i.e. "public" in the above case) as the web root folder. I am thinking about providing a project property for this. The user can right-click on the project, choose properties, then go to the Web Resources node and browse a folder to specify as Web Root. Then the validator should consider the value of this property.

Is such improvement acceptable? Any other suggestions to resolve the above case?

When clicking in a jsf facelets component css source validation throws this NPE

java.lang.ClassCastException: org.eclipse.wst.html.core.internal.document.ElementStyleImpl cannot be cast to org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validateCSS(WebResourcesValidator.java:409)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validate(WebResourcesValidator.java:383)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validateRegions(WebResourcesValidator.java:363)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validate(WebResourcesValidator.java:97)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validateFile(WebResourcesValidator.java:225)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validateDelta(WebResourcesValidator.java:160)
    at org.eclipse.wst.html.webresources.core.validation.WebResourcesValidator.validate(WebResourcesValidator.java:123)
    at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.validate(ReconcileStepForValidator.java:303)
    at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.reconcileModel(ReconcileStepForValidator.java:262)
    at org.eclipse.jface.text.reconciler.AbstractReconcileStep.reconcile(AbstractReconcileStep.java:95)
    at org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy.reconcile(ValidatorStrategy.java:269)
    at org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor.process(DocumentRegionProcessor.java:321)
    at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor.process(StructuredRegionProcessor.java:258)
    at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor$BackgroundThread.run(DirtyRegionProcessor.java:691)

Support resolving of directives and CSS classes in AngularJS templates

Like stated in http://stackoverflow.com/q/33502089/1814576, AngularJS directives and CSS classes are only resolved in the main HTML file.
In Angular templates, validation of directives and CSS fails, because of their "snippet" nature (the source files are not linked).

As most of the HTML is not specified in the main file but in templates, it would be very helpful if validation worked there. Maybe a first approach would be to provide the possibility to link templates with CSS files and angular modules in project preferences?

Support dynamic path (ex : JSP expression)

link/@href, script/@src, img/@src can use dynamic path (path can be a Freemarker, JSP expression). For instance for JSP Liferay page :

selection_019

Today we ignore validation when <% it is found. See #14

It should be cool if we can provide a mean to resolve the dynamic path. My idea is to provide an URIResolver extension point to add custom https://github.com/angelozerr/eclipse-wtp-webresources/blob/master/org.eclipse.a.wst.html.webresources.core/src/org/eclipse/wst/html/webresources/core/providers/IURIResolver.java Today only https://github.com/angelozerr/eclipse-wtp-webresources/blob/master/org.eclipse.a.wst.html.webresources.core/src/org/eclipse/wst/html/webresources/core/providers/DefaultURIResolver.java is available

  • Liferay IDE could provide a resolver whih resolve PortalUtil.getStaticResourceURL.
  • we could provide a generic resolver that we could add with UI preferences. Code of the resolver could be done with JavaScript.

@gamerson what do you think about this idea?

Hyperlink for embedded CSS classes does not work

In the following sample code:

<!DOCTYPE html>
<html>
<head>
<title>Insert title here</title>
<style>
    .myclass {
        color: green;
    }
</style>
</head>
<body>
<p class="myclass"></p>
</body>
</html>

If I Ctrl+click on the "myclass" class name inside of the paragraph tag, I would expect that the cursor jumps to the .myclass definition in the page's head.

Currently this does not happen for classes defined in embedded CSS. It works correctly for classes defined in external CSS files.

nick

While this is not yet Eclipse.org project can we reference it by EWW ?

Web Resources Validator

Provide Validator to validate web resources :

  • validate the existing of js file declared inside sript/@src
  • validate the existing of css file declared inside link/@href
  • validate the existing of image file declared inside img/@src
  • validate the existing of CSS#ID and CSS#class

Undefined JavaScript/Css file

Hello,

When trying to load a file without specify the protocol the editor shows this error (in the title):

for example:

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.20/angular.min.js"></script>

or

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

adding https or http solve this, but is should work without it,

Thanks a lot,
Ghassan

Closed project is causing too many stacktraces

When project is closed log file is polluted with the same stacktrace. I'm not sure when this happens because this example is from our customer log (10x1mb log files just with this exception during same day). If you need more details, let me know.

!ENTRY org.eclipse.a.wst.html.webresources.core 4 0 2015-01-05 10:30:58.305
!MESSAGE Error while updating web resources project configuration
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource '/GeschenkeDe' is not open.
at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:150)
at org.eclipse.core.internal.resources.Resource.checkAccessibleAndLocal(Resource.java:221)
at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:1274)
at org.eclipse.wst.html.webresources.internal.core.WebResourcesProjectConfiguration.getConfiguration(WebResourcesProjectConfiguration.java:53)
at org.eclipse.wst.html.webresources.internal.core.WebResourcesProjectConfiguration.getOrCreateConfiguration(WebResourcesProjectConfiguration.java:58)
at org.eclipse.wst.html.webresources.internal.core.search.WebResourcesIndexManager.performAction(WebResourcesIndexManager.java:74)
at org.eclipse.wst.sse.core.indexing.AbstractIndexManager$1.run(AbstractIndexManager.java:1528)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.wst.sse.core.indexing.AbstractIndexManager$ResourceEventProcessingJob.run(AbstractIndexManager.java:1526)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Allow other DOM attributes to trigger completion

In alloyui jsp taglibs all css classes are added via the cssClass attribute like

<aui:button cssClass="btn-primary" ... />

It would be good if the webresources plugin had an extension point to allow adopters to add additional attributes that can activate the completion.

Cause eclipse freeze

The plugin cause eclipse freeze or being really slow when editing html files.
The memory usage is unstable when eclipse became slowly

Avoid validating class values with PHP code inside

In the following HTML fragment the class valued is marked with an "Undefined CSS class" warning:

<span class="<?=$class_name?>">Text</span>

This is not very helpful, because the validator does not actually evaluate the PHP code. Therefore, it's better to skip the validation for values with PHP code inside.

CSS class validator does not respect web root folders

Steps to reproduce:

  1. Create new project
  2. Add file app/views/scripts/header/index.html with content:
<html>
<head>
<title>Title</title>
<link rel="stylesheet" type="text/css" href="/styles/temp.css" />
</head>
<body>
<div>
<a class="color" href="/">Link</a>
</div>
</body>
</html>
  1. Add file www/styles/temp.css with content:
.color {
color: #ff0000;
}
  1. Configure the www folder to be a web root folder.
  2. Execute Project > Clean... from main menu.

Result:

  • The /styles/temp.css reference is correctly recognized in the HTML file and I can navigate via ctrl+click on it.
  • Bug: The color class is not found and marked as "Undefined CSS class (color)" warning in the HTML file.

./ and / links

Seeing image preview on hover is super.

On nodeclipse.org home page

there are ./ (relative) links like <img src="./img/eclipse48.png" alt="Enide Studio">

I noticed that for them there were no preview.

Also in _includes there are / (absolute) links like <img alt="Enide 2015 for Windows x64" src="/img/enide-studio/icon-windows.png" />win64</a>

They were shown as error, until I checked wiki and found there's web-root-folder preference

Possibly it may make sense to add hyperlink to project properties from error message

e.g.
"Undefined Image file ("/img/enide-studio/icon-windows.png").
configure project web resources properties"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.