Skip to content

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Oct 24, 2025

Description

Use ide.readfile instead of fs.readfile in StaticContextService

resolves CON-4504

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by cubic

Refactored StaticContextService to use IDE file APIs for reading files and scanning directories, improving support for URIs and virtual workspaces. Addresses CON-4504 by routing file access through the IDE layer.

  • Refactors
    • Replaced fs.readFile with ide.readFile and fs.readdir with ide.listDir using FileType.
    • Normalized paths via pathToFileURL/localPathOrUriToPath for consistent URI handling.
    • Removed fs/promises dependency; logic for skipping dirs and filtering TS extensions unchanged.

@uinstinct uinstinct requested a review from a team as a code owner October 24, 2025 05:16
@uinstinct uinstinct requested review from tingwai and removed request for a team October 24, 2025 05:16
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 24, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@sestinj
Copy link
Contributor

sestinj commented Oct 27, 2025

@uinstinct I tried merging main into this branch but we still have a lot of test failures that must be coming from the changes here

@uinstinct uinstinct force-pushed the static-context-ide-readfile branch from 7be374d to 74af332 Compare October 28, 2025 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants