| Summary: | Polish: Warning/error marker for unknown nature referenced by project | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dani Megert <daniel_megert> |
| Component: | IDE | Assignee: | Mickael Istria <mistria> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | lbullen |
| Version: | 4.8 | ||
| Target Milestone: | 4.8 M4 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/111082 https://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=1044120af43f20f81f1153298dd71eb16701f106 |
||
| Whiteboard: | |||
| Bug Depends on: | 489540 | ||
| Bug Blocks: | |||
|
Description
Dani Megert
Thanks for these suggestions Dani. @Lucas: I plan work on them later (next week probably), but if you're interested in working on it and think it has higher priority than your current tasks, feel free to pick it before me. Does anyone know a good existing method in Platform core or resources or in dependencies to find a string in a given IFile (or InputStream)? I would rather avoid to implement a KMP algorithm specifically for this feature and I imagine it's already been useful in the past. New Gerrit change created: https://git.eclipse.org/r/111082 (In reply to Mickael Istria from comment #2) > Does anyone know a good existing method in Platform core or resources or in > dependencies to find a string in a given IFile (or InputStream)? You can get the document for a file via file buffer and then use org.eclipse.jface.text.FindReplaceDocumentAdapter. This also has the advantage that it will work on the current state of the document even if open in an editor and dirty. Found bug 527071 while testing this. (In reply to Dani Megert from comment #4) > You can get the document for a file via file buffer and then use > org.eclipse.jface.text.FindReplaceDocumentAdapter. This also has the > advantage that it will work on the current state of the document even if > open in an editor and dirty. org.eclipse.core.resources can't depend on JFace. However, this feature can be very useful even in non-JFace world (for example on e(fx)clipse as well) so it's be best to keep in in the org.eclipse.core.resources plugin. Moreover, the check actually happens on the project resource (and is rendered as marker on the .project), so it's not really suitable to use a document to render the marker and validation can only happen on save. That said, the FindReplaceDocumentAdapter is inspiring. I'll try something better that covers the whitespaces as well. (In reply to Mickael Istria from comment #6) > (In reply to Dani Megert from comment #4) > > You can get the document for a file via file buffer and then use > > org.eclipse.jface.text.FindReplaceDocumentAdapter. This also has the > > advantage that it will work on the current state of the document even if > > open in an editor and dirty. > > org.eclipse.core.resources can't depend on JFace. Well, it could. For historical reasons JFace is in the name but the code is in org.eclipse.text. What can't be used are file buffers because that bundle actually depends on core.resources. (In reply to Dani Megert from comment #7) > (In reply to Mickael Istria from comment #6) > > (In reply to Dani Megert from comment #4) > > > You can get the document for a file via file buffer and then use > > > org.eclipse.jface.text.FindReplaceDocumentAdapter. This also has the > > > advantage that it will work on the current state of the document even if > > > open in an editor and dirty. > > > > org.eclipse.core.resources can't depend on JFace. > > Well, it could... But thinking of it, we should not add a dependency on org.eclipse.text in the resource layer. Ok, in the last version of the patch, I'm still loading the file in memory (like it was already doing) and used a regexp to match the nature. No dependency was added. (In reply to Mickael Istria from comment #9) > Ok, in the last version of the patch, I'm still loading the file in memory > (like it was already doing) and used a regexp to match the nature. No > dependency was added. Works for me. Gerrit change https://git.eclipse.org/r/111082 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=1044120af43f20f81f1153298dd71eb16701f106 |