Skip to content

Large refactor, converting normalizedPath into vscode.uri where possible and StringURI where not.#77

Open
Rider-Linden wants to merge 3 commits into
rider/poc/object_publishfrom
rider/refactor_tracking
Open

Large refactor, converting normalizedPath into vscode.uri where possible and StringURI where not.#77
Rider-Linden wants to merge 3 commits into
rider/poc/object_publishfrom
rider/refactor_tracking

Conversation

@Rider-Linden

Copy link
Copy Markdown
Collaborator

Removes the normalized path concept and replaces it with StringURI/vscode.uri for file tracking.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors the extension’s core path/file identity model by removing NormalizedPath and migrating preprocessing, include resolution, diagnostics, and tests to a URI-first approach using branded StringUri plus vscode.Uri at VS Code boundaries.

Changes:

  • Replaces NormalizedPath/normalizePath with StringUri plus helpers (filePathToStringUri, stringUriToFilePath, etc.) across hosts and preprocessor pipeline.
  • Updates parser/linemapper/diagnostics to embed URI strings directly in @line directives and diagnostic source tracking.
  • Refactors and de-duplicates test host/config scaffolding via shared helpers (mockHost.ts) and updates many suites accordingly.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils.ts Adds StringUrivscode.Uri conversions and updates VS Code host I/O to accept StringUri.
src/interfaces/hostinterface.ts Replaces NormalizedPath with StringUri, adds URI helpers and UriSet.
src/interfaces/configinterface.ts Updates config path APIs to return StringUri.
src/configservice.ts Returns config/extension paths as StringUri.
src/shared/lexer.ts Switches lexer source-file tracking to StringUri.
src/shared/parser.ts Switches parser state/mappings/module tracking to StringUri; stores URIs directly in @line.
src/shared/linemapper.ts Tracks mappings by StringUri rather than filesystem paths.
src/shared/lexingpreprocessor.ts Updates preprocessor API to accept StringUri source file and workspace roots.
src/shared/includeprocessor.ts Migrates include/require state and .luaurc alias handling to StringUri + UriSet.
src/shared/macroprocessor.ts Updates diagnostic source-file plumbing to StringUri.
src/shared/conditionalprocessor.ts Updates diagnostic source-file plumbing to StringUri.
src/shared/diagnostics.ts Migrates diagnostic location/source types to StringUri.
src/shared/languageservice.ts Migrates cached-syntax file path construction to URI joining.
src/shared/languagerepository.ts Migrates cached-syntax file path construction to URI joining.
src/shared/sharedutils.ts Drops NormalizedPath dependency; file helpers now accept plain filesystem path strings.
src/server/nodehost.ts Migrates NodeHost I/O and resolution to StringUri and file path conversion.
src/synchservice.ts Keys sync tracking by masterUri.toString() instead of normalized filesystem path.
src/scriptsync.ts Uses StringUri for mapping/diagnostic source targeting and URI comparisons.
src/pluginsupport.ts Migrates plugin-generated file paths to StringUri and URI joining.
src/test/suite/helpers/mockHost.ts Adds shared mock HostInterface + MockConfig utilities for tests.
src/test/suite/helpers/expectMapping.ts Updates mapping assertions to compare StringUri.
src/test/suite/parser.test.ts Updates parser tests to use StringUri and shared mock host helper.
src/test/suite/require-table.test.ts Updates require table tests to use StringUri and shared mock host helper.
src/test/suite/parse-line-mappings.test.ts Updates expected @line URIs and test setup to StringUri.
src/test/suite/line-mapping.test.ts Migrates line mapping tests to StringUri.
src/test/suite/lexer-diagnostics.test.ts Migrates lexer diagnostics tests to StringUri.
src/test/suite/macro-diagnostics.test.ts Migrates macro diagnostics tests to StringUri.
src/test/suite/conditional-diagnostics.test.ts Migrates conditional diagnostics tests to StringUri.
src/test/suite/include-diagnostics.test.ts Migrates include diagnostics tests to StringUri.
src/test/suite/diagnostic-integration.test.ts Migrates diagnostic integration tests to StringUri and shared MockConfig.
src/test/suite/lexingpreprocessor.test.ts Migrates lexing preprocessor tests to StringUri and shared MockConfig.
src/test/suite/include-disk-integration.test.ts Updates disk integration tests to compare outputs after normalizing absolute file URIs.
src/test/suite/nodehost.test.ts Migrates NodeHost tests to StringUri.
src/test/suite/parser-directive-diagnostics.test.ts Migrates directive diagnostics tests to StringUri.
src/test/suite/parser-diagnostics.test.ts Migrates parser diagnostics integration tests to StringUri.
.github/copilot-instructions.md Updates repository guidance from NormalizedPath to StringUri.

Comment thread src/interfaces/hostinterface.ts Outdated
Comment thread src/utils.ts Outdated
Comment thread src/interfaces/hostinterface.ts Outdated
@Rider-Linden Rider-Linden force-pushed the rider/refactor_tracking branch from 18f6888 to 4450d6a Compare July 2, 2026 00:06
…hat can be used and `StringURI` when vscode is not available.
@Rider-Linden Rider-Linden force-pushed the rider/refactor_tracking branch from 4450d6a to 6f03dca Compare July 2, 2026 00:15
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.

2 participants