Skip to content

Isolate the preprocessor work into its own package - #121

Merged
Rider-Linden merged 3 commits into
secondlife:developfrom
WolfGangS:wolfgang/isolate-preprocessor
Sep 22, 2026
Merged

Rider-Linden merged 3 commits into
secondlife:developfrom
WolfGangS:wolfgang/isolate-preprocessor

Conversation

@WolfGangS

@WolfGangS WolfGangS commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

@WolfGangS
WolfGangS marked this pull request as draft August 22, 2026 04:11
@WolfGangS
WolfGangS force-pushed the wolfgang/isolate-preprocessor branch from 7076359 to fe0f3ba Compare August 28, 2026 13:43
@WolfGangS
WolfGangS force-pushed the wolfgang/isolate-preprocessor branch from fe0f3ba to 6da2106 Compare September 22, 2026 18:51
@WolfGangS
WolfGangS marked this pull request as ready for review September 22, 2026 20:21
@Rider-Linden
Rider-Linden requested a balanced review from Copilot September 22, 2026 20:33

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.

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 Low severity

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 thread eslint.config.mjs Outdated
Comment thread package.json
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>
@Rider-Linden
Rider-Linden merged commit fab3ed0 into secondlife:develop Sep 22, 2026
3 checks passed
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.

3 participants