[Pydev-cvs] org.python.pydev.parser/src/org/python/pydev/parser PyParser.java, 1.50, 1.51
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-07-31 01:47:06
|
Update of /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31511/src/org/python/pydev/parser Modified Files: PyParser.java Log Message: <li>Fixed NPE when creating editor with no interpreter configured</li> <li>Hyperlink works in the same way that F3 (saves file before search)</li> <li>Fixed problem while navigating pydev package explorer ( https://sourceforge.net/tracker/index.php?func=detail&aid=2008015&group_id=85796&atid=577329 )</li> <li>Applied patch that fixes race condition in PythonNature (thanks to Radim Kubacki)</li> <li><strong>Eclipse 3.4</strong>: Move / rename working</li> Index: PyParser.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/PyParser.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** PyParser.java 27 Jan 2008 22:44:30 -0000 1.50 --- PyParser.java 31 Jul 2008 01:47:14 -0000 1.51 *************** *** 184,190 **** */ public PyParser(IPyEdit editorView) { ! this(editorView.getPythonNature()); } /** --- 184,208 ---- */ public PyParser(IPyEdit editorView) { ! this(getGrammarProviderFromEdit(editorView)); } + /** + * @param editorView this is the editor that we're getting in the parser + * @return a provider signaling the grammar to be used for the parser. + */ + private static IGrammarVersionProvider getGrammarProviderFromEdit(IPyEdit editorView) { + try { + return editorView.getPythonNature(); + } catch (RuntimeException e) { + //let's treat that correctly even if we do not have a default grammar (just log it) + return new IGrammarVersionProvider(){ + + public int getGrammarVersion() { + return IGrammarVersionProvider.LATEST_GRAMMAR_VERSION; + } + }; + } + } + /** |