Author: Jannick Kremer Date: 2026-07-22T21:04:59+09:00 New Revision: 3ac7573589eaa2d3ea107285ca10e0f52cbfbcfd
URL: https://github.com/llvm/llvm-project/commit/3ac7573589eaa2d3ea107285ca10e0f52cbfbcfd DIFF: https://github.com/llvm/llvm-project/commit/3ac7573589eaa2d3ea107285ca10e0f52cbfbcfd.diff LOG: [libclang/python] Remove CompletionChunk.isKind methods (#210678) This completes the third step of https://github.com/llvm/llvm-project/issues/156680 This change is a follow-up to https://github.com/llvm/llvm-project/pull/177854, following the release branching, to ensure a one release-cycle deprecation period. Added: Modified: clang/bindings/python/clang/cindex.py clang/docs/ReleaseNotes.md Removed: ################################################################################ diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py index 24b737139dba8..91f6c1a402aa6 100644 --- a/clang/bindings/python/clang/cindex.py +++ b/clang/bindings/python/clang/cindex.py @@ -3184,57 +3184,6 @@ def string(self) -> CompletionString | None: return None return CompletionString(res) - __deprecation_message = ( - "'CompletionChunk.{}' will be removed in a future release. " - "All uses of 'CompletionChunk.{}' should be replaced by checking " - "if 'CompletionChunk.kind` is equal to 'CompletionChunkKind.{}'." - ) - - def isKindOptional(self) -> bool: - deprecation_message = self.__deprecation_message.format( - "isKindOptional", - "isKindOptional", - "OPTIONAL", - ) - warnings.warn(deprecation_message, DeprecationWarning) - return self.kind == CompletionChunkKind.OPTIONAL - - def isKindTypedText(self) -> bool: - deprecation_message = self.__deprecation_message.format( - "isKindTypedText", - "isKindTypedText", - "TYPED_TEXT", - ) - warnings.warn(deprecation_message, DeprecationWarning) - return self.kind == CompletionChunkKind.TYPED_TEXT - - def isKindPlaceHolder(self) -> bool: - deprecation_message = self.__deprecation_message.format( - "isKindPlaceHolder", - "isKindPlaceHolder", - "PLACEHOLDER", - ) - warnings.warn(deprecation_message, DeprecationWarning) - return self.kind == CompletionChunkKind.PLACEHOLDER - - def isKindInformative(self) -> bool: - deprecation_message = self.__deprecation_message.format( - "isKindInformative", - "isKindInformative", - "INFORMATIVE", - ) - warnings.warn(deprecation_message, DeprecationWarning) - return self.kind == CompletionChunkKind.INFORMATIVE - - def isKindResultType(self) -> bool: - deprecation_message = self.__deprecation_message.format( - "isKindResultType", - "isKindResultType", - "RESULT_TYPE", - ) - warnings.warn(deprecation_message, DeprecationWarning) - return self.kind == CompletionChunkKind.RESULT_TYPE - SPELLING_CACHE = CompletionChunk.SpellingCacheAlias() diff --git a/clang/docs/ReleaseNotes.md b/clang/docs/ReleaseNotes.md index 50e1c4ce88797..81ad87d6a9014 100644 --- a/clang/docs/ReleaseNotes.md +++ b/clang/docs/ReleaseNotes.md @@ -70,6 +70,12 @@ features cannot lower the translation-unit ABI level; ### Clang Python Bindings Potentially Breaking Changes +- Remove the deprecated `CompletionChunk.isKind...` methods. + Existing uses should be adapted to directly compare equality of the `CompletionChunk` kind with the corresponding `CompletionChunkKind` variant. + + Affected methods: `isKindOptional`, `isKindTypedText`, `isKindPlaceHolder`, + `isKindInformative` and `isKindResultType`. + ### OpenCL Potentially Breaking Changes ## What's New in Clang {{env.config.release}}? _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
