Bug 573902 - .js files opened by default in the Text Editor instead of in the Generic Text Editor
Summary: .js files opened by default in the Text Editor instead of in the Generic Text...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Web (show other bugs)
Version: 3.21 (2021-03)   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 3.22   Edit
Assignee: Holger Voormann CLA
QA Contact: Victor Rubezhny CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-01 17:43 EDT by Holger Voormann CLA
Modified: 2021-06-15 23:41 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Voormann CLA 2021-06-01 17:43:11 EDT
In the Eclipse IDE for Enterprise Java and Web Developers 2021-06 M3 (and in 2021-03 and in some previous releases) JavaScript files (*.js) are opened by default (when using a fresh workspace) in the Text Editor instead of the Generic Text Editor.

Steps to reproduce:
1. Switch to a fresh workspace
2. Via "File > New > File" create the file "sample.js"

Result:
"sample.js" is opened in the plain Text Editor which does not provide JavaScript language support.

Expected:
"sample.js" should be opened in the Generic Text Editor providing JavaScript language support via Eclipse Wild Web Developer.

When "sample.js" is created via "File > New > Other...: JavaScript > JavaScript File" the file is opened in the Generic Text Editor as expected. But closing and reopening the file will open it in the Text Editor.
Comment 1 Jonah Graham CLA 2021-06-01 20:55:35 EDT
Thanks for the bug report Holger.

Not sure where this belongs - four possibilities:
- Generic Editor (so Eclipse Platform)
- LSP4E
- WWD itself
- or in the integration of all of it - so here in the EPP

Does the Full IDE package WWD provide suffer from this problem: https://github.com/eclipse/wildwebdeveloper#as-full-ide-package - if so, then I here is a convenient URL to (hopefully) make it easier to refile this bug in WWD:

https://github.com/eclipse/wildwebdeveloper/issues/new?title=.js%20files%20opened%20by%20default%20in%20the%20Text%20Editor%20instead%20of%20in%20the%20Generic%20Text%20Editor&body=In%20the%20Eclipse%20IDE%20for%20Enterprise%20Java%20and%20Web%20Developers%202021-06%20M3%20(and%20in%202021-03%20and%20in%20some%20previous%20releases)%20JavaScript%20files%20(*.js)%20are%20opened%20by%20default%20(when%20using%20a%20fresh%20workspace)%20in%20the%20Text%20Editor%20instead%20of%20the%20Generic%20Text%20Editor.%0A%0ASteps%20to%20reproduce%3A%0A1.%20Switch%20to%20a%20fresh%20workspace%0A2.%20Via%20%22File%20%3E%20New%20%3E%20File%22%20create%20the%20file%20%22sample.js%22%0A%0AResult%3A%0A%22sample.js%22%20is%20opened%20in%20the%20plain%20Text%20Editor%20which%20does%20not%20provide%20JavaScript%20language%20support.%0A%0AExpected%3A%0A%22sample.js%22%20should%20be%20opened%20in%20the%20Generic%20Text%20Editor%20providing%20JavaScript%20language%20support%20via%20Eclipse%20Wild%20Web%20Developer.%0A%0AWhen%20%22sample.js%22%20is%20created%20via%20%22File%20%3E%20New%20%3E%20Other...%3A%20JavaScript%20%3E%20JavaScript%20File%22%20the%20file%20is%20opened%20in%20the%20Generic%20Text%20Editor%20as%20expected.%20But%20closing%20and%20reopening%20the%20file%20will%20open%20it%20in%20the%20Text%20Editor.
Comment 2 Holger Voormann CLA 2021-06-02 03:05:08 EDT
(In reply to Jonah Graham from comment #1)
> Thanks for the bug report Holger.
> 
> Not sure where this belongs - four possibilities:
> - Generic Editor (so Eclipse Platform)
> - LSP4E
> - WWD itself
> - or in the integration of all of it - so here in the EPP
> 
> Does the Full IDE package WWD provide suffer from this problem:
> https://github.com/eclipse/wildwebdeveloper#as-full-ide-package - if so,
> then I here is a convenient URL to (hopefully) make it easier to refile this
> bug in WWD:
> ...
In eclipseide-wild-web-developer-0.11.6 ("Eclipse IDE for JavaScript and Web Developers") and in "Eclipse IDE for Java Developers" 2021-06 M3 plus the "Wild Web Developer" plugin 0.10.7 .js files are opened with the Generic Text Editor as expected.
Comment 3 Holger Voormann CLA 2021-06-02 03:49:08 EDT
In the JEE IDE I see two content types for .js:
- Text > JavaScript Source File
- Text > Wild Web Developer supported web dev file > JavaScript

"Text > JavaScript Source File" has as associated editors "Text Editor" before "Generic Text Editor" which I guess is causing this (maybe by JSDT). I'm going to look into it.
Comment 4 Eclipse Genie CLA 2021-06-02 06:08:14 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jsdt/webtools.jsdt/+/181262
Comment 6 Nitin Dahyabhai CLA 2021-06-15 23:41:44 EDT
Thanks, Holger!