-
Notifications
You must be signed in to change notification settings - Fork 228
Fix Issues introduced by PR #2051 #2612
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
Fix Issues introduced by PR #2051 #2612
Conversation
|
|
||
| IAutoEditStrategy[] autoEditStrategies= new IAutoEditStrategy[] { getAutoIndentStrategy(sourceViewer, contentType) }; | ||
| ArrayList<IAutoEditStrategy> autoEditStrategiesList= new ArrayList<>(Arrays.asList(autoEditStrategies)); | ||
| autoEditStrategiesList.add(new SurroundWithBracketsStrategy(sourceViewer)); | ||
| return autoEditStrategiesList.toArray(new IAutoEditStrategy[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| IAutoEditStrategy[] autoEditStrategies= new IAutoEditStrategy[] { getAutoIndentStrategy(sourceViewer, contentType) }; | |
| ArrayList<IAutoEditStrategy> autoEditStrategiesList= new ArrayList<>(Arrays.asList(autoEditStrategies)); | |
| autoEditStrategiesList.add(new SurroundWithBracketsStrategy(sourceViewer)); | |
| return autoEditStrategiesList.toArray(new IAutoEditStrategy[0]); | |
| return new IAutoEditStrategy[] { getAutoIndentStrategy(sourceViewer, contentType), new SurroundWithBracketsStrategy(sourceViewer) }; |
| if (bracketsMap.containsKey(command.text)) { | ||
| if (command.text != null && bracketsMap.containsKey(command.text)) { | ||
| try { | ||
| ITextSelection selection= (ITextSelection) sourceViewer.getSelectionProvider().getSelection(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as suggested by @szarnekow earlier, it'd be best to use command.getSelection() here instead of asking the viewer again.
c8bb5fc to
272e7f8
Compare
Fixes eclipse-platform#2600 Review points implementation
272e7f8 to
7a453c6
Compare
|
@szarnekow Do you agree that this PR fixes your concerns about configurability? Any objection to merge? |
|
Can we merge this. in SourceViewer#configure is null. |
Yes, this looks all good to me. |
I think asking @szarnekow his opinion implies that you approve.
|
Just for safety and comfort, I restarted the Linux verification. For a recent p2 PR, I found that repeated re-running eventually succeeds, so I'm interested to see if that works here too. |
| * @return the auto edit strategies or <code>null</code> if automatic editing is not to be enabled | ||
| * @since 3.1 | ||
| */ | ||
| public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the javadoc of this method says
For backward compatibility, this implementation always returns an array containing the result of {@link #getAutoIndentStrategy(ISourceViewer, String)}.
So we are now breaking this compatibility contract?


Fixes #2600