You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issues created within yang-lsp source have a precise context of start and end within LSP diagnostics, whereas Issues created within extensions only retain context of start but not the end which defaults(?) to [0,0] i.e., Line 1 Col 1, and eventually start and stop are swapped resulting in a misleading context of the issues.
Example extension for trial
packagemy.packimportio.typefox.yang.validation.IValidatorExtensionimportio.typefox.yang.validation.IssueFactoryimportio.typefox.yang.yang.AbstractModuleimportio.typefox.yang.yang.YangPackageimportorg.eclipse.xtext.util.CancelIndicatorimportorg.eclipse.xtext.util.IAcceptorimportorg.eclipse.xtext.validation.IssueclassMyExampleValidatorimplementsIValidatorExtension {
overridevalidate(AbstractModulemodule, IAcceptor<Issue>issueAcceptor, CancelIndicatorcancelIndicator) {
if (module.getName().equals("foo")) {
issueAcceptor.accept(IssueFactory.createIssue(module,
YangPackage.Literals.ABSTRACT_MODULE__NAME,
"'foo' is a bad name", "bad_name"))
}
}
}
Verbose trace excerpt from YANG Language server - foo.log
Manifestation of the issue in VS Code Yangster extension
In the example above precisely foo is expected to be underlined
The editor user experience is degraded to a large extent, specially if an Issue pertaining to a context towards the end of a YANG file which ends up underlining from the start of the file till what is actually the start of the issue context. This further gets complicated when there are multiple issues raised via extensions since a list of issues are presented in the context that precedes the actual errors.
The text was updated successfully, but these errors were encountered:
esmasth
changed the title
IValidatorExtension based Issues manifest with wrong context over LSPIValidatorExtension based Issue manifests with wrong context over LSP
May 1, 2024
Issue
s created within yang-lsp source have a precise context ofstart
andend
within LSPdiagnostics
, whereasIssue
s created within extensions only retain context ofstart
but not theend
which defaults(?) to [0,0] i.e., Line 1 Col 1, and eventuallystart
andstop
are swapped resulting in a misleading context of the issues.Example extension for trial
Verbose trace excerpt from YANG Language server - foo.log
Manifestation of the issue in VS Code Yangster extension
In the example above precisely
foo
is expected to be underlinedThe editor user experience is degraded to a large extent, specially if an Issue pertaining to a context towards the end of a YANG file which ends up underlining from the start of the file till what is actually the start of the issue context. This further gets complicated when there are multiple issues raised via extensions since a list of issues are presented in the context that precedes the actual errors.
The text was updated successfully, but these errors were encountered: