Add CodeActionKind.intersects

Fixes #66881
This commit is contained in:
Matt Bierner
2019-01-21 18:03:38 -08:00
parent 86bb14550b
commit f929531dfb
5 changed files with 39 additions and 4 deletions

View File

@@ -1032,6 +1032,10 @@ export class CodeActionKind {
return new CodeActionKind(this.value ? this.value + CodeActionKind.sep + parts : parts);
}
public intersects(other: CodeActionKind): boolean {
return this.contains(other) || other.contains(this);
}
public contains(other: CodeActionKind): boolean {
return this.value === other.value || startsWith(other.value, this.value + CodeActionKind.sep);
}