[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread via cfe-commits
https://github.com/TsXor updated https://github.com/llvm/llvm-project/pull/102410 >From 4858eef099dbca66b2e3d36fc17aef574c1f3d58 Mon Sep 17 00:00:00 2001 From: TsXor Date: Thu, 8 Aug 2024 09:25:52 +0800 Subject: [PATCH 1/4] fix error handling of TranslationUnit.reparse --- clang/bindings/pyth

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread via cfe-commits
https://github.com/TsXor updated https://github.com/llvm/llvm-project/pull/102410 >From 4858eef099dbca66b2e3d36fc17aef574c1f3d58 Mon Sep 17 00:00:00 2001 From: TsXor Date: Thu, 8 Aug 2024 09:25:52 +0800 Subject: [PATCH 1/3] fix error handling of TranslationUnit.reparse --- clang/bindings/pyth

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread via cfe-commits
@@ -161,7 +161,34 @@ class TranslationUnitLoadError(Exception): FIXME: Make libclang expose additional error information in this scenario. """ -pass +# A generic error code, no further details are available. +# +# Errors of this kind can get their own s

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
@@ -149,8 +149,8 @@ def b(x: str | bytes) -> bytes: # this by marshalling object arguments as void**. c_object_p: TType[_Pointer[Any]] = POINTER(c_void_p) -### Exception Classes ### +### Exception Classes ### DeinAlptraum wrote: Unnecessary whitespace chang

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
@@ -161,7 +161,34 @@ class TranslationUnitLoadError(Exception): FIXME: Make libclang expose additional error information in this scenario. """ -pass +# A generic error code, no further details are available. +# +# Errors of this kind can get their own s

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
@@ -59,6 +59,9 @@ Clang Python Bindings Potentially Breaking Changes - Calling a property on the `CompletionChunk` or `CompletionString` class statically now leads to an error, instead of returning a `CachedProperty` object that is used internally. Properties are only avai

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
@@ -161,7 +161,34 @@ class TranslationUnitLoadError(Exception): FIXME: Make libclang expose additional error information in this scenario. DeinAlptraum wrote: I would say your change resolves the `FIXME` here. Thanks for expanding this to the `create`/`pars

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/102410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: A couple minor comments, and the code formatting should be fixed (see output of the failing CI run), and then this is good to go! https://github.com/llvm/llvm-project/pull/102410 ___ cfe-commits mailing list

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-10 Thread via cfe-commits
https://github.com/TsXor updated https://github.com/llvm/llvm-project/pull/102410 >From 4858eef099dbca66b2e3d36fc17aef574c1f3d58 Mon Sep 17 00:00:00 2001 From: TsXor Date: Thu, 8 Aug 2024 09:25:52 +0800 Subject: [PATCH 1/2] fix error handling of TranslationUnit.reparse --- clang/bindings/pyth

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-10 Thread via cfe-commits
@@ -152,6 +152,41 @@ def b(x: str | bytes) -> bytes: ### Exception Classes ### +class CXError(Exception): TsXor wrote: I looked at C header and found that `clang_parseTranslationUnit` and `clang_createTranslationUnit` actually swallows error code. To be uni

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-10 Thread via cfe-commits
https://github.com/TsXor commented: `CXError` is merged into `TranslationUnitLoadError`, and error code is preserved in another commit. https://github.com/llvm/llvm-project/pull/102410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-10 Thread via cfe-commits
https://github.com/TsXor edited https://github.com/llvm/llvm-project/pull/102410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-10 Thread via cfe-commits
https://github.com/TsXor updated https://github.com/llvm/llvm-project/pull/102410 >From 4858eef099dbca66b2e3d36fc17aef574c1f3d58 Mon Sep 17 00:00:00 2001 From: TsXor Date: Thu, 8 Aug 2024 09:25:52 +0800 Subject: [PATCH 1/2] fix error handling of TranslationUnit.reparse --- clang/bindings/pyth

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-08 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 98e4413a38f286147b863a6ead9625228ab0ec7d...c11dcf93d924eb9347d4cc9833c8b684920dfba0 clang

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-08 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/102410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-08 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/102410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-08 Thread Jannick Kremer via cfe-commits
@@ -152,6 +152,41 @@ def b(x: str | bytes) -> bytes: ### Exception Classes ### +class CXError(Exception): DeinAlptraum wrote: We already have a similar case with the bindings' `CXSaveError` for `clang_saveTranslationUnit` on the C side, for which we've impl

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-08 Thread Jannick Kremer via cfe-commits
@@ -3263,9 +3298,11 @@ def reparse(self, unsaved_files=None, options=0): unsaved_files = [] unsaved_files_array = self.process_unsaved_files(unsaved_files) -ptr = conf.lib.clang_reparseTranslationUnit( +result = conf.lib.clang_reparseTransla

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-08 Thread Jannick Kremer via cfe-commits
@@ -152,6 +152,41 @@ def b(x: str | bytes) -> bytes: ### Exception Classes ### +class CXError(Exception): +'''Represents C error of type enum CXErrorCode.''' + +# A generic error code, no further details are available. +# +# Errors of this kind can get their o

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-08 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: Thanks for this change! Looks good to me, aside from a few minor comments, most importantly a release note. Generally: for PR titles, a prefix ala "[libclang/python]" woud be good to denote the component or area of the code base, and empty description

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-08 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/102410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (TsXor) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/102410.diff 1 Files Affected: - (modified) clang/bindings/python/clang/cindex.py (+38-1) ``diff diff --git a/clang/bindings/python/clang/cindex.py

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-07 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-07 Thread via cfe-commits
https://github.com/TsXor edited https://github.com/llvm/llvm-project/pull/102410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits