Skip to content

Conversation

masatake
Copy link
Member

@masatake masatake commented May 5, 2025

CREATE FUNCTION isnlt(ean13, ean13)
        RETURNS boolean
        AS 'int8lt'
        LANGUAGE 'internal'
        IMMUTABLE STRICT
        PARALLEL SAFE;

This change extracts int8lt as a function in the C language.

@masatake masatake force-pushed the sql--language-internal branch from ead1102 to 0b2c35a Compare May 5, 2025 09:32
Copy link

codecov bot commented May 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.01%. Comparing base (c71080d) to head (94a2a2a).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4240      +/-   ##
==========================================
+ Coverage   85.98%   86.01%   +0.02%     
==========================================
  Files         249      249              
  Lines       64102    64119      +17     
==========================================
+ Hits        55121    55154      +33     
+ Misses       8981     8965      -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masatake masatake changed the title SQL: make foreign tags fo 'interenal' functions SQL: make foreign tags for 'interenal' functions May 5, 2025
@masatake masatake force-pushed the sql--language-internal branch 3 times, most recently from 8af995c to af013a5 Compare May 6, 2025 08:56
@masatake masatake marked this pull request as draft May 6, 2025 14:19
@masatake masatake force-pushed the sql--language-internal branch from af013a5 to 38ce2d0 Compare October 15, 2025 11:56
@masatake masatake requested a review from Copilot October 15, 2025 11:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for creating foreign tags for PostgreSQL functions declared with LANGUAGE 'internal' or LANGUAGE internal. When such functions are encountered, the SQL parser now creates a foreign reference tag in the C language for the internal function name specified in the AS clause.

Key Changes:

  • SQL parser now recognizes both quoted and unquoted 'internal' language declarations
  • Internal function names (e.g., int8lt) are tagged as C function foreign calls
  • New foreigncall role added to C parser's function kind

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
parsers/sql.c Adds logic to detect LANGUAGE 'internal' and create foreign C function tags; accepts both quoted and unquoted identifiers for language names
parsers/cxx/cxx_tag.h Defines new CXXTagFUNCTIONRoleFOREIGNCALL enum value
parsers/cxx/cxx_tag.c Adds foreigncall role definition for C functions
parsers/cxx/cxx.c Bumps C parser version from 1.1 to 2.2
man/ctags-lang-c.7.rst.in Documents the new foreigncall role in C parser changelog
docs/man/ctags-lang-c.7.rst Generated documentation for the new role
Units/parser-sql.r/sql_pgSQL_with_language_internal.d/input.sql Test input with PostgreSQL internal functions
Units/parser-sql.r/sql_pgSQL_with_language_internal.d/expected.tags Expected output showing C foreign call tags
Units/parser-sql.r/sql_pgSQL_with_language_internal.d/args.ctags Test configuration enabling reference tags
Units/parser-sql.r/funcions.d/expected.tags Updated test expectations with new tag extras
Units/parser-sql.r/funcions.d/args.ctags Added --extras=+g flag to test configuration
Tmain/version-option.d/stdout-expected.txt Updated C parser version from 1.1 to 2.2
Tmain/nested-subparsers.d/stdout-expected.txt Updated C function kind version from 1 to 2
Tmain/list-roles.d/stdout-expected.txt Added foreigncall role entries throughout test output
Tmain/list-kinds-full.d/stdout-expected.txt Updated C function kind version from 1 to 2
Tmain/json-output-format.d/stdout-expected.txt Updated parser version and added foreigncall role description
Tmain/extras-field-for-pseudo-tags.d/stdout-expected.txt Added foreigncall role description pseudo-tags

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@masatake masatake marked this pull request as ready for review October 15, 2025 20:31
@masatake
Copy link
Member Author

Now we have version information for each kind, role, field, and extra. So the Changes section of the man pages is redundant.

Update the C parser version to 2.2.

Signed-off-by: Masatake YAMATO <[email protected]>
@masatake masatake force-pushed the sql--language-internal branch from 38ce2d0 to 94a2a2a Compare October 15, 2025 21:00
@masatake masatake requested a review from Copilot October 15, 2025 21:31
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@masatake masatake merged commit b5438c4 into universal-ctags:master Oct 15, 2025
82 of 83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant