Add yang.settings toggles for language server features#254
Open
esmasth wants to merge 1 commit intoTypeFox:masterfrom
Open
Add yang.settings toggles for language server features#254esmasth wants to merge 1 commit intoTypeFox:masterfrom
esmasth wants to merge 1 commit intoTypeFox:masterfrom
Conversation
a6a0c8b to
68aee8b
Compare
Add on/off toggle settings for 12 LSP features: code-lenses, semantic-tokens, validation, formatting, code-actions, completion, hover, definition, references, document-symbols, document-highlight, and rename. All default to 'on'. Also fixes the settings schema key 'code-lens-enabled' to match the actual preference key 'code-lenses' used in CodeLensService. Closes TypeFox#253
68aee8b to
01e6ca1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
on/offtoggle settings inyang.settingsfor 12 LSP features, allowing users to disable individual features for performance or compatibility reasons.Changes
YangFeatureToggleKeys.java(new) — Preference keys for all toggleable featuresYangSyncDiagramLanguageServer.java— All feature toggle overrides (semantic tokens, completion, hover, definition, references, document symbols, document highlight, rename, code actions, formatting)yang-lsp-settings-schema.json— Added all toggle entries; fixedcode-lens-enabled→code-lensesto match the actual preference key inCodeLensServicedocs/Settings.md— Updated documentation with feature toggles sectionFeatureToggleTest.xtend— Test verifying validation produces issues by defaultDesign
All toggle checks are centralized in
YangSyncDiagramLanguageServerrather than distributed across individual service classes. This avoids issues withPreferenceValuesProviderinjection in contexts where the full language runtime isn't available (e.g., LSP integration tests), and keeps the guard logic in one place.The existing
code-lensestoggle inCodeLensServiceis left as-is since it predates this change and works correctly.Settings
All features default to
on. Exampleyang.settings:{ "semantic-tokens": "off", "code-lenses": "off", "validation": "on" }Note: The only pre-existing test failure is
CodeLensTest.testCodeLenswhich also fails on upstream master.Closes #253