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

refactor: abstract semanticService and syntacticService #2273

Merged
merged 1 commit into from Jan 3, 2023

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Jan 3, 2023

Migrate example:

const plugin: LanguageServerPlugin = () => ({
	extraFileExtensions: [{ extension: 'html', isMixedContent: true, scriptKind: 7 }],
-	semanticService: {
		getLanguageModules(host) {
			return [
				createTsLanguageModule(host.getTypeScriptModule()),
				createHtmlLanguageModule(host.getTypeScriptModule()),
			];
		},
-		getServicePlugins(_host, service) {
+		getLanguageServicePlugins(_host, service) {
			return [
				createTsPlugin(),
				createNgTemplateLsPlugin(service.context.documents),
			];
		},
-	},
-	syntacticService: {
-		getLanguageModules(ts) {
-			return [
-				createTsLanguageModule(ts),
-				createHtmlLanguageModule(ts),
-			];
-		},
-		getServicePlugins() {
-			return [
-				createTsPlugin(),
-			];
-		}
-	},
});

@johnsoncodehk johnsoncodehk changed the title refactor: abstract semanticService and syntacticService for LanguageServerPlugin refactor: abstract semanticService and syntacticService Jan 3, 2023
@johnsoncodehk johnsoncodehk merged commit cda8551 into master Jan 3, 2023
@johnsoncodehk johnsoncodehk deleted the server-plugin-api branch January 3, 2023 00:22
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.

None yet

1 participant