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

chore(fast-todo-app): setup custom elements language server #6900

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

matteematt
Copy link

@matteematt matteematt commented Jan 25, 2024

Pull Request

📖 Description

Over the last six months we've been working on an LSP plugin for the tsserver which adds custom elements support in tagged template literals. The LSP is build to be extensible for different custom elements dialects, but we've added support for Microsoft FAST ourselves.
This PR installs the LSP in the todo-app example repo as a showcase. This isn't necessarily the best showcase of the LSP due to the fact that this app doesn't use many custom elements, or any from dependencies. I am keen to install it more globally in the repo, or across more apps, dependening on whether you want this adding at all.

demo

🎫 Issues

👩‍💻 Reviewer Notes

📑 Test Plan

The way to test this depends on your IDE setup, and the way it works with the LSP. You can see in depth info for this here, but I assume you're using vscode so will provide some quick instrucitons below.

1. Check out the branch and use yarn to update the installed dependencies.
2. Navigate to the `todo-app` project directory
3. `$ mkdir .vscode && echo '{ "typescript.tsdk": "../../node_modules/typescript/lib" }' >> .vscode/settings.json` ⚠️ if you've already got project specific settings in this file for your editor then you can manually set the config in your existing file instead.
4. Open vscode at this todo app project level `$ code .`
5. Open a javascript/typescript file and use the command palette to `Select typescript version` and choose the local version.
6. The LSP should now be enabled. You will only see diagnostics information after first interacting with the file

You can observe in todo-app.template.ts if you type a < you'll get a suggestion for <todo-form>

✅ Checklist

General

  • I have included a change request file using $ yarn change - Contributing guidelines state this is only necessary if you're changing files in the packages/* directory, which this PR is not.
  • I have added tests for my changes. - N/A
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes. - N/A
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

None of these

⏭ Next Steps

Happy to discuss or answer any questions you may have!

@matteematt matteematt marked this pull request as ready for review January 25, 2024 11:47
@janechu
Copy link
Collaborator

janechu commented May 30, 2024

I want to just drop a note here, this is very interesting and we'll be checking back in after our launch of v2 for @microsoft/fast-element.

@matteematt
Copy link
Author

open-wc/custom-elements-manifest#276

Raised the breaking change at the analyser repo

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

Successfully merging this pull request may close these issues.

2 participants