[Github-comments] Re: [geany/geany] preview mode? or say an editor tab for impersistently showing a file in R/O mode (Issue #3327)

2022-11-13 Thread elextr
@yashpalgoyal1304 

> so, some measure of difficulty - in implementation and the nature of it - 
> ofcourse, it's all relative, but still, some idea on if it will be more 
> mechanical - or like would involve more diving into (relatively) large number 
> of corners and stuff...

Given it changes the behaviour of tabs (change the document in an existing tab 
isn't available now AFAIK) I would guess its gonna need significant work in 
Geany itself, not just the plugin, but who knows, "somebody" would have to 
investigate and only "somebody" who wants the feature is likely to do that 
(probably leaves out @eht16 ;-).  Simulating it by closing a tab and opening a 
new tab might be possible from the plugin itself, but also may generate visual 
artefacts, "somebody" would have to test it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3327#issuecomment-1312924500
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] Add --library=gtk to cppcheck (PR #1197)

2022-11-13 Thread elextr
@elextr commented on this pull request.



> @@ -347,7 +348,7 @@ static void gdb_finalize(void)
if (send_channel)
{
g_io_channel_shutdown(send_channel, FALSE, NULL);
-   g_io_channel_unref(send_channel);
+   g_io_channel_unref(send_channel); // cppcheck-suppress 
doubleFree // should be fine

AFAICT the unref is needed, the `g_io_channel_shutdown()` documentation, erm 
...source ;-) shows it doesn't unref it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1197#discussion_r1020997544
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] preview mode? or say an editor tab for impersistently showing a file in R/O mode (Issue #3327)

2022-11-13 Thread elextr
> I saw this feature in VSCode at colleagues and it made me cry mentally. 

A, there there ;-)

> At least if not implemented properly or not used properly, it can create a 
> very bad user experience.

In vscode its not really opened in read only, the cursor can be moved to the 
tab and changes made.  It was ages before I even noticed the preview, as I 
always only opened things I wanted to change, and the change exited preview 
mode. And single click and then enter focuses the tab and exits preview mode, 
or double click focuses the tab and opens non-preview same as filebrowser.

It might be a useful function for finding something in a codebase that the user 
doesn't know, but "find in files" or "go to declaration/definition" tend to be 
better navigation tools than the mk1 eyeball.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3327#issuecomment-1312877089
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] cppcheck throws error - warning: There is an unknown macro here somewhere G_DEFINE_TYPE (Issue #1196)

2022-11-13 Thread elextr
Maybe merge #1201 and then sort out what still fails?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1196#issuecomment-1312860063
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] debug plugin doesn't work on my Mac (#1019)

2022-11-13 Thread FunnyGiraffe
do you fix it?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1019#issuecomment-1312780557
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] cppcheck throws error - warning: There is an unknown macro here somewhere G_DEFINE_TYPE (Issue #1196)

2022-11-13 Thread Enrico Tröger
Sigh, the old cppcheck version in the CI doesn't seem to respect the inline 
suppressions :(.
In #1201 we switched the CI system to Ubuntu 20.04. Should I cherry-pick the 
commit 
https://github.com/geany/geany-plugins/pull/1201/commits/de6304c5d63a9b5902313695b56bc0b8d15f4510
 into here?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1196#issuecomment-131267
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] preview mode? or say an editor tab for impersistently showing a file in R/O mode (Issue #3327)

2022-11-13 Thread yashpalgoyal1304
> What kind of answer do you expect? An amount of hours? Relative to another 
> feature?

effort might not have been a correct word - sorry - i meant to ask for 
difficulty

so, some measure of difficulty - in implementation and the nature of it - 
ofcourse, it's all relative, but still, some idea on if it will be more 
mechanical - or like would involve more diving into (relatively) large number 
of corners and stuff...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3327#issuecomment-1312776757
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] cppcheck throws error - warning: There is an unknown macro here somewhere G_DEFINE_TYPE (Issue #1196)

2022-11-13 Thread Enrico Tröger
> Either my testing is wrong or cppcheck ignores these macros.

cppcheck seems to test with different combinations of preprocessor macros. See 
https://cppcheck.sourceforge.io/manual.html#preprocessor-settings. However, I 
still don't understand why it always chokes on the `argv` array.
For now, I suppressed the warning and also the one in the vimmode plugin.

But there are still a few errors left where I have no idea what the problem is 
and how to fix them or whether we can ignore them. Any help is much appreciated.

@kugel- @techee @elextr and anyone else.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1196#issuecomment-1312775519
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] Add --library=gtk to cppcheck (PR #1197)

2022-11-13 Thread Enrico Tröger
@eht16 commented on this pull request.



> @@ -347,7 +348,7 @@ static void gdb_finalize(void)
if (send_channel)
{
g_io_channel_shutdown(send_channel, FALSE, NULL);
-   g_io_channel_unref(send_channel);
+   g_io_channel_unref(send_channel); // cppcheck-suppress 
doubleFree // should be fine

I have no idea if this correct, maybe the unref call is indeed too much?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1197#pullrequestreview-1178270678
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] Add --library=gtk to cppcheck (PR #1197)

2022-11-13 Thread Enrico Tröger
@eht16 commented on this pull request.



> @@ -377,7 +381,10 @@ static gchar *pastebin_get_language(const Pastebin 
> *pastebin,
 gchar *lang = g_key_file_get_string(pastebin->config, 
PASTEBIN_GROUP_LANGUAGES,
 geany_ft_name, NULL);
 
-return lang ? lang : pastebin_get_default(pastebin, "language", "");
+if (lang)

It seems cppcheck doesn't like the tertiary operator in this case.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1197#pullrequestreview-1178270613
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] Add --library=gtk to cppcheck (PR #1197)

2022-11-13 Thread Enrico Tröger
@eht16 commented on this pull request.



> @@ -102,6 +102,10 @@ PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE, 
> PLUGIN_NAME,
  PLUGIN_VERSION, "Enrico Trotta 
")
 
 
+static void show_msgbox(GtkMessageType type, GtkButtonsType buttons,

This is to trick cppcheck: it complains that it doesn't know `G_GNUC_PRINTF` 
when it is used in the function definition. But it is ok (probably ignored) if 
it is used in the function declaration.

This macro is used in other places in G-P in function declarations as well, so 
I guess it is fine.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1197#pullrequestreview-1178270527
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] Add --library=gtk to cppcheck (PR #1197)

2022-11-13 Thread Enrico Tröger
@eht16 pushed 1 commit.

d1d631a9bcc644d6453f0da6805a852c0f543ab0  Fix resp. ignore memory leaks 
reported by cppcheck

-- 
View it on GitHub:
https://github.com/geany/geany-plugins/pull/1197/files/38940c4341178e4ac09d4c1422d94d2c47c270f9..d1d631a9bcc644d6453f0da6805a852c0f543ab0
You are receiving this because you are subscribed to this thread.

Message ID: 


[Github-comments] Re: [geany/geany-plugins] Add --library=gtk to cppcheck (PR #1197)

2022-11-13 Thread Enrico Tröger
@eht16 pushed 9 commits.

4eca3fe1073b15addf1805f024a7cddae7a950b6  git-changebar: Simplify libgit2 
version checks
c25006972ce897a1ed446e56584d1fb316378d5a  git-changebar: Add support for 
libgit2 1.4
4b49d2dd6742bc3c8820ea0b5f23554357633245  git-changebar: Avoid harmless warnings
d0200a74ce5b4244a258976898659b13d90e  Remove obsolete status badge
85b4ce38acbc2b9342bace79befa6b0af2be7076  Remove self as maintainer for 
treebrowser plugin
55e9902230081c49c600a418e0f8dab12e87b5a7  po: Update Ukrainian translation
979c12ff79712396138eda2d6dc5af8024b262a9  TreeBrowser: Port spawning external 
commands to the spawn API
f802dbd9aa643337da2b0b23e454d88df5f74edb  TreeBrowser: Fix refresh from popup 
menu with a selected file
38940c4341178e4ac09d4c1422d94d2c47c270f9  Fix resp. ignore memory leaks 
reported by cppcheck

-- 
View it on GitHub:
https://github.com/geany/geany-plugins/pull/1197/files/d17e11928d66b234343fb20cc498e36114138ba0..38940c4341178e4ac09d4c1422d94d2c47c270f9
You are receiving this because you are subscribed to this thread.

Message ID: 


[Github-comments] Re: [geany/geany] preview mode? or say an editor tab for impersistently showing a file in R/O mode (Issue #3327)

2022-11-13 Thread Enrico Tröger
What kind of answer do you expect? An amount of hours? Relative to another 
feature?
It highly depends on how it will be implemented and also how experienced the 
person implementing it is.

I saw this feature in VSCode at colleagues and it made me cry mentally. At 
least if not implemented properly or not used properly, it can create a very 
bad user experience.
So, if implemented at all, it should be in the FileBrowser plugin and it should 
be configurable with a default to off.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3327#issuecomment-1312770771
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] preview mode? or say an editor tab for impersistently showing a file in R/O mode (Issue #3327)

2022-11-13 Thread yashpalgoyal1304
> "Somebody" could add the functionality to the filebrowser plugin to open or 
> focus its "Preview" tab and show the file in it when selected.

any idea on how much effort would that be?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3327#issuecomment-1312759260
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Show keyboard shortcuts in the hover tooltips for icons on toolbar (Issue #3328)

2022-11-13 Thread yashpalgoyal1304
Closed #3328 as not planned.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3328#event-7798602404
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Show keyboard shortcuts in the hover tooltips for icons on toolbar (Issue #3328)

2022-11-13 Thread yashpalgoyal1304
> Well, most of the toolbar buttons don't actually have shortcuts. AFAICT only 
> colour chooser and focussing the search entry have shortcuts.
> 
> Certainly some buttons activate the same functionality as menu items, most of 
> which do have shortcuts (but not "New from template" for example), but some 
> toolbar buttons have slightly different functionality, eg search uses its own 
> entry, not the find dialog, and it does have its own shortcut to focus that 
> entry.

well, that makes sense

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3328#issuecomment-1312759021
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] rename documents (Issue #3326)

2022-11-13 Thread yashpalgoyal1304
> `File->Save As` use the `Rename` button.
> Closing as existing

umh, i really think that an entry for this should be added to the context menu 
of documents or files tab on sidebar

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3326#issuecomment-1312758468
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] [geany/geany] Use constructor method calltip only if available (PR #3334)

2022-11-13 Thread Enrico Tröger
For D and Python, we try to read the calltip from the constructor method (e.g. 
"__init__" for Python) instead of from the class tag itself. If we 
don't find a matching constructor method tag, now we continue looking at 
the class tag itself.

This is useful for global tags where the constructor signature might be defined 
on the class tag itself.
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/3334

-- Commit Summary --

  * Use constructor method calltip only if available

-- File Changes --

M src/editor.c (14)

-- Patch Links --

https://github.com/geany/geany/pull/3334.patch
https://github.com/geany/geany/pull/3334.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3334
You are receiving this because you are subscribed to this thread.

Message ID: 


[Github-comments] Re: [geany/geany] CI: Use MSYS2 for Windows build (PR #3315)

2022-11-13 Thread Enrico Tröger
@eht16 commented on this pull request.



> + sed -i -E "s/^!define PRODUCT_VERSION_ID \"@VERSION@.0.0\"/!define 
> PRODUCT_VERSION_ID \"${MAJOR}.${MINOR}.${PATCH}.90\"/" 
> ${GEANY_BUILD_DIR}/geany.nsi.in
+}
+
+
+build_geany() {
+   cd ${GEANY_BUILD_DIR}
+   log "Running autogen.sh"
+   ./autogen.sh
+   log "Running configure"
+   ./configure ${CONFIGURE_OPTIONS}
+   log "Running make"
+   make
+   log "Running install-strip"
+   make install-strip
+
+   cd /

Removed, thanks for the pointer.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3315#discussion_r1020905051
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] CI: Use MSYS2 for Windows build (PR #3315)

2022-11-13 Thread Enrico Tröger
> Can you add a stub with an (perhaps commented out) example on how to build 
> new dependencies for CI builds?

I don't get it :(. Where should I add the example and what do you mean by 
"build new dependencies"?



-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3315#issuecomment-1312731386
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] Add mingw-w64 (Windows) CI build (PR #1201)

2022-11-13 Thread Enrico Tröger
@eht16 pushed 1 commit.

2e6ef9a1967751dabd5216372481a97d7cb06d4c  Remove unnecessary directory changes

-- 
View it on GitHub:
https://github.com/geany/geany-plugins/pull/1201/files/bbbee5b915604c3148cf32e5623c2b1312dfdc6a..2e6ef9a1967751dabd5216372481a97d7cb06d4c
You are receiving this because you are subscribed to this thread.

Message ID: 


[Github-comments] Re: [geany/geany] CI: Use MSYS2 for Windows build (PR #3315)

2022-11-13 Thread Enrico Tröger
@eht16 pushed 1 commit.

ef2b6e5039e021b1b5d613eff90996f9c53da709  Remove unnecessary directory changes

-- 
View it on GitHub:
https://github.com/geany/geany/pull/3315/files/94b6e948360cd7a6bcc1dbe2e52a12ec737fda5e..ef2b6e5039e021b1b5d613eff90996f9c53da709
You are receiving this because you are subscribed to this thread.

Message ID: 


[Github-comments] Re: [geany/geany] CI: Use MSYS2 for Windows build (PR #3315)

2022-11-13 Thread Enrico Tröger
@eht16 commented on this pull request.



> + -ts http://zeitstempel.dfn.de/ \
+   -h sha512 \
+   -in ${1} \
+   -out ${1}-signed
+   mv ${1}-signed ${1}
+   else
+   echo "Skip signing due to missing certificate"
+   fi
+}
+
+
+sign_geany_binaries() {
+   log "Signing Geany binary files"
+   for binary_file_pattern in ${GEANY_RELEASE_BINARY_PATTERNS[@]}; do
+   for binary_file in $(ls ${binary_file_pattern}); do
+   sign_file ${binary_file}

osslsigncode (and probably the original "signcode.exe" tool) are made for 
signing binary files, see 
https://github.com/mtrojnar/osslsigncode#what-can-it-do.

To get sure things haven't changed, I tried to sign an arbitary text file:
```
root@9214a3c76917:/build# osslsigncode sign -certs /certs/cert.pem -key 
/certs/key.pem -n "Test file" -i "https://www.geany.org/"; -ts 
http://zeitstempel.dfn.de/ -h sha512 -in /etc/wgetrc -out wgetrc-s
Unrecognized file type: /etc/wgetrc
140619785353856:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong 
tag:../crypto/asn1/tasn_dec.c:1149:
140619785353856:error:0D07803A:asn1 encoding 
routines:asn1_item_embed_d2i:nested asn1 
error:../crypto/asn1/tasn_dec.c:309:Type=PKCS8_PRIV_KEY_INFO
140619785353856:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong 
tag:../crypto/asn1/tasn_dec.c:1149:
140619785353856:error:0D08303A:asn1 encoding 
routines:asn1_template_noexp_d2i:nested asn1 
error:../crypto/asn1/tasn_dec.c:572:
140619785353856:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong 
tag:../crypto/asn1/tasn_dec.c:1149:
140619785353856:error:0D07803A:asn1 encoding 
routines:asn1_item_embed_d2i:nested asn1 
error:../crypto/asn1/tasn_dec.c:309:Type=RSAPrivateKey
140619785353856:error:04093004:rsa routines:old_rsa_priv_decode:RSA 
lib:../crypto/rsa/rsa_ameth.c:142:
140619785353856:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong 
tag:../crypto/asn1/tasn_dec.c:1149:
140619785353856:error:0D07803A:asn1 encoding 
routines:asn1_item_embed_d2i:nested asn1 
error:../crypto/asn1/tasn_dec.c:309:Type=PKCS8_PRIV_KEY_INFO
Failed
```

Note, for the CI builds nothing is signed because no certificates are available 
to the build container. It wouldn't make sense to sign automatically built code 
since we have no control over the build system and its integrity, how should we 
tell the user that the generated binaries are really clean?
Additionally, we had to give the build system access to the private key of a 
certificate which would mean Github can access and in the worst case manipulate 
the certificate.
So, CI builds should never be trusted.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3315#discussion_r1020902509
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] CI: Use MSYS2 for Windows build (PR #3315)

2022-11-13 Thread Enrico Tröger
@eht16 commented on this pull request.



> + log "Signing Geany binary files"
+   for binary_file_pattern in ${GEANY_RELEASE_BINARY_PATTERNS[@]}; do
+   for binary_file in $(ls ${binary_file_pattern}); do
+   sign_file ${binary_file}
+   done
+   done
+}
+
+
+convert_text_files_to_crlf() {
+   log "Converting line endings to CRLF in text files"
+   for text_file_pattern in ${GEANY_RELEASE_TEXTFILE_PATTERNS[@]}; do
+   for text_file in $(ls ${text_file_pattern}); do
+   mime_type=$(file --brief --mime-type ${text_file})
+   case $mime_type in text/*)
+   unix2dos ${text_file}

Could any of you open that issue?
I still don't get the problem you see, as outlined above, a GIT clone on 
Windows probably gives the correct line endings and so I'm not really able to 
create an issue for an issue I don't understand :).

Here we are talking about a native Linux clone with native LF line endings and 
those we need to convert. IMO this is special to the CI build and so needs to 
be done here.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3315#discussion_r1020899688
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] TreeBrowser: Fix refresh from popup menu with a selected file (PR #1195)

2022-11-13 Thread Enrico Tröger
Merged #1195 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1195#event-7798356676
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] [Tree Browser ] Refresh is not working (Issue #1194)

2022-11-13 Thread Enrico Tröger
Closed #1194 as completed via #1195.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1194#event-7798356732
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] treebrowser issue: Open externally and Open Terminal don't work on Windows 10 (#556)

2022-11-13 Thread Enrico Tröger
Closed #556 as completed via #973.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/556#event-7798356244
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany-plugins] TreeBrowser: Port spawning external commands to the spawn API (#973)

2022-11-13 Thread Enrico Tröger
Merged #973 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/973#event-7798356222
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Add soft keywords to Python keyword list (PR #3277)

2022-11-13 Thread Enrico Tröger
Merged #3277 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3277#event-7798342596
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Filedef for Python missing "match" and "case" (Issue #3263)

2022-11-13 Thread Enrico Tröger
Closed #3263 as completed via #3277.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3263#event-7798342612
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Add option to only show line endings if they differ from file default (PR #3287)

2022-11-13 Thread Enrico Tröger
Merged #3287 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3287#event-7798341396
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Rewrite Python standard library tags creation script for Python 3 (PR #3039)

2022-11-13 Thread Enrico Tröger
> > I followed your suggestion and changed the output format of the tags file 
> > to ctags.
> 
> Well, it isn't something I'm one hundred percent sure we should do, but 
> rather something I wanted to discuss. Also, I had something different in mind 
> - to use `ctags` directly to generate the tag files instead of doing it by 
> ourselves in the script (so there wouldn't be the need for messing with the 
> ctags file format on our side). I haven't checked what exactly the script 
> does and whether something like this would be possible though - what do you 
> think?

Regarding whether to create the Python with ctags instead of this script:
I gave it a try and there are a couple of differences and problems with ctags:
- ctags will find way more tags, many tags we are not interested in for a 
global tags file like private methods and special methods (`_*` and `__*`) and 
variables. Those could be filtered out afterwards though.
- ctags will add the path and search pattern or line numbers of the source file 
which doesn't make sense for global tags. Those could be filtered out 
afterwards though.
- Classes found by ctags have no signature (the one of the corrsponding 
`__init__` method) while the ones of my script have
- ctags will include deprecated tags as well while my script filter them out 
(even more than the manually defined ones)

Overall, for me, the generated tags of the script look cleaner and more sane 
than the ctags ones.

For reference, the ctags command I tried:
```
ctags \
--exclude=encodings \
--exclude=dist-packages \
--exclude=distutils \
--exclude=idlelib \
--exclude=ensurepip/_bundled \
--exclude=test \
--exclude=Tools \
--exclude=turtledemo \
--exclude=site-packages \
--exclude=turtle.py \
--exclude=asyncio/windows_utils.py \
--exclude=asyncio/windows_events.py \
--exclude=antigravity.py \
--exclude=ctypes/wintypes.py \
--recurse \
--languages=Python \
--excmd=number \
--totals=extra \
--fields=+tS /home/enrico/.pyenv/versions/3.10.8/lib/python3.10
```

While playing with the ctags command, I noticed I erroneously set a class' base 
as parent which is wrong in this context and methods used the wrong kind. Those 
are fixed.

> Also, if we want to use the ctags format, we should merge #3049, otherwise 
> not all the fields are parsed correctly.

+1

> To the topic of pros/cons of using the ctags file format, these are the 
> advantages I can think of:
> 
> * we could use `ctags` directly to generate tag files as mentioned above
> 
> * currently the tagmanager format doesn't escape characters 200-215 which 
> could break tag file parsing (it is fixable though)
> 
> * `ctags` file format is "standard" while the tagmanager format is 
> "proprietary" to geany (and also binary which isn't very nice)
> 
> 
> On the other the cons of the ctags format are:
> 
> * the tag files are bigger
> 
> * they are slower to parse
> 
> * command line `ctags` may be less flexible in generating tag files than 
> some specific-purpose script
> 
> * if Geany ctags is out of sync with the `ctags` command-line that 
> produces tags, we may not be able to read all of the tags

I'd prefer the ctags format because, as you say, it's the standard format and 
probably less error prone than the custom tagmanager format.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3039#issuecomment-1312720245
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Rewrite Python standard library tags creation script for Python 3 (PR #3039)

2022-11-13 Thread Enrico Tröger
@eht16 pushed 3 commits.

a4d49ce4d82040109168b995f76638c3e81a39eb  Do not set the base class as parent 
erroneously in tags
6e326ffc904e42ac4fff21794f2225701e1e8da0  Use kind "member" for methods
0546fef7d1eb4fe35a6fe0e4e3ce979f681f9522  Update docs, ignored modules and 
classes to Python 3.11

-- 
View it on GitHub:
https://github.com/geany/geany/pull/3039/files/c1387f831dc24eb58fa228839cd1de19dfacaeff..0546fef7d1eb4fe35a6fe0e4e3ce979f681f9522
You are receiving this because you are subscribed to this thread.

Message ID: