-
Notifications
You must be signed in to change notification settings - Fork 10
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
Mark folders as web root folders #37
Comments
@kaloyan-raev I think it's a good idea. It seems that it's similar issue than #24 Today I'm very busy with tern.java, I will do this issue when I will have time. |
It would be great if we could mark a list of source folders that would each be counted as the root. |
I agree @MichaelChambers but I'm very busy for the moment with JSON Editor and Grunt development. Any contribution are welcome! |
I am working on this. I will consider @MichaelChambers suggestion. |
New Web Resources > Validation > Web Root Folders property page is added. It allows zero or more folders from the project to be selected as web root folders. The settings are stored as persistent property in the IProject. The DefaultURIResolver reads the persistent property to find out if any web root folders are selected for the current project. If yes, then the existence of files with path containing a leading / are validated against the web root folders.
New Web Resources > Validation > Web Root Folders property page is added. It allows zero or more folders from the project to be selected as web root folders. The settings are stored as persistent property in the IProject. The DefaultURIResolver reads the persistent property to find out if any web root folders are selected for the current project. If yes, then the existence of files with path containing a leading / are validated against the web root folders.
PR #41 |
Fixes #37 - Mark folders as web root folders
@MichaelChambers could you update from the snapshot repository and check if this solution works for you? |
@kaloyan-raev I tell me why Web Root Folders Preferences is inside Web Resources -> Validation -> Web Root Folders menu item. This config works too for completion, no? Wyh don't set this menu to Web Resources -> Web Root Folders ? |
Isn't this what the Deployment Assembly property page already does and then surfaces through the ModuleCore APIs? |
@nitind I'm sorry I don't understand what you mean? |
@angelozerr No, currently web root folder are not considered for completion - just for validation. I had only the validation in my mind and did not thought about the completion. Therefore, I placed the new property page under the Web Resource > Validation one. When completion starts considering web root folders, I agree the page should me moved directly under Web Resources. The Deployment Assembly page that @nitind mentioned is used in the WTP Java EE Tools. Here is screenshot:
|
Many thanks for your information. It should be cool if completion could use your preferences. |
This works perfectly. Thanks! |
Consider the following project structure:
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?
The text was updated successfully, but these errors were encountered: