Bug 181110 - Should SpecfileReconcilingStrategy#updateEditor be empty?
Summary: Should SpecfileReconcilingStrategy#updateEditor be empty?
Status: RESOLVED FIXED
Alias: None
Product: Linux Tools
Classification: Tools
Component: RPM (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Alphonse Van Assche CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-04-04 22:50 EDT by Andrew Overholt CLA
Modified: 2009-01-23 10:23 EST (History)
0 users

See Also:


Attachments
Update the editor without saving the file (6.34 KB, patch)
2007-04-07 11:25 EDT, Alphonse Van Assche CLA
no flags Details | Diff
Update the editor without saving the file (5.50 KB, patch)
2007-04-07 11:28 EDT, Alphonse Van Assche CLA
no flags Details | Diff
Update the editor without saving the file (7.50 KB, patch)
2007-04-10 07:49 EDT, Alphonse Van Assche CLA
overholt: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Overholt CLA 2007-04-04 22:50:27 EDT
SSIA
Comment 1 Alphonse Van Assche CLA 2007-04-07 11:16:19 EDT
No, that was to not forgot to re take a look on, Thanks to beep me about this. There was a bug in SpecfileCompletionProcessor.getContextType() that give strange error when I try to update the editor without save the file, have just found that bug now and have be able to fix many other bug by the way, great!

With this patch outline, folding, parser and completion are updated without save the file.

To test the patch open an empty file a type:
Name: <enter> -> give an error
%prep <ctrl>+<space> -> foldings must be showed and the outline is updated
<ctrl>+<space> -> must show proposals about %prep like %install

Cheers,
Alphonse


2007-04-06  Alphonse Van Assche  <alcapcom@gmail.com>

	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileReconcilingStrategy.java 
	Add "hot save" fuctionnality: outline, folding, completion are updated without
	manually save the file.  
	(reconcile): Use only on implemtation.
	(updateEditor): Update the specfile instance of the editor.
	(updateFolding): No more take a specfile as arg.	
	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileCompletionProcessor.java 
	(getContextType): Fix: completion don't work correctly on a "un-finished" spec file.
	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileFoldingStructureProvider.java 
	(updateFoldingRegions): Get a specfile instance from the sEditor var.	
Comment 2 Alphonse Van Assche CLA 2007-04-07 11:25:37 EDT
Created attachment 63214 [details]
Update the editor without saving the file
Comment 3 Alphonse Van Assche CLA 2007-04-07 11:28:27 EDT
Created attachment 63215 [details]
Update the editor without saving the file

Remove some lines that was not part of the patch.
Comment 4 Alphonse Van Assche CLA 2007-04-10 07:49:53 EDT
Created attachment 63345 [details]
Update the editor without saving the file

Ok, the whole problem came from the fact that we sometimes not use a well instanced parser (error handler null pointer exception, see the SpecfileEditor.validateAndMark method), to not have that problem we can use SpecfileEditor.getSpecfile(), so BTW we use always the same instance. there was some other bug in Competion processor, see the changelog entry below.


2007-04-10  Alphonse Van Assche  <alcapcom@gmail.com>

	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileReconcilingStrategy.java: 
	Update the editor without saving the file.
	(updateFolding): Don't take a specfile instance.
	(reconcile): Use the same method to reconcile.
	(SpecfileReconcilingStrategy): Remove unneded code.
		* src/org/eclipse/linuxtools/rpm/ui/editor/parser/SpecfileParser.java (parseSimpleDefinition): 
	Cleanup.
	(parseComplexDefinition): Remove all existing error handler markers before parse the file.
	(parse): Remove no more needed workarounds.
	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileCompletionProcessor.java 
	(getContextType): Fix array out of bound bug.
	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileFoldingStructureProvider.java
	(updateFoldingRegions): Take the Specfile instance from the editor one.
Comment 5 Andrew Overholt CLA 2007-04-13 09:38:16 EDT
After I mistakenly applied part of this patch yesterday, I finally went through everything to verify that it's applied now.  Please let me know if things aren't as they seem :)  Thanks again for the patches.

Committed revision 557.

2007-04-10  Alphonse Van Assche  <alcapcom@gmail.com>

	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileReconcilingStrategy.java:
	Update the editor without saving the file.
	(updateFolding): Don't create a specfile instance.
	(reconcile): Use the same method to reconcile.
	(SpecfileReconcilingStrategy): Remove unneeded code.
	(updateEditor): Update the specfile instance of the editor.
	* src/org/eclipse/linuxtools/rpm/ui/editor/parser/SpecfileParser.java
	(parseSimpleDefinition): Cleanup.
	(parseComplexDefinition): Remove all existing error handler markers before
	parsing the file.
	(parse): Remove workarounds which are no longer needed.
	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileCompletionProcessor.java
	(getContextType): Fix array out of bounds bug with incomplete specfiles.
	* src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileFoldingStructureProvider.java
	(updateFoldingRegions): Use the Specfile instance in the editor one.
Comment 6 Andrew Overholt CLA 2009-01-23 10:23:34 EST
Comment on attachment 63345 [details]
Update the editor without saving the file

Setting iplog flag.