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

No definition found #29

Open
andyjessop opened this issue Nov 13, 2023 · 4 comments
Open

No definition found #29

andyjessop opened this issue Nov 13, 2023 · 4 comments

Comments

@andyjessop
Copy link

andyjessop commented Nov 13, 2023

I've installed the language server on VSCode. I have a custom element, defined by lit, and I've tried to Go to Definition. I get this:

Screenshot 2023-11-13 at 11 33 01

Here are the logs:

NODE VERSION:  v16.17.1
Startup at  2023-11-13T10:32:03.261Z
Initializing connection
Initializing documents
Initializing workspaces.
Initializing workspace runestone @ file:///Users/andy/dev/runestone
Package JSON path  /Users/andy/dev/runestone/package.json
Could not find a main or module file
Connection initialized
Tried to refresh a non-existant cache. Attempted /Users/andy/dev/runestone, but the only ones available are:  []
Tried to refresh a non-existant cache. Attempted /Users/andy/dev/runestone, but the only ones available are:  []
Tried to refresh a non-existant cache. Attempted /Users/andy/dev/runestone, but the only ones available are:  []
Initializing CEM's
Manifest file written to  /Users/andy/dev/runestone/apps/client/node_modules/.cache/custom-elements-language-server/custom-elements.json
CEM Cache initialized. LocalCEM Present: true. Dependency CEM Count: 0
Manifest file written to  /Users/andy/dev/runestone/apps/client/node_modules/.cache/custom-elements-language-server/custom-elements.json
@Matsuuu
Copy link
Owner

Matsuuu commented Nov 13, 2023

Thank you for this thorough report! Do you have a open source project I could test this on? Or a minimal repro

@Matsuuu
Copy link
Owner

Matsuuu commented Nov 13, 2023

Fiddled around with some old code that I've been meaning to rework. It might have actually solved your problem too. Try it out with the version 1.0.4 and tell me how it's treating ya

@andyjessop
Copy link
Author

I'm afraid I don't have either. The only extra information I can give is that this is inside a monorepo, so the workspace root is not the app root.

Just seen your latest comment - I'll give it a go!

@mbozsoki
Copy link

Hey! I had the same problem and I think it was caused by the plugin not knowing about I am using litelement in my project, so the tagname and other information was not extracted to the manifest file generated in node_modules/.cache

For me defining the custom-elements-manifest.config.js config file in the root of my project has solved the issue.

Example:
https://github.com/Matsuuu/custom-elements-language-server/blob/main/usage-testing-project/custom-elements-manifest.config.js

Hope this is helpful for you!

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

No branches or pull requests

3 participants