Skip to content

Add module inclusion support to code completion#139

Draft
Copilot wants to merge 3 commits intodevelopfrom
copilot/add-module-inclusion-tests
Draft

Add module inclusion support to code completion#139
Copilot wants to merge 3 commits intodevelopfrom
copilot/add-module-inclusion-tests

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Methods from included modules were not available in completion results. When a class includes a module, completions inside that class should find methods defined in the included module.

Implementation

  • Schema: Added included_modules JSON field to scopes table
  • Parser: Implemented on_include_command handler to capture and store module names from include statements
  • Completion: Added get_included_module_scopes() to resolve included module paths and retrieve their methods for completion
  • Tests: Added coverage for simple and nested module inclusion, including parameter preservation

Example

module Foo
  def foo_method(param1)
  end
end

class Bar
  include Foo

  def bar_method
    foo  # now completes to foo_method(param1)
  end
end

Handles both simple (include Foo) and namespaced (include Outer::Inner) module inclusion.

Original prompt

This section details on the original issue you should resolve

<issue_title>include should include</issue_title>
<issue_description>When you include a module then the things in that module should be in scope for completion.

For example:

module Foo
  def foo_method
  end
end

class Bar
  include Foo

  def bar_method
    foo # if completion runs here then it should find the foo_method because Foo was included into Bar
  end
end
```</issue_description>

<agent_instructions>* Write a test or two
* Make the test work</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests for module inclusion behavior Add module inclusion support to code completion Feb 18, 2026
Copilot AI requested a review from kwerle February 18, 2026 04:06
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.

include should include

2 participants

Comments