Community
Participate
Working Groups
SSIA
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.
Created attachment 63214 [details] Update the editor without saving the file
Created attachment 63215 [details] Update the editor without saving the file Remove some lines that was not part of the patch.
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.
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 on attachment 63345 [details] Update the editor without saving the file Setting iplog flag.