Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337220 - location details needed in markers for jumping to file defining marker error
Summary: location details needed in markers for jumping to file defining marker error
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Paul Tatavu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 335407
  Show dependency tree
 
Reported: 2011-02-15 09:52 EST by Milos Kleint CLA
Modified: 2021-04-19 13:25 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Kleint CLA 2011-02-15 09:52:33 EST
this is a prerequisite for issue 335407

in order to be able to have a hyperlink and jump to file location where the given marker error originates, we need some details included in the marker. At the very least we need the originating model's coordinates/path.
Comment 1 Paul Tatavu CLA 2011-02-22 12:53:25 EST
Done for:
ActionMessageProblemInfo
MissingConfiguratorProblemInfo
MissingLifecycleExtensionPoint
MissingLifecyclePackaging
NotCoveredMojoExecution

http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=29e2fc24b109e0531f9bdddf6f53a5a78d29f24d
https://github.com/sonatype/m2e-core-tests/commit/497997613c13b170a394289fdfc134c16eda58f1
Comment 2 Paul Tatavu CLA 2011-02-22 17:14:55 EST
Fixed the problems introduced by the previous commit and added location info to a few more markers:
http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=d89a8c63aa2f569dfd1c2f649447ed31ffed44fa
https://github.com/sonatype/m2e-core-tests/commit/169fc7883aaded321ebd3163ed9ee321ca227463
Comment 3 Milos Kleint CLA 2011-02-23 08:39:07 EST
it appears you have decided to rewrite the the way markers are located in the current file as part of this issue. Unfortunately it's not entirely correct. Let me give you a UI specification:

1. if placed on an xml element with text eg. <artifactId>id</artifactId> then the entire element is to be marked.
2. if placed on xml element with child elements eg. <plugin></plugin>, then only the start tag shall be marker  (thus <plugin>)

3. the marker shall always be placed on the most detailed placement. Eg. if the error deals with a plugin goal within an execution, then the goal's xml element shall be marked.
4. if the marker deals with more complex entity (eg. execution or plugin) then the plugin's identifier is to be marker (thus <artifactId> in case of plugin)

5. if the correct element cannot be located because it's entirely or partly defined in one of the parents, then the best match shall be found in the current file. let me give you an example.

let's have a marker for missing mapping for enforcer's validate goal.
a. if goal itself if not found, and the plugin itself is defined in the current file, then it's <artifactId> is to be marked.
b. if the plugin is not even defined in the current file, then <plugins> element is to be used.
c. if the <plugins> element is not found, then <build> element is to be used.
d. if build is not found, the <project> is to be used.
Comment 4 Paul Tatavu CLA 2011-02-23 10:47:32 EST
The new marker locations make more sense *to me*.  Which probably doesn't mean much, as I'm not a UI developer. :)

I can't really say I agree or disagree with your comments.  I believe any discussion about marker location(s) should be put in the context of a specific marker/problem.  Mainly because each problem can be caused by different parts of pom files and the marker location should ultimately help the user solve (or understand) that specific problem.
Comment 5 Paul Tatavu CLA 2011-02-23 12:37:31 EST
Added source id to SourceLocation
Comment 6 Milos Kleint CLA 2011-02-24 04:03:04 EST
http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=a6b6ea7bf2b707688b2449c8cbe45b750f3e7b72


we now have a hyperlink (in xml editor on ctrl-click or on hover, hover also applicable in form's header popup)

the only outstanding issue is the naming of the hyperlink in xm editor. The name of the marker needs to be somewhat included in the name (because we can have multiple ones on same line) but that makes the name long and clumsy.
Comment 7 Milos Kleint CLA 2011-02-24 04:05:27 EST
oups, commented on wrong issue..
Comment 8 Paul Tatavu CLA 2011-02-25 11:46:50 EST
Added marker locations for dependency problems
Comment 9 Milos Kleint CLA 2011-02-28 07:45:10 EST
let me explain why I have defined the above mentioned constraints the way I did.

1. <artifactId>XXX</artifactId> is preferred to <plugin> when marking because it's exactly what we want the user to focus his eyes. he can read the id without moving his eyes, gets context instantly. With <plugin> underscored, the user has to scan the text below and parse the artifactId out.. Applies to goals, execution ids and anything else..

2. the <plugins>, <dependencies>, <build> element is preferred to <parent>because it prevents heaping of all errors in one place. That's likely to become a problem in large projects or when our number of markers increases.
It clusters related errors together (eg. everything related to <build>/<plugins> will be close together and one doesn't have to scroll up and down.
Comment 11 Paul Tatavu CLA 2011-02-28 14:18:22 EST
Presently, we have locations for most common markers.  There are still some markers that do not have proper locations, but we can handle those on a per need basis.
Comment 12 Denis Roy CLA 2021-04-19 13:25:56 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/