vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 404 forks source link

IntelliJ integration and configuration #4254

Closed sfe-efficy closed 3 months ago

sfe-efficy commented 7 months ago

Hi!

Is any place where I can find documentation about configure the service details with IntelliJ?

I'm following recent changes and I saw there is a new configurable option "hybrid mode". But using the integration in IntelliJ, I don't see clearly how we can configure our services.

With IntelliJ 2024.1 we have this view:

image

Inside configuration we can see:

image

I don't know if it's possible to provide any kind of argument about where is our configuration, or this services is reading some common places.

In another hand, It was not possible to make working version 2 (latest tested version was 2.0.7, and hybrid mode was not possible to enable in my side).

It wasn't working because was not reporting any kind of error, and application was looking that it was working correctly.

Regards, and thanks for this great work :)

so1ve commented 7 months ago

IntelliJ doesn't need hybrid mode. It runs volar as a separated language server, and I'm not sure if they have updated volar to 2.0.

loosheng commented 7 months ago

As of 2024.1,IntelliJ hasn't upgraded the v2 version of volar yet, they're currently under observation, so you can pay attention to this issue:WEB-65823

sfe-efficy commented 7 months ago

Yes, I know, but It's possible to use another version.

image

When I use the latest version (like 2.0.12), IntelliJ stop reporting errors, but this is happen too using vue-tsc too:

vue-tsc --noEmit --project crm

> webapp@0.1.0 postbuild:crm
> vue-tsc --noEmit --project crm

Process finished with exit code 0

But, I know that I have errors in code:

image

Changing to 1.8.27 the errors are shown.

> vue-tsc --noEmit --project crm

....

7             foooo=""
              ~~~~~
....

144     promiseObserver1111.gsagsaglgas;
        ~~~~~~~~~~~~~~~~~~~

Found 2 errors in the same file....

Process finished with exit code 2

In any case, my question was more related about how the services can be configured? Because, normally when I saw this topic all details to configure this services is focus on VS.

sfe-efficy commented 6 months ago

Hi again, some updates.

I retested again with latest version, 2.0.16 and I was having same problem.

But, this time I executed "vue-tsc" command with "--watch" mode and I saw an error about "ScriptKind" definition not found. It's an enum defined directly in "typescript".

I checked my "typescript" version and it was 5.1.6. It suppose that this enum is defined in this version https://raw.githubusercontent.com/microsoft/TypeScript/v5.1.6/lib/typescript.d.ts

In any case, I tried to update typescript to 5.4.5 and now works fine :)

Before the services was not working, it was not listed in IntelliJ.

image

So, maybe it's missing a minimal required typescript version for this library.

chipit24 commented 6 months ago

Same issue as above for me ☝️ vue-tsc was broken and I had to update TS from 5.1.6 to 5.4.5 to fix it; there was no indication or mention of having a minimum supported TS version though; good suggestion for adding it!