Product: Aqua Data Studio
Version: 12.0.0-beta-54
Build #: 29376
Build Date: 2012-Sep-21 07:54:32 AM
There are a few issues with the editor with respect to a file under version control. Below are the test cases
Case 1: Contents are deleted
1. Open a Query Window (A)
2. Select a SQL file that is under version control (svn)
3. Right click the file and select the option - Open in current window
4. Open another Query Window (B)
5. Select the same file and select the option - Open in current window
6. Close the Query Window (B)
7. The contents of the file A is deleted
If you compare the same operations with ADS 11.0 this is not the case
Case 2: Syntax Coloring
1. Open a Query Window (A)
2. Select a SQL file that is under version control (svn)
3. Right click the file and select the option - Open in current window
4. Open a Text Editor (B)
5. Select the same file and select the option - Open in current window
6. Now go back to the contents of the file A - SQL Syntax Coloring is lost
Case 3: Inline Diff Sidebar
1. Go to File Options-->SQL Editor-->Inline Diff Sidebar and Disable it for SQL Editor
2. Open a Query Window (A)
3. Select a SQL file that is under version control (svn)
4. Right click the file and select the option - Open in current window
5. Insert a few lines and you can see that there is no Inline Diff Sidebar
6. Open a Text Editor (B)
7. Select the same file and select the option - Open in current window
8. Now start adding a few lines in the text editor and you can see the Inline Diff Sidebar for the text Editor
9. Now go back to Query Window (A)
You can see that there is inline diff sidebar for a Query Window which is actually disabled under options. If you compare the same operations with ADS 11.0 this is not the case
>Case 1: Contents are deleted
I think this happens because ADS clears the document contents upon close (it's a memory optimization). The thing is that the same file is opened multiple times and this clean operation will propagate to all of them.
>Case 2: Syntax Coloring
This is not a bug. "Open in current window" will not change the mime type. So loading an SQL file into a text editor will, obviously, be treated as a text file without any specific highlighting.
>Case 3: Inline Diff Sidebar
This seems odd and I'm not certain if it's an ADS or a Vincaed bug. If you look at the Query Window, you don't just get the diff sidebar -- you lose the text highlighting entirely! So it's as if the whole SQL editor is replaced with a text editor.
Come to think of it, in Vincaed you have a File-Document-JEditorPane mapping so the same file will only get a single Document and a single mimetype. My guess is that ADS tries to re-open the same file with a different mimetype and the above bug happens.
Case 1: Contents are deleted.
I can confirm that commenting out the content clearing in freeMemory method solves this problem.
Case 2: Syntax Coloring.
Loading a SQL file into a text editor should not show any SQL specific highlighting, but it should not disable it in QueryAnalyzer window, I guess. (Window A)
Case 3: Inline Diff Sidebar.
When you say that ADS tries to re-open the same file, do you mean when we start editing the file in the second (Text Editor) window? Because we do not do that. If I comment out the call to VersioningCache.setBase() this behavior disappears.
Case 1: Contents are deleted.
I can confirm that commenting out the content clearing in freeMemory method solves this problem.
Case 2: Syntax Coloring.
Loading a SQL file into a text editor should not show any SQL specific highlighting, but it should not disable it in QueryAnalyzer window, I guess. (Window A)
Case 3: Inline Diff Sidebar.
When you say that ADS tries to re-open the same file, do you mean when we start editing the file in the second (Text Editor) window? Because we do not do that. If I comment out the call to VersioningCache.setBase() this behavior disappears.
>Loading a SQL file into a text editor should not show any SQL specific highlighting, but it should not disable it in QueryAnalyzer window, I guess. (Window A)
This sounds like the same problem as case 3: opening the same file with two different mimetypes.
>When you say that ADS tries to re-open the same file, do you mean when we start editing the file in the second (Text Editor) window? Because we do not do that. If I comment out the call to VersioningCache.setBase() this behavior disappears.
It's expected that an unversioned file will have no diff sidebar.
The thing is that the diff sidebar gets disabled/enabled per mime-type. So the explanation for a diff sidebar popping-up when it was previously disabled is that the mime-type actually changed. And it probably boils down to the same issue: you cannot open the same file twice with different mimetypes.
>Loading a SQL file into a text editor should not show any SQL specific highlighting, but it should not disable it in QueryAnalyzer window, I guess. (Window A)
This sounds like the same problem as case 3: opening the same file with two different mimetypes.
>When you say that ADS tries to re-open the same file, do you mean when we start editing the file in the second (Text Editor) window? Because we do not do that. If I comment out the call to VersioningCache.setBase() this behavior disappears.
It's expected that an unversioned file will have no diff sidebar.
The thing is that the diff sidebar gets disabled/enabled per mime-type. So the explanation for a diff sidebar popping-up when it was previously disabled is that the mime-type actually changed. And it probably boils down to the same issue: you cannot open the same file twice with different mimetypes.
After you get the Vincaed 3.0.4.6 release, you should proceed with the changes requested on issue #7644 in order to get Case 3) fixed.
After you get the Vincaed 3.0.4.6 release, you should proceed with the changes requested on issue #7644 in order to get Case 3) fixed.
Case 3) is not fixed. It depends on solving issue #7644 . Tested with the rc-10 build.
Case 3) is not fixed. It depends on solving issue #7644 . Tested with the rc-10 build.
With RC-12 case 3 is fixed, I added these calls when Options are changed :
SQLEditorOptionSettings.setDiffSidebar(EditorOptions.getSqlInlineDiff());
TextEditorOptionSettings.setDiffSidebar(EditorOptions.getTextInlineDiff());
JavaEditorOptionSettings.setDiffSidebar(EditorOptions.getJavaInlineDiff());
JavascriptEditorOptionSettings.setDiffSidebar(EditorOptions.getJavascriptInlineDiff());
HTMLEditorOptionSettings.setDiffSidebar(EditorOptions.getHtmlInlineDiff());
XMLEditorOptionSettings.setDiffSidebar(EditorOptions.getXmlInlineDiff());
But I openned a new issue caused by the Vincaed update : 7667
With RC-12 case 3 is fixed, I added these calls when Options are changed :
SQLEditorOptionSettings.setDiffSidebar(EditorOptions.getSqlInlineDiff());
TextEditorOptionSettings.setDiffSidebar(EditorOptions.getTextInlineDiff());
JavaEditorOptionSettings.setDiffSidebar(EditorOptions.getJavaInlineDiff());
JavascriptEditorOptionSettings.setDiffSidebar(EditorOptions.getJavascriptInlineDiff());
HTMLEditorOptionSettings.setDiffSidebar(EditorOptions.getHtmlInlineDiff());
XMLEditorOptionSettings.setDiffSidebar(EditorOptions.getXmlInlineDiff());
But I openned a new issue caused by the Vincaed update : 7667
Case 3: Inline Diff Sidebar is not resolved in 12.0.0-rc-12
Case 3: Inline Diff Sidebar is not resolved in 12.0.0-rc-12
I needed to also add ***OptionSettings.setDiffSidebar(EditorOptions.getSqlInlineDiff()); to application startup.
I needed to also add ***OptionSettings.setDiffSidebar(EditorOptions.getSqlInlineDiff()); to application startup.
Case 3 is now fixed in 12.0.0-rc-13, but another case of starting with an Editor with Inline sidebar enabled and opening another editor with sidebar disabled, disables the sidebar of the first editor
Case 4: Inline Diff Sidebar
1. Go to File Options-->SQL Editor-->Inline Diff Sidebar and Disable it for SQL Editor
2. Open a Text Editor (A)
3. Select a SQL file that is under version control (svn)
4. Right click the file and select the option - Open in current window
5. Insert a few lines and you can see that Inline Diff Sidebar is enabled
6. Open a Query Window (B)
7. Select the same file and select the option - Open in current window
8. Now start adding a few lines in the text editor and you can see the Inline Diff Sidebar is disabled here
9. Now go back to Text Editor (A) - the inline sidebar is disabled
Case 3 is now fixed in 12.0.0-rc-13, but another case of starting with an Editor with Inline sidebar enabled and opening another editor with sidebar disabled, disables the sidebar of the first editor
Case 4: Inline Diff Sidebar
1. Go to File Options-->SQL Editor-->Inline Diff Sidebar and Disable it for SQL Editor
2. Open a Text Editor (A)
3. Select a SQL file that is under version control (svn)
4. Right click the file and select the option - Open in current window
5. Insert a few lines and you can see that Inline Diff Sidebar is enabled
6. Open a Query Window (B)
7. Select the same file and select the option - Open in current window
8. Now start adding a few lines in the text editor and you can see the Inline Diff Sidebar is disabled here
9. Now go back to Text Editor (A) - the inline sidebar is disabled
>Case 4: Inline Diff Sidebar
This is an ADS bug.
Versioning is 'global' for Vincaed. So, when you call VersioningCache and you define a 'base' file for an 'original' (working copy) file, it will propagate everywhere.
What happes in 'case 4' is the following:
* the base file is defined for the text editor which makes any changes show in the diff sidebar
* when the Query Window is opened, ADS calls VersioningCache.setBase(comp, original, null) which clears the base file globally (including for the text document).
* so, without a base file, the diff sidebar has nothing to display as the 'original' file appears to be unversioned.
The solution would be to stop using 'null' as a way to hide the diff sidebar for mimetypes where the diff sidebar has been disabled.
Instead you should use EditorPreferences.setDiffSidebar(mime, visible) to hide it and always call VersioningCache.setBase with the real data (ie. if it's versioned, it should get the real base file).
PS: This bug is also present in ADS 11.
>Case 4: Inline Diff Sidebar
This is an ADS bug.
Versioning is 'global' for Vincaed. So, when you call VersioningCache and you define a 'base' file for an 'original' (working copy) file, it will propagate everywhere.
What happes in 'case 4' is the following:
* the base file is defined for the text editor which makes any changes show in the diff sidebar
* when the Query Window is opened, ADS calls VersioningCache.setBase(comp, original, null) which clears the base file globally (including for the text document).
* so, without a base file, the diff sidebar has nothing to display as the 'original' file appears to be unversioned.
The solution would be to stop using 'null' as a way to hide the diff sidebar for mimetypes where the diff sidebar has been disabled.
Instead you should use EditorPreferences.setDiffSidebar(mime, visible) to hide it and always call VersioningCache.setBase with the real data (ie. if it's versioned, it should get the real base file).
PS: This bug is also present in ADS 11.
>> Instead you should use EditorPreferences.setDiffSidebar(mime, visible) to hide it and always call VersioningCache.setBase with the real data (ie. if it's versioned, it should get the real base file).
I don't understand what this means. Can you clarify? What is the value of "visible" in (mime, visible)?
>> Instead you should use EditorPreferences.setDiffSidebar(mime, visible) to hide it and always call VersioningCache.setBase with the real data (ie. if it's versioned, it should get the real base file).
I don't understand what this means. Can you clarify? What is the value of "visible" in (mime, visible)?
It means that you check what is the current diffbar value in options for this mistype.
I have sent you the fix thatI have tested.
It means that you check what is the current diffbar value in options for this mistype.
I have sent you the fix thatI have tested.
Issue #7631 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 12.0.0-rc-16 |
No time estimate |
2 issue links |
relates to #7667
Issue #7667Openning same file in 2nd editor clears changes in the first editor |
relates to #7644
Issue #7644EditorPreferences.setDiffSidebar(mime, visible) is not called when toggling the Inline Diff Sidebar option |
>Case 1: Contents are deleted
I think this happens because ADS clears the document contents upon close (it's a memory optimization). The thing is that the same file is opened multiple times and this clean operation will propagate to all of them.
>Case 2: Syntax Coloring
This is not a bug. "Open in current window" will not change the mime type. So loading an SQL file into a text editor will, obviously, be treated as a text file without any specific highlighting.
>Case 3: Inline Diff Sidebar
This seems odd and I'm not certain if it's an ADS or a Vincaed bug. If you look at the Query Window, you don't just get the diff sidebar -- you lose the text highlighting entirely! So it's as if the whole SQL editor is replaced with a text editor.
Come to think of it, in Vincaed you have a File-Document-JEditorPane mapping so the same file will only get a single Document and a single mimetype. My guess is that ADS tries to re-open the same file with a different mimetype and the above bug happens.