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

Decouple sub language services with top-level MetadataStore #803

Closed
octref opened this issue May 22, 2018 · 1 comment
Closed

Decouple sub language services with top-level MetadataStore #803

octref opened this issue May 22, 2018 · 1 comment

Comments

@octref
Copy link
Member

octref commented May 22, 2018

Motivation

Currently, html language services use the javascript language service by directly including an instance of the latter. However, for issues such as #130, this would require an instance of CSS LS in HTML, and the vice versa. These dependencies make each LS inter-dependent and hard to understand.

With #800, we can also have a top-level document MetadataSore that consumes FileService and provide up-to-date metadata that's generated from a particular language service, for example:

  • File change happens on a file's style region
  • CSS LS re-parses style region
  • All class names are stored under css.classes for that file

Later the user triggers html class completion

  • HTML LS determines it's a class name completion request
  • metadataStore.getMetadata(doc.uri)["css.classes"] will have the relevant data
  • Use those data to generate completions

Another place that can be simplified is the current findComponents, which provides component intellisense based on the shape of each of the depended components.

Benefits

  • Generation of metadata is event-based instead of LSP-feature triggered. This will likely make processing LSP feature faster since some parsing work will have been finished during the language feature request timeframe.
  • Less coupling of language services
  • Will help Type checking for template expressions #681's overall structure
@octref
Copy link
Member Author

octref commented May 10, 2019

Already done and used in Vetur's completion.

@octref octref closed this as completed May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant