-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
Code Completion in Jetbrains IntelliJ (WebStorm/PhpStorm) #328
Comments
This comment has been minimized.
This comment has been minimized.
I added a section for IntelliSense in VS Code: https://shoelace.style/getting-started/usage?id=code-completion I don't use WebStorm but if someone wants to add a similar file to the build for that editor I'd accept a PR. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
For anyone looking to implement this, run the build locally and look at |
I think this helps the issue. JetBrains launched web types. |
Some things have changed since my last comment. Shoelace now uses a standardized custom elements manifest called At a glance, it’s probably not hard to map this to For anyone interested in tackling this, check out the VS Code script for inspiration: https://github.com/shoelace-style/shoelace/blob/next/scripts/make-vscode-data.js I would expect it to work in the same manner. To automate generation, see |
Just an update. I was tinkering with your recommendation and manage to get a simple code completion working with the test version of the new web-types schema. Since it's a test version, and consequently not prod-ready, I don't think it's safe to add this to the build process. With that said, there was a Q&A on the JetBrains subreddit where I asked about web-types and their plans for the future. They plan to make web component manifest natively supported on the next WebStorm version. I guess right now we have to wait and see. Link to the answer: https://www.reddit.com/r/Jetbrains/comments/p1wd38/the_jetbrains_webstorm_team_is_here_to_answer/h8j2o0a?utm_source=share&utm_medium=web2x&context=3 |
Awesome. I'm going to close this since they'll be adding it in 2021.3. No need for a separate data file if they support |
I'm digging around that thing for some week now, trying to get IntelliJ to autocomplete the SL component and I had no luck on trying to achive it with the custom-elements.json provided by the SL package. Indeed I have not found any hint about IntelliJ really does support them so I don't really think this issue is fixed/closed :-) After some research I found [https://github.com/runem/web-component-analyzer/pull/239]( to the https://github.com/runem/web-component-analyzer which generates a {
"name": "shoelace-test",
"web-types": [
"path/to/web-types.json"
]
} You may have a look at the fork/branch I made where I tried to add that into the shoelace's build step: Just two notes on that:
Cheers, |
I'd rather massage
Same, and I have no idea what As I'm not a WebStorm user and have shifted focus to 2.0 stable, this feature is going to have to come from a contributor. |
From what I know, Also, around the time I was doing this, they launched a Q&A where I asked about web-component compatibility, and they said it was coming. So I didn't bother to read any further on the |
Thanks for your replies. I decided to asked the official JetBeans support about the support of
So it's not in there yet and waiting for a year now. So I put some effort in the massage :-) See here: It converts the custom-element.json into web-types.json by a JSONata expression (which needs jsonata as dev-dependency). Is this ok for you? |
That's a clean implementation, and much less expensive than running a second analyzer. I'd accept a PR for it, but I don't have the ability to test it. Can anyone using WebStorm verify that this is working as intended? Are you seeing all elements and attributes/values that you're expecting to see with it in your IDE now? |
Great :-) So I'll open a PR for that. It at least calmed the linter and offers the values for attributes as well as the event bindings for Angular. But since this is my very first contact as well with shoelace as with web components at all it surely would be helpful if somebody else can verify the functionality. |
Is your feature request related to a problem? Please describe.
Unfortunately I cannot get any auto-completion features to work with Jetbrains Intellij (Webstorm). This makes using shoelace components quite the hassle. Has anyone of you experience with setting this up?
Describe the solution you'd like
I am looking for a way to have IntelliJ's autocomplete suggest the Web Components Shoelace offers. I would like it to offer me
<sl-button>
when entering<sl-b
in a HTML file.Issue created for documentation as suggested by @claviska on Discord 👋
Best regards
Xyz3R
The text was updated successfully, but these errors were encountered: