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

Bug 512996

Summary: codeEdit 14.0 candidate build broken: demoCodeEditTern.html does not allow config files to be edited
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: steve_northover
Version: 13.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2017-03-02 14:46:42 EST
If you load up the demo widget that shows .tern-project and .eslintrc* files being used in the widget (embeddedEditor/demo/demoCodeEditTern.html) it does not allow the content of those files to be seen, or changed.
Comment 1 libing wang CLA 2017-03-03 09:38:10 EST
Couple of thing s to do here:
1. Include the separate json plugin in the build.
2. The demo uses inputManager.setInput for the two tern files, this competes with the language tooling(validation, content assist etc) logic on inputChange.
3. The new json plugin seems to listen to input changes, not sure what that mean to language tooling. Michael, could you confirm?
Comment 2 Michael Rennie CLA 2017-03-03 16:14:55 EST
(In reply to libing wang from comment #1)

> 3. The new json plugin seems to listen to input changes, not sure what that
> mean to language tooling. Michael, could you confirm?

The JSON plugin listens because it has a parser / AST manager in it now - it listens to know when to regenerate the AST.
Comment 3 Steve Northover CLA 2017-03-04 10:11:39 EST
Libing, you are fixing this for Orion 14, correct?
Comment 4 libing wang CLA 2017-03-04 10:32:23 EST
(In reply to Steve Northover from comment #3)
> Libing, you are fixing this for Orion 14, correct?

Yes, Steve. Pushed the fix yesterday by http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=d043c83a0c581a7d6c30e458c07223babace0857.

Grabbed the build today and testing...
Comment 5 libing wang CLA 2017-03-04 10:57:32 EST
The codeEdit build looks good now:
1. It now registers the separate jsonPlugin in its bootstrap.
2. It also includes the includes the separate requireErrorHandler.js file that was 404ed before the fix.

The demo page has 3 editor instances opened. one for a js file, one for the .tern-project and one for the .eslintrc.

We load the contents for all the three editors to "show off" how ".tern-project and .eslintrc." affect the js validation, as well as how the quick-fix in the js file can even modify the .tern-project file automatically.

However, as json file has astManager now, it seems completing with the js validator now.
We may need to think about other ways to write the demo page. I disabled the contents loading for the .tern-project and .eslintrc editor instances. Now the js tooling works.
Comment 6 libing wang CLA 2017-03-04 10:59:44 EST
Because the build itself looks good now, I am closing this bug.
Need to talk to Michael on Monday on how to avoid the "js" and "json" validation competition in the demo page.
Comment 7 Michael Rennie CLA 2017-03-04 12:19:24 EST
(In reply to libing wang from comment #6)
> Because the build itself looks good now, I am closing this bug.
> Need to talk to Michael on Monday on how to avoid the "js" and "json"
> validation competition in the demo page.

Talked with Libing, the problem arises from the three rapid successive inputChanged events. I opened bug 513110 to track adding some additional synchronization to the js tools to better handle this.