Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326605

Summary: [editor] IProblemRequestor does not get installed on JS file working copy when new JS File wizard is used
Product: [WebTools] JSDT Reporter: Chris Jaun <cmjaun>
Component: GeneralAssignee: Ian Tewksbury <itewksbu>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: ccc, cmjaun, itewksbu
Version: 3.2.2Flags: thatnitind: review+
Target Milestone: 3.2.2 P   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 325464    
Bug Blocks:    
Attachments:
Description Flags
patch none

Description Chris Jaun CLA 2010-09-29 17:50:15 EDT
+++ This bug was initially created as a clone of Bug #325464 +++

STEPS:
1. create a SWP
2. create a JS file using the new JS file wizard
3. add a single double quote to the document (syntax error)

RESULTS:
1. without saving the document the syntax validation error should be reported by its not

CAUSE:
this is because in NewJSFileWizardPage@#addFileComment the line: "cu.becomeWorkingCopy(new NullProgressMonitor());" (added by Bug 268125)

This causes the working copy to be created without a problem requester. Then when CompilationUnitDocumentProvider#createFileInfo is called there is a bit of code that reads:
/*
* Use the deprecated method to ensure that our problem requestor is
* used; it is the only way to have as-you-type IProblems from
* reconciling appear in the annotation model.
*/
if (JavaModelUtil.isPrimary(original))
  original.becomeWorkingCopy(requestor, getProgressMonitor());

This attempts to set up the working copy again using the correct requestor, problem is in CompilationUnit#becomeWorkingCopy(IProblemRequestor, IProgressMonitor) if the PerWorkignCopyInfo already exists then nothing is done.
Comment 1 Chris Jaun CLA 2010-09-29 17:51:18 EDT
Created attachment 179903 [details]
patch
Comment 2 Carl Anderson CLA 2010-10-09 08:27:46 EDT
Committed to R3_2_2_patches