redhat-developer / redhat-developer/yaml-language-server
Add allowComments Support
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
Is your enhancement related to a problem? Please describe.
Sometimes comments aren’t supported. I.e. a tool might strip comments.
Describe the solution you would like
From the language service it probably makes sense to add a new option for doValidation.
interface LanguageService {
doValidation(document: TextDocument, isKubernetes: boolean, allowComments: boolean): Promise<Diagnostic[]>
}
If this setting is true, any comment nodes will be reported.
For the language server it makes sense to add an option yaml.allowComments.
Describe alternatives you have considered
doValidation could accept an object with named properties instead.
interface DoValidationOptions {
allowComments?: boolean;
isKubernetes?: boolean;
}
interface LanguageService {
doValidation(document: TextDocument, options?: DoValidationOptions): Promise<Diagnostic[]>
}
Instead of reporting every comment node, only the first or last comment in a group of comments will be reported.
# This comment will be reported
# This comment will not be reported
# This comment will not be reported
foo: bar
# This comment will be reported
# This comment will not be reported
# This comment will not be reported
Or only one comment could be reported
# This comment will be reported
# This comment will not be reported
# This comment will not be reported
foo: bar
# This comment will not be reported
# This comment will not be reported
# This comment will not be reported
Additional context
This is a downstream request from remcohaszing/monaco-yaml#28
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the LanguageService.doValidation interface and the language server’s yaml.allowComments option described in the issue. Review the downstream request at remcohaszing/monaco-yaml#28 and resolve whether validation takes positional or named options and how comment groups are reported. Done means the option is exposed and comment diagnostics follow an agreed grouping behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100