eclipse-wildwebdeveloper / wildwebdeveloper

Simple and productive Web Development Tools in the Eclipse IDE
https://projects.eclipse.org/projects/tools.wildwebdeveloper
Eclipse Public License 2.0
190 stars 70 forks source link

js file extension not used #1012

Open uqpik opened 1 year ago

uqpik commented 1 year ago

On default ESLint is not working for files with the extension js.

To get it working, i have to modify the plugin.xml of org.eclipse.wst.jsdt.core to change its file extension from js to js_

In addition i need to patch org.eclipse.wst.jsdt.internal.core.util.Util.getJavaLikeExtensions().

I wonder why others have no problems like this.

vrubezhny commented 1 year ago

Others don't have this problem. most likely, because they don't have JSDT installed. Do you really need it to be installed for your projects? Could you. please, put some light on what EPP package and version you're using?

uqpik commented 1 year ago

I simply installed "Eclipse IDE for Enterprise Java and Web Developers" 2022-12 for Windows x86_64.

nitind commented 1 year ago

In addition i need to patch org.eclipse.wst.jsdt.internal.core.util.Util.getJavaLikeExtensions().

Why would patching there make a difference?

uqpik commented 1 year ago

Within org.eclipse.wst.jsdt.internal.core.util.Util.getJavaLikeExtensions() the extension "js" is re-added.

nitind commented 1 year ago

Ok, but why would that make a difference? Is ESLint calling it?

uqpik commented 1 year ago

Files with the extension js are opened with JSTD editor, instead of the Wild Web Developer editor. And there is no way to change this behaviour in the preferences.

nitind commented 1 year ago

When you right click on a JavaScript file, which options are given in the Open With menu? And I still don't understand what that has to do with ESLint.

uqpik commented 1 year ago

ESLint is not the origin of the problem, it can't be used, because the JSTD editor is opened on default. Which is installed with "Eclipse IDE for Enterprise Java and Web Developers" 2022-12 for Windows x86_64 together with the Wild Web Developer.

The Open With menu shows: Generic Text Editor Text Editor System Editor In-Place Editor Default Editor Other...

nitind commented 1 year ago

It's JSDT, not JSTD.

You don't have JSDT's editor in that list, which identified itself as the "JavaScript Editor" back when it existed, so it's not the one being opened. But again, I don't see the connection between the method you mentioned in JSDT and ESLint, or even what editor is opened and ESLint. I'm not saying ESLint is the cause of a problem, what I don't see is how it's even affected by that code.

uqpik commented 1 year ago

The problem can be reproduced as follows:

mickaelistria commented 1 year ago

Can you please try fetch a recent Eclipse SDK (last release or I-Buid), install latest snapshots of Wild Web Developer and LSP4E?

Tenebrosful commented 1 year ago

Hi,

I currently have a similar problem at work.

We use:

Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components) Version: 2023-03 (4.27.0) Build id: 20230309-1520

Wild Web Developer HTML, CSS, JSON, Yaml, JavaScript, TypeScript, Node tools 1.1.0.202305041915 org.eclipse.wildwebdeveloper.feature.feature.group Eclipse Wild Web Developer project

There is ESlint installed globally and in-projet but there is no eslint marker on the left of the code.

mickaelistria commented 1 year ago

Can you please share the version of LSP4E you have installed, and if it seems more than a month old, try installing latest snapshots of LSP4E? I suspect https://github.com/eclipse/lsp4e/commit/8f9220cc9211dc15e0c9a73e03d238e12284454a has fixed it.

Tenebrosful commented 1 year ago

I have no idea, i just download the lastest version with http://download.eclipse.org/lsp4e/releases/latest/

Eclipse isn't at all my main editor, also tried with http://download.eclipse.org/lsp4e/snapshots/ but it's the same.

vrubezhny commented 1 year ago

@Tenebrosful The mentioned commit is probably not enough to have the issue fixed, I think you need to update to the latest snapshot version that contains https://github.com/eclipse/lsp4e/commit/8d09a30bcce51b4b0a461fcedaa179a700785582 which is not released yet. In order to give it a try you can install it from snapshots: https://download.eclipse.org/lsp4e/snapshots/

Tenebrosful commented 1 year ago

Still don't work, but maybe it's because it's not reading the .eslintrc ? Idk if there is a settings from my company that conflit or something like that. Or if there is something to config to tell it where is it.

Idk if it can help but here a log of LSP4E.

[2023-05-19T14: 25: 08.157416400+02: 00] LSP4E_TO_LANGUAGE_SERVER org.eclipse.wildwebdeveloper.eslint:
{
    "jsonrpc": "2.0",
    "id": "2",
    "method": "textDocument/codeAction",
    "params": {
        "textDocument": {
            "uri": "file:///C:/xxx/xxx/xxx/rootJavaProject/WebContent/src/ldap.js"
        },
        "range": {
            "start": {
                "line": 904,
                "character": 21
            },
            "end": {
                "line": 904,
                "character": 25
            }
        },
        "context": {
            "diagnostics": [
                {
                    "range": {
                        "start": {
                            "line": 904,
                            "character": 21
                        },
                        "end": {
                            "line": 904,
                            "character": 25
                        }
                    },
                    "severity": 4,
                    "code": 6133,
                    "source": "typescript",
                    "message": "\u0027data\u0027 is declared but its value is never read."
                }
            ]
        }
    }
}

[2023-05-19T14: 25: 08.160408400+02: 00] LANGUAGE_SERVER_TO_LSP4E org.eclipse.wildwebdeveloper.eslint:
{
    "jsonrpc": "2.0",
    "id": "2",
    "result": []
}

It looks fine actualy that don't fit the .eslintrc rules

Tenebrosful commented 1 year ago

Ho ok, after testing it seems that my case is linked to #701 because it correctly works when i'm doing the same things that the issue demonstration do

vrubezhny commented 1 year ago

@Tenebrosful is this the only project where ESLint doesn't work as expected? Could you please, if possible, create and share a minimal example project that could demonstrate the issue? Yes, the validation takes some time, but it should happen independently of invoking any actions or showing code action context menus and so on..

Tenebrosful commented 1 year ago

Idk, i only use eclipse for my company project. but according to the issue, it happen on project with Eclipse IDE for Entreprise Java and Web Developpers version

uqpik commented 6 months ago

Still not working in Eclipse IDE for Enterprise Java and Web Developers 2024-03