Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326605 - [editor] IProblemRequestor does not get installed on JS file working copy when new JS File wizard is used
Summary: [editor] IProblemRequestor does not get installed on JS file working copy whe...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.2 P   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on: 325464
Blocks:
  Show dependency tree
 
Reported: 2010-09-29 17:50 EDT by Chris Jaun CLA
Modified: 2010-10-09 08:27 EDT (History)
3 users (show)

See Also:
thatnitind: review+


Attachments
patch (982 bytes, patch)
2010-09-29 17:51 EDT, Chris Jaun CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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