This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Scenario: - Create C++ Application project - Add such code: int main(int argc, char** argv) { int i = 0; decltype(i) j = 0; return 0; } - Copy this code to second file - Restart IDE ===> If Start Page is a current tab, then editor can't recognize 'decltype' keyword in both files. If tested file is a current tab, then IDE can recognize this keyword in this file only.
Other test case: - Launch IDE - Push File|Open File... - Open C++ file with C++11 keywords ==> 'decltype' is black identifier (Bug!!!) - Close and Open this file again ==> 'decltype' is blue identifier (ok)
Restoring editor pane does not call CloneableEditorSupport.prepareDocument(). Reassign to evaluation.
*** Bug 256285 has been marked as a duplicate of this bug. ***
Created attachment 157115 [details] Stack how prepareDocument() is called during file open
prepareDocument() is only called from createCloneableTopComponent() (and from adding an annotation). It's definitely not any recent regression so if you want prepareDocument() to be called during component deserialization we must add such functionality.
(In reply to Miloslav Metelka from comment #4) > Created attachment 157115 [details] > Stack how prepareDocument() is called during file open Bag is about opened in editor after restart documents. Important step: - open document, close IDE - start IDE IDE restores document in editor pane without calling CloneableEditorSupport.prepareDocument().
(In reply to Miloslav Metelka from comment #5) > prepareDocument() is only called from createCloneableTopComponent() (and > from adding an annotation). It's definitely not any recent regression so if > you want prepareDocument() to be called during component deserialization we > must add such functionality. Why?
Mila, you are right. It is old asymmetric behavior which we'd like to make the same. We use prepareDocument to set up out of EDT some important settings which changes behavior of Lexer (i.e. set up which IDs are keywords and what is C++ flavor of document).
Another suspicious behavior. Restart IDE with opened "start page" and c++ file. IDE open start page, switch on c++ file. See bug (prepareDocument was not called). Restart IDE with opened c++ file. IDE open c++ file. There is no bug (prepareDocument was called).
Added CES.prepareDocument() into component intialization phase. http://hg.netbeans.org/jet-main/rev/61eb9d155ec7 Please note that CES.prepareDocument() may be called many times (e.g. when adding an annotation).
Let's test in trunk and then backport to 8.1 patch (platform for OSS.Next)
Integrated into 'main-silver', will be available in build *201511110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/61eb9d155ec7 User: Miloslav Metelka <mmetelka@netbeans.org> Log: #253681 - After restart IDE doesn't highlight C++11 keywords in opened files - CES.prepareDocument() called for deserialized components.
Thanks, it works.
Ilia will transplant this one for studio into release81
Changeset from releases repository please? Thanks!
changeset: 304948:6d58b9ef6748 branch: release81 user: Miloslav Metelka <mmetelka@netbeans.org> date: Tue Nov 10 10:41:22 2015 +0100 summary: #253681 - After restart IDE doesn't highlight C++11 keywords in opened files - CES.prepareDocument() called for deserialized components.
Verified in NetBeans 8.1 patch1 1st scenario has been fixed 2nd scenario should be investigated in issue 257832