Large refactor, converting normalizedPath into vscode.uri where possible and StringURI where not.#77
Open
Rider-Linden wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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/normalizePathwithStringUriplus helpers (filePathToStringUri,stringUriToFilePath, etc.) across hosts and preprocessor pipeline. - Updates parser/linemapper/diagnostics to embed URI strings directly in
@linedirectives 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 StringUri↔vscode.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. |
18f6888 to
4450d6a
Compare
…hat can be used and `StringURI` when vscode is not available.
4450d6a to
6f03dca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the normalized path concept and replaces it with StringURI/vscode.uri for file tracking.