<p></p>
<p dir="auto">This is a continuation of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1074588994" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/3049" data-hovercard-type="pull_request" data-hovercard-url="/geany/geany/pull/3049/hovercard?comment_id=1130910163&comment_type=issue_comment" href="https://github.com/geany/geany/pull/3049#issuecomment-1130910163">#3049 (comment)</a>:</p>
<blockquote>
<p dir="auto">IIUC what would happen now is that a symbol in an olde tags file will show as a different kind from what it would show as if the source file file was open in Geany, or the tags file re-generated. But it would still load, and will still show as the same kind it always did.</p>
</blockquote>
<p dir="auto">If it were only a matter of showing it as a different type, it probably wouldn't be such a big problem. I'm more worried about more advanced stuff like scope autocompletion or things like</p>
<p dir="auto"><a href="https://github.com/geany/geany/blob/37d20a823fb1bca67cea57ef73aa9e64009d8138/src/symbols.c#L2017">https://github.com/geany/geany/blob/37d20a823fb1bca67cea57ef73aa9e64009d8138/src/symbols.c#L2017</a></p>
<p dir="auto">where we make decisions based on the mapped type. And then you have some language mappings that were probably made just based on what was free (or what looked good in the symbol tree in the sidebar) like the namespace here:</p>
<p dir="auto"><a href="https://github.com/geany/geany/blob/37d20a823fb1bca67cea57ef73aa9e64009d8138/src/tagmanager/tm_parser.c#L295">https://github.com/geany/geany/blob/37d20a823fb1bca67cea57ef73aa9e64009d8138/src/tagmanager/tm_parser.c#L295</a></p>
<p dir="auto">What I was thinking is that if we had the original ctags kind in the file, we could fix such mappings invisibly to the user in the future and users wouldn't need to regenerate such files by themselves.</p>
<blockquote>
<p dir="auto">IIUC both of those mean relevant symbols from tags files from before the mapping change will change the kind they show. That may not be right, for example one of the recent parser updates split a kind into two IIRC (was it Ada? can't remember and too lazy to search) so now old file symbols using the letter that was split will all show as one of the halves. So both 1. and 2. will show something different for existing tags files.</p>
</blockquote>
<p dir="auto">I'm not sure if I understand completely the first part but the last sentence is what will actually happen if we don't store the ctags kind letter. Suppose you generate</p>
<ol dir="auto">
<li><code class="notranslate">ctags.tags</code> file with <code class="notranslate">ctags</code> for some C sources.</li>
<li><code class="notranslate">1-38.C.tags</code> with Geany 1.38 for the same C sources.</li>
<li><code class="notranslate">1-39.C.tags</code> with Geany 1.39 for the same C sources.</li>
</ol>
<p dir="auto">and that there's some change in the mapping between 1.38 and 1.39. When you load <code class="notranslate">ctags.tag</code>, it will reflect the current Geany's version mappings while <code class="notranslate">1-38.C.tags</code> will (forever) represent the mapping made in 1.38 and <code class="notranslate">1-39.C.tags</code> will (forever) represent the mapping made in 1.39. So <code class="notranslate">1-38.C.tags</code> will show something different than <code class="notranslate">1-39.C.tags</code> (which should be the same as <code class="notranslate">ctags.tags</code> in Geany 1.39 but in Geany 1.40 it may be something different again).</p>
<blockquote>
<p dir="auto">And if the parser removed a letter what happens, do we need to keep it in the mapping? Hopefully ctags will never reuse the same letter for a totally different kind, then we would have to complain to ctags?</p>
</blockquote>
<p dir="auto">I think kind letters are the "API" of ctags and that ctags is rather conservative about these. The situation in this relase was rather exceptional because we were replacing some parsers which existed only in Geany with parsers that didn't exist in ctags at all and which were developed completely independently of their Geany versions. So I don't think this will be common.</p>
<p dir="auto">In any case what I should have done in the patch (and which I'm going to update) is to ignore the kind letter if it doesn't map to anything (the case of the potentially removed kind in ctags parser) and use the stored mapped kind instead.</p>
<p dir="auto">One more possibility is to store the kind letter to the tags files and not to do anything with it for now and decide later whether we want to use it or not.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3208#issuecomment-1131723938">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ2K3KULBWD6C57ENITVKZB3RANCNFSM5WH3EQBA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ7FEHWIXOTBCWMECMTVKZB3RA5CNFSM5WH3EQBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIN2LZIQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/pull/3208/c1131723938</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3208#issuecomment-1131723938",
"url": "https://github.com/geany/geany/pull/3208#issuecomment-1131723938",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>