Isolate the preprocessor work into its own package - #121
Merged
Rider-Linden merged 3 commits intoSep 22, 2026
Merged
Conversation
WolfGangS
marked this pull request as draft
August 22, 2026 04:11
WolfGangS
force-pushed
the
wolfgang/isolate-preprocessor
branch
from
August 28, 2026 13:43
7076359 to
fe0f3ba
Compare
… not yet been moved, to avoid reconfiguring them for running in vscode test
WolfGangS
force-pushed
the
wolfgang/isolate-preprocessor
branch
from
September 22, 2026 18:51
fe0f3ba to
6da2106
Compare
WolfGangS
marked this pull request as ready for review
September 22, 2026 20:21
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Connection lifecycle, default-enabled behavior, lint coverage, and package watch support need correction.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Extracts preprocessing and WebSocket functionality into reusable workspace packages while adapting the VS Code extension and tests to consume their public APIs.
Changes:
- Creates standalone preprocessor and WebSocket/JSON-RPC packages.
- Rewires extension services, configuration, and tests to package imports.
- Updates build, lint, packaging, and documentation paths.
| File | Description |
|---|---|
src/vscode/objectexplorerwebview.ts |
Uses WebSocket package exports. |
src/vscode/objectexplorerprovider.ts |
Imports object models from package. |
src/vscode/objectcontentprovider.ts |
Uses package APIs and adds URI helper. |
src/vscode/ObjectContentDecorator.ts |
Uses packaged content service. |
src/utils.ts |
Decouples host from configuration. |
src/test/suite/require-table.test.ts |
Updates preprocessor imports and hosts. |
src/test/suite/parser.test.ts |
Uses preprocessor package. |
src/test/suite/parser-directive-diagnostics.test.ts |
Updates diagnostic imports. |
src/test/suite/parser-diagnostics.test.ts |
Updates parser imports. |
src/test/suite/parse-line-mappings.test.ts |
Uses packaged mapping APIs. |
src/test/suite/objectcontentservice.test.ts |
Tests packaged content service. |
src/test/suite/nodehost.test.ts |
Removes host configuration injection. |
src/test/suite/macro-diagnostics.test.ts |
Updates macro imports. |
src/test/suite/line-mapping.test.ts |
Updates mapping imports. |
src/test/suite/lexingpreprocessor.test.ts |
Adapts tests to new options API. |
src/test/suite/lexer-diagnostics.test.ts |
Uses packaged lexer diagnostics. |
src/test/suite/include-disk-integration.test.ts |
Adapts include configuration. |
src/test/suite/include-diagnostics.test.ts |
Updates include processor imports. |
src/test/suite/helpers/mockHost.ts |
Removes configuration from mock hosts. |
src/test/suite/helpers/expectMapping.ts |
Uses packaged mapping types. |
src/test/suite/diagnostic-integration.test.ts |
Adapts diagnostic test configuration. |
src/test/suite/conditionalprocessor.test.ts |
Uses packaged conditional APIs. |
src/test/suite/conditional-diagnostics.test.ts |
Updates conditional imports. |
src/synchservice.ts |
Integrates extracted packages and injected config. |
src/shared/sharedutils.ts |
Uses packaged filesystem helper. |
src/shared/languageservice.ts |
Separates host and plugin configuration. |
src/shared/filelinkindex.ts |
Uses packaged URI type. |
src/shared/filelinkidentity.ts |
Uses packaged URI helpers. |
src/server/nodehost.ts |
Removes configuration responsibility. |
src/scriptsync.ts |
Builds explicit preprocessor options. |
src/pluginsupport.ts |
Injects configuration separately. |
src/interfaces/configinterface.ts |
Uses packaged URI type. |
src/extension.ts |
Imports extracted WebSocket services. |
src/configservice.ts |
Uses packaged URI helpers. |
src/commandregistry.ts |
Uses packaged protocol types. |
README.md |
Updates package documentation links. |
packages/sl-script-preprocessor/tsconfig.json |
Configures package compilation. |
packages/sl-script-preprocessor/src/token.ts |
Separates token definitions. |
packages/sl-script-preprocessor/src/parser.ts |
Adopts package-local interfaces. |
packages/sl-script-preprocessor/src/macroprocessor.ts |
Updates local dependencies. |
packages/sl-script-preprocessor/src/linemapper.ts |
Uses package interfaces. |
packages/sl-script-preprocessor/src/lexingpreprocessor.ts |
Introduces explicit options contract. |
packages/sl-script-preprocessor/src/lexer.ts |
Separates tokens and configuration. |
packages/sl-script-preprocessor/src/interfaces.ts |
Defines public host and options APIs. |
packages/sl-script-preprocessor/src/index.ts |
Exports package API. |
packages/sl-script-preprocessor/src/includeprocessor.ts |
Updates package-local imports. |
packages/sl-script-preprocessor/src/diagnostics.ts |
Uses package URI type. |
packages/sl-script-preprocessor/src/conditionalprocessor.ts |
Updates package-local imports. |
packages/sl-script-preprocessor/README.md |
Adds package introduction. |
packages/sl-script-preprocessor/package.json |
Defines workspace package metadata. |
packages/sl-script-preprocessor/doc/preprocessor-guide.md |
Relocates preprocessing guide. |
packages/sl-ide-ws-client/tsconfig.json |
Configures WebSocket package build. |
packages/sl-ide-ws-client/src/websockclient.ts |
Extracts base WebSocket client. |
packages/sl-ide-ws-client/src/viewereditwsclient.ts |
Extracts viewer protocol client. |
packages/sl-ide-ws-client/src/transport.ts |
Adds transport abstraction. |
packages/sl-ide-ws-client/src/protocol.ts |
Separates protocol contracts. |
packages/sl-ide-ws-client/src/objectcontentservice.ts |
Removes VS Code dependency. |
packages/sl-ide-ws-client/src/objectcontentinterfaces.ts |
Updates diagnostic type source. |
packages/sl-ide-ws-client/src/jsonrpcclient.ts |
Extracts JSON-RPC implementation. |
packages/sl-ide-ws-client/src/index.ts |
Exports WebSocket package API. |
packages/sl-ide-ws-client/src/events.ts |
Adds framework-neutral events. |
packages/sl-ide-ws-client/README.md |
Documents client usage. |
packages/sl-ide-ws-client/package.json |
Defines WebSocket package metadata. |
package.json |
Adds workspaces and package builds. |
eslint.config.mjs |
Adds package lint configuration. |
.vscodeignore |
Packages compiled workspace output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+419
to
+420
| "compile:packages": "npm run build --workspace @secondlife/sl-ide-ws-client && npm run build --workspace @secondlife/sl-script-preprocessor", | ||
| "compile": "npm run compile:packages && tsc -p . && tsc -p tsconfig.webview.json && npm run copy-webview-assets && npm run copy-test-data", |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Sep 24, 2026
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.

This should not be merged till after #115 as it builds on that
A first pass at isolating the preprocessor work into its own package, to allow it to be spun of as a library for other users, and to more easily setup a possible self contained executable for external tools to use.
This should make no changes to the preprocessor's functionality, some parts have been broken out into their own files rather than having multiple classes in the same file.
I also moved the preprocessor_guide.md into the preprocessor package.
I think the exact boundary is still a little blurry, there are some items that may be better off in the plugin (especially some of the things in
interfaces.ts), but I wanted to make minimal code changes in this pr, and get it split for now.The tests are currently still in the main plugin package to avoid breaking all the testing setup, but should probably be divided into relevant packages later.