Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 545801

Summary: DOT Editor - Content Assist improvements: quoted attributes and selections
Product: [Tools] GEF Reporter: Zoey Gerrit Prigge <eclipse>
Component: GEF DOTAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: miklossy
Version: unspecified   
Target Milestone: 5.1.0 (2019-06)   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
Issue 1 screenshot and explanation
none
Issue 2 explanatory screenshot
none
Issue 3 screenshot of code section none

Description Zoey Gerrit Prigge CLA 2019-03-26 11:43:55 EDT
Created attachment 278017 [details]
Issue 1 screenshot and explanation

In Dot Editor for optionally quoted attributes, currently there are/have been some oddities with content assist that should be fixed:

These will be removed in a PR soon; this bug is being raised for documentation purposes.

1.) In order to not remove quotes through content assist, we check for a quote at the beginning of the selection, but not at the end leading to the initial quote remaining, even if both quotes were highlighted using the mouse to be overwritten. (see attachment)

2.) For non-subgrammar attributes we use ID.fromValue(value.toString).toString in proposeAttributeValues(List<?> values,
			ContentAssistContext context,
			ICompletionProposalAcceptor acceptor).
This leads to odd gramatically wrong CA results in some situations in conjunction with CA in already quoted Strings. Looking at the history of this line of code, it was implemented during ID abstraction (bug #507413). Prior, this was only used to quote attributes that needed quoting.

It seemed a better idea, to test for this in computeProposals.

3.) Trying to implement the Changes for Issue 1 (Selection) we noticed that a lot of ContentAssist tests broke. It seems this has to do with a bug in a helper method:

Due to the test model string being added twice, offsets and selection are calculated wrongly.
Comment 1 Zoey Gerrit Prigge CLA 2019-03-26 11:44:36 EDT
Created attachment 278018 [details]
Issue 2 explanatory screenshot
Comment 2 Zoey Gerrit Prigge CLA 2019-03-26 11:45:31 EDT
Created attachment 278019 [details]
Issue 3 screenshot of code section
Comment 3 Zoey Gerrit Prigge CLA 2019-03-26 12:10:13 EDT
Where I wrote computeProposals above, I meant createCompletionProposal, sorry.
Comment 4 Tamas Miklossy CLA 2019-03-28 08:59:04 EDT
Thank you Zoey for your contribution! I merged your PR into the master branch. Resolving as fixed in 5.1.0 (2019-06).