Skip to content

feat(language-server): add support for Workspace Diagnostics#199

Merged
johnsoncodehk merged 2 commits intomasterfrom
workspace-diagnostics
Jun 8, 2024
Merged

feat(language-server): add support for Workspace Diagnostics#199
johnsoncodehk merged 2 commits intomasterfrom
workspace-diagnostics

Conversation

@johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Jun 8, 2024

Close #43, implement connection.languages.diagnostics.onWorkspace of language server.

LS Plugin Code Sample

const plugin: LanguageServicePlugin = {
	capabilities: {
		diagnosticProvider: {
			workspaceDiagnostics: true,
		},
	},
	create(context): LanguageServicePluginInstance<Provide> {
		return {
			provideWorkspaceDiagnostics() {
				return [{
					uri: 'file://a.css',
					items: [{
						severity: 2,
						source: 'html1',
						message: 'Only one style tag is allowed.',
						// ...
					}]
				}];
			}
		};
	},
}

@johnsoncodehk johnsoncodehk merged commit cd3bd76 into master Jun 8, 2024
@johnsoncodehk johnsoncodehk deleted the workspace-diagnostics branch June 8, 2024 22:51
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.

Support for Workspace Diagnostics

1 participant