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
Is it possible to get intelliSense for variables in petite/vue? #1471
Comments
You need config |
That config and adding |
If it can't working without I can't say anything about the typescript support in .html, I'm not familiar with it. Technically volar can check |
I guess I will for now create a fork of Volar and explore which changes need to be made for First: Allow TypeScript inside script tags, Second: Even with <script lang="ts">
import { createApp, reactive } from "https://unpkg.com/petite-vue?module";
let name = "Mike";
const store = reactive({
count: 0,
inc() {
this.count++;
},
});
// manipulate it here
store.inc();
function handler() {
console.log("hi")
}
createApp({
// share it with app scopes
store,
}).mount();
</script>
// intelliSense works fine.
<button @click="store.inc">{{store.count}}</button>
// with function variables not related to petite-vue I have no intelliSense
<button @click="handler">{{name}}</button> Especially the last button example is giving me headages, for now only |
Do you mean allow use TypeScript without
This is intentional, I just don't know we can bypass createApp to access variables because I have not working on a real petite-vue project, maybe you can add tests for your expected behaviors to https://github.com/johnsoncodehk/volar/tree/master/packages/vue-test-workspace/typeChecks, so I can reference it to fix. |
No, |
It sounds like this is not something volar handles, volar only does type-checking, typescript compile needs to do on the |
Right, I don't even need to compile, I have my own version of petite(forked) which includes a custom compiler just made to remove typescript from |
@ivanjeremic Okay I see you problem now, don't know can't write typescript in script tag with |
Thanks, that would be awesome. If there is any chance to also autocomplete functions and variables inside my html for non petite-vue related code it would be very helpful too. I will try to help with this repo as much as I can in the future because it solves my problems too. |
Please try v0.38.1 and let me know if something not working to you. |
TS error with |
Thanks, I was now googeling around an was able to disable |
It should be supported in 0.38.3, please let me know if anything not working. |
TS is working fine now thanks! :) What I noticed is when I need a function inside my
writing |
This is a known issue, please track #1284. |
I think we should re-open this issue because of this discord Discussion. https://discord.com/channels/793943652350427136/899997357649821716/1017470344090624064 |
Is the Discord linked above still open? I tried to access it and couldn't reach the page. I looking to find some documentation on how to setup VS Code so that I can get intellisense inside my html markup for all |
does not work, even this didn't help |
Is it technically possible to get intelliSense between javascript variables and functions in the script tag and the variables used in the html?
When I hover in my
p
tag overstore
is it technically possible to get some feedback when hovering over as we would in an js file or .vue file?The text was updated successfully, but these errors were encountered: