-
Notifications
You must be signed in to change notification settings - Fork 784
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
Add support for completionList.applyKind
to determine how values from completionList.itemDefaults
and completion
are combined.
#2018
Open
DanTup
wants to merge
6
commits into
microsoft:gh-pages
Choose a base branch
from
DanTup:add-apply-kind
base: gh-pages
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+111
−1
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7ad8da8
Add support for `completionList.applyKind` to determine how values fr…
DanTup ab78abf
Update completion.md
DanTup 9886c0e
Simplify by removing distinction between null/undefined
DanTup 832f719
Use a single client capability + add ApplyKind enum/type
DanTup f094493
Make this clearer
DanTup 21ff7ad
Minor fixes
DanTup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to rely on
itemDefaults
capability being supported. Would it make it more obvious if it would be called something likeitemDefaultsApplyKinds
?And another discussion could be had about the "applyKinds" naming. It doesn't feel very descriptive to me (perhaps subjective). Also it refers to "kind" which is a concept that is already present in completion items that is not related to "kinds" here. Perhaps a better one would be `itemDefaultsMergeStrategy" (although it might be weird to call it "merge strategy" when the strategy can either replace or merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel strongly about the name, though I think like
apply
more thanmerge
since as you say, merge is one option. Maybe something like "combine" is a bit clearer? I do agreekind
maybe could be clearer (strategy? method?)I had a scan through the spec to see if there's anything similar we could name it the same as, but I couldn't find anything that feels the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name it
applyKindSupport: boolean
. We should also add aApplyKind
definition since the spec usually doesn't use inline string or types something likeI do think one boolean is enough due to: if a client supports the new filed (e.g. via itemDefaults) and it opts into
applyKindSupport
it MUST then support the new filed in the applyKind literal. I think that is fair.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you are fine with using the
kind
wording even though completion items already have a concept ofkind
that is something completely different?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbaeumer I've pushed changes to this affect - PTAL! I did wonder if we should use
ApplyKind
orCompletion(Item?)ApplyKind
.. I don't know if we might support replace/merge elsewhere in future and if so we'd want to use the same enum or not?@rchl
There are a lot of
kind
s in the spec so I don't think reusing kind is bad (it'sCompletionItemKind
vsApplyKind
), although I'll note we also haveInsertTextMode
which is a "mode", so that's possibly another option?