[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
This seems to fix it, not sure it's perfect though: ```diff diff --git a/ctags/parsers/typescript.c b/ctags/parsers/typescript.c index 7dcc338ef..3fcd956a8 100644 --- a/ctags/parsers/typescript.c +++ b/ctags/parsers/typescript.c @@ -1820,8 +1820,11 @@ static void parseClassBody (const int scope, tokenInfo *const token) parsingValue = false; break; case TOKEN_OPEN_PAREN: - if (! member) break; uwiUngetC ('('); + if (! member) { + parsed = tryParser (parseParens, token, false); + break; + } const int nscope = emitTag (member, isGenerator ? TSTAG_GENERATOR : TSTAG_METHOD); ``` -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1452585750 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
Playing a tad with it, I see it's the `()`s in the members initialization (e.g. `singletons.getSoundManager()`): if you remove the `()`s it keeps on parsing. Now somebody will have to fix it… :slightly_smiling_face: -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1452561759 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
Sorry, I didn't answer sooner. The two files that I used as examples are located here: - [User.ts](https://github.com/arianne/stendhal/blob/master/srcjs/stendhal/entity/User.ts) - [Player.ts](https://github.com/arianne/stendhal/blob/master/srcjs/stendhal/entity/Player.ts) > ...see whether [universal-ctags](https://github.com/universal-ctags/ctags) > has the same issue, and report it there... When I get done with something I am currently working on, I'll check out Universal Ctags & see if the problem is there. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1452552209 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
> I don't see this as a particularly bad No, its not ... > few specifics hard-coded for the languages we have to ... just that you can't do that ATM without a hard coded filetype. Which is why I asked the question, not knowing that the parser was a freebie thrown in by @techee, not added by the filetype creator. > And if there's nothing specific this filetype would need hard-coded, I don't > see no harm I don't know TS, but if you say its C ... [ducks] > but that could be a bonus a few VIP names get. C for example [ducks] Of course the "small" issue of making `highlightingmappings.h` be read from filetype files is a minor issue in the path to fully loadable filetypes, lexers and parsers. :stuck_out_tongue_winking_eye: But in general totally agree that moving towards names and dynamic configuration is better. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1447939062 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
> Oh ok, but having added a parser I wonder why the creator of the Typescript > filetype didn't go the whole hog and make a built-in filetype. Then they > could customise all the language dependent code scattered throughout Geany. I don't see this as a particularly bad, actually if we could get most, if not all, filetypes uses a declarative style and only have the few specifics hard-coded for the languages we have to, I wouldn't find that too bad. And with the shift towards Scintilla's named-only lexer API, things will shift towards named stuff. If course, we'll probably need magic constants still to optimize several checks for the hard-coded bits, but that could be a bonus a few VIP names get. We're surely not here yet, but I'm not sure it's a bad slope to lean on. And if there's nothing specific this filetype would need hard-coded, I don't see no harm -- actually, just less code, and you know I love less code :wink: -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1447866846 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
> Oh ok, but having added a parser I wonder why the creator of the Typescript > filetype didn't go the whole hog and make a built-in filetype. This is because there was no typescript parser originally and I added it in the final "ctags sync" PRs but I did it in a lazy way only. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1447720980 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
> No, it's using the ctags parser language name Oh ok, but having added a parser I wonder why the creator of the Typescript filetype didn't go the whole hog and make a built-in filetype. Then they could customise all the language dependent code scattered throughout Geany. @AntumDeluge to expand on what @b4n says, if the parser thinks you have mismatched `{}`s the parser will skip the rest of the file looking for the `}`, so suspect the function __before__ the first one missing. If you can paste the suspect code please put it in a gist and only put the link here, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1447292706 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
@elextr > Typescript is not a [built-in > filetypes](https://github.com/geany/geany/blob/2509e21526d36034f5251381a76555e7300fbfc0/src/filetypes.c#L127) > so how does it get called, I thought the lexer and parser names in a custom > filetype had to be existing built-in names? No, it's using the ctags parser language name (at least that's what it currently does), see [src/filetypes.c LL 937-344](/geany/geany/blob/master/src/filetypes.c#L937). -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1446779679 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
@AntumDeluge Hum, could you share your problematic file(s)? Or even better, see whether [universal-ctags](/universal-ctags/ctags) has the same issue, and report it there, as we're basically bundling those. Anyway it's hard to tell what the issue could be, it probably comes from something above the method that confuses the parser, so more info is needed. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1446779351 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany] TypeScript Parser: Does Not Always Display Complete List of Methods (Issue #3416)
@techee (sorry to ping you again, but you are __the__ expert in tags and parsers and symbols etc) There is a ctags typescript parser being built into Geany. But the Typescript filetype is a custom filetype that references a [typescript](https://github.com/geany/geany/blob/2509e21526d36034f5251381a76555e7300fbfc0/data/filedefs/filetypes.TypeScript.conf#L18) parser. Typescript is not a [built-in filetypes](https://github.com/geany/geany/blob/2509e21526d36034f5251381a76555e7300fbfc0/src/filetypes.c#L127) so how does it get called, I thought the lexer and parser names in a custom filetype had to be existing built-in names? -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/3416#issuecomment-1445714394 You are receiving this because you are subscribed to this thread. Message ID: