Skip to content

Commit f772ccd

Browse files
Rider-Lindengithub-actions[bot]WolfGangS
authored
Prim publishing (#69)
* [WIP] Publishing and editing object scripts directly from the viewer. * [WIP] Act as a consumer for objects published from the viewer. Treat them as virtual file systems, so that they appear as folders in the explorer tab. Not yet in a stable state. * Rider test (#73) Revise workflow for publishing to VSCode marketplace. * chore: prepare release v1.0.4 * Update README.md with marketplace url * forced syntax update now uses the correct API * Request correct files. * [WIP] Publishing and editing object scripts directly from the viewer. * [WIP] Act as a consumer for objects published from the viewer. Treat them as virtual file systems, so that they appear as folders in the explorer tab. Not yet in a stable state. * object publishing checkpoint. * Large refactor, converting `normalizedPath` into `vscode.uri` where that can be used and `StringURI` when vscode is not available. * couple of issues found in cr. * Third time I've tried to fix this file. * link scripts from published objects with scripts in the local directory. * Numerous small issues, and more solid script creation. * Updates to the interface doc. * Fix preprocessing with published files. * Update the language defs. * Object renaming, luau inventory icon, runstate, restart. * Left out a file... plus pre-commit. * Trying to fix the precommits. * Some permission cleanup and fix rpc document TOC. * Two more PR fixes. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: WolfGang <flamin2k8@gmail.com>
1 parent bd582ee commit f772ccd

54 files changed

Lines changed: 28170 additions & 9665 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ A standalone Node runtime implementation of `HostInterface` now exists at `src/s
223223
Capabilities:
224224
* File I/O (read/write text, JSON, YAML, TOML) using native fs + `js-yaml` + `@iarna/toml`.
225225
* Include resolution logic ported from the VS Code host: supports relative paths, explicit `.` / `./subdir`, workspace-root relative paths, and wildcard directory patterns (e.g. `**/include/`). Uses `glob` for wildcard matching.
226-
* Path normalization with `NormalizedPath` branding preserved.
226+
* Path identification uses `StringUri` branding throughout.
227227
* Workspace roots provided at construction (`new NodeHost({ roots, config })`).
228228
* Minimal logger injection (optional) with no-op defaults.
229229
* Config access fully delegated to injected `FullConfigInterface` implementation—no direct env or global lookups inside NodeHost.
@@ -243,7 +243,7 @@ Guidelines:
243243
1. Do not introduce VS Code imports into `src/server/`.
244244
2. Keep feature parity between extension host and NodeHost include resolution.
245245
3. Add new serialization helpers via optional methods (feature-detect in callers) rather than expanding core method contracts.
246-
4. Always return `NormalizedPath` for resolved files.
246+
4. Always return `StringUri` for resolved files.
247247

248248
Future Extensions:
249249
* Optional file watching (likely via `fs.watch` or chokidar) for cache invalidation.
@@ -266,24 +266,24 @@ Most services use optional chaining and the `maybe()` utility for safe property
266266

267267
Always use workspace-relative paths for security. Include paths are configurable via `includePaths` setting with patterns like `["./include/", "include/", "*/include/", "."]`.
268268

269-
#### NormalizedPath Abstraction (2025-09 Update)
269+
#### StringUri Abstraction (2025-09 Update, replaced NormalizedPath 2026-07)
270270

271-
All internal path handling in the preprocessor layer now uses `NormalizedPath`, a branded string type produced by `normalizePath()` (see `llsharedutils`). This replaces previous reliance on `vscode.Uri` within core logic and tests.
271+
All internal path handling in the preprocessor layer uses `StringUri`, a branded `string` type produced by `filePathToStringUri()` (see `hostinterface.ts`). This replaced the earlier `NormalizedPath`/`normalizePath()` approach and the reliance on `vscode.Uri` within core logic and tests.
272272

273273
Key guidelines:
274-
- Do not store or compare raw/relative paths directly; always normalize first.
275-
- Equality checks are simple strict equality (`===`) because normalization canonicalizes separators and casing rules (platform appropriate).
276-
- Tests must no longer access `.fsPath` or other `Uri` properties—compare the `NormalizedPath` values directly.
277-
- When constructing mappings (`LineMapping`), assign `sourceFile: NormalizedPath`.
274+
- Do not store or compare raw/relative paths directly; always convert to `StringUri` first.
275+
- Equality checks use `uriEquals()` (case-insensitive on Windows for `file://` URIs); use `uriKey()` for Map/Set keys.
276+
- Tests compare `StringUri` values directly, not `.fsPath` or other `Uri` properties.
277+
- When constructing mappings (`LineMapping`), assign `sourceFile: StringUri`.
278278

279279
#### HostInterface for Includes (formerly FileInterface)
280280

281281
`IncludeProcessor` now depends on an injected `HostInterface` (renamed from earlier `FileInterface` for broader future responsibilities) instead of directly using VS Code APIs. Implementations must provide:
282282

283283
```
284-
readFile(path: NormalizedPath): Promise<string | null>
285-
exists(path: NormalizedPath): Promise<boolean>
286-
resolveFile(filename: string, from: NormalizedPath, extensions?: string[], includePaths?: string[]): Promise<NormalizedPath | null>
284+
readFile(path: StringUri): Promise<string | null>
285+
exists(path: StringUri): Promise<boolean>
286+
resolveFile(filename: string, from: StringUri, extensions?: string[], includePaths?: string[]): Promise<StringUri | null>
287287
```
288288

289289
Test shims may implement minimal logic (e.g., in-memory maps). For realistic include resolution tests, provide a hybrid in-memory + disk implementation and pass it to `new IncludeProcessor(fsImpl)`.
@@ -320,7 +320,7 @@ Deprecated/Removed (late Sept 2025): free helpers `getConfig` / `setConfig`.
320320

321321
`processInclude` signature:
322322
```
323-
processInclude(filename: string, sourceFile: NormalizedPath, isRequire: boolean, state: PreprocessorState)
323+
processInclude(filename: string, sourceFile: StringUri, isRequire: boolean, state: PreprocessorState)
324324
```
325325
Static helper methods like `pathToGlobPattern` and `getIncludeDirectories` have been removed; tests referring to them should be deleted or rewritten.
326326

@@ -354,7 +354,7 @@ expectMapping(mapping, processedLine, originalLine, filePathNormalized);
354354
expectMappings(arrayOfMappings, [ [processed, original, file], ... ]);
355355
```
356356

357-
Adopt these helpers when adding or modifying mapping tests. They perform strict equality on `NormalizedPath` and provide clearer failure messaging.
357+
Adopt these helpers when adding or modifying mapping tests. They perform strict equality on `StringUri` and provide clearer failure messaging.
358358

359359
## Maintaining These Instructions
360360

@@ -373,7 +373,7 @@ Examples of updates to include:
373373
- Removed legacy global configuration helpers (`getConfig`, `setConfig`); explicit dependency injection via `host.config` only.
374374
- HostInterface trimmed: configuration & path access consolidated under `FullConfigInterface` implementation (`LLConfigService`).
375375
- Updated services and sync logic to use `LLConfigService.getInstance()` only at composition boundaries; core logic depends on abstracted `HostInterface` + `FullConfigInterface`.
376-
- Ensured path branding (`NormalizedPath`) throughout preprocessing and language data flows.
376+
- Ensured URI branding (`StringUri`) throughout preprocessing and language data flows.
377377
- Guidance: New settings belong in `ConfigKey` + `LLConfigService`; avoid reintroducing host-level config APIs.
378378

379379
### 2025-10 Nested Require Processing (Oct 10)

0 commit comments

Comments
 (0)