Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language features in templates #1170

Closed
slavarazum opened this issue Apr 11, 2022 · 5 comments
Closed

Language features in templates #1170

slavarazum opened this issue Apr 11, 2022 · 5 comments
Labels
question Further information is requested

Comments

@slavarazum
Copy link

Go to reference, find references, autocomplete features and other don't work in templates.

No definition found for ...

Everything works fine in script section.

Volar - Language Features Server output, when trying go to component reference
[Trace - 4:05:39 PM] Sending request 'textDocument/definition - (227)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/razum/Development/code/jet-client/resources/js/Jetstream/ActionSection.vue"
    },
    "position": {
        "line": 6,
        "character": 21
    }
}


[Trace - 4:05:39 PM] Received response 'textDocument/definition - (227)' in 1ms.
Result: []

Template to reproduce - Laravel Jetstream

More easiest way to install with Laravel Installer and --jet option.

@johnsoncodehk
Copy link
Member

Please add "jsx": "preserve" to project tsconfig if it don't have.

@johnsoncodehk johnsoncodehk added the question Further information is requested label Apr 11, 2022
@slavarazum
Copy link
Author

@johnsoncodehk Thanks! Looks like it works.
Could you please explain how it works? Jetstream doesn't use jsx templates.

johnsoncodehk added a commit that referenced this issue Apr 12, 2022
@johnsoncodehk
Copy link
Member

volar support TS for template base on JSX so we need to have this config.

Relate issue: #1153

@senritsu
Copy link

senritsu commented May 13, 2022

Still getting a warning on the root template tag about enabling "jsx": "preserve" (and missing intellisense) although it is set in tsconfig.json. Likewise it seems that lib entries are ignored as well. Is there anything that could lead to Volar (running in takeover mode) not picking up the settings from tsconfig.json?

It worked a few weeks ago, and seems to have stopped working while we had a short break in the project.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Sep 21, 2022

@senritsu "jsx": "preserve" is not required any more, if you can't make it work, you could use v1.0.0-alpha for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants