Skip to content

fix: resolve Windows path separator and filename collision issues - #195

Open
angleyanalbedo wants to merge 2 commits into
Autonomy-Logic:developmentfrom
angleyanalbedo:fix/windows-path-separator-collisions
Open

fix: resolve Windows path separator and filename collision issues#195
angleyanalbedo wants to merge 2 commits into
Autonomy-Logic:developmentfrom
angleyanalbedo:fix/windows-path-separator-collisions

Conversation

@angleyanalbedo

Copy link
Copy Markdown

Changes

Windows path separator normalization (affects VS Code extension LSP diagnostics):

  • document-manager.ts: normalized \ to / in uriToFilePath, setWorkspaceFolders, addWorkspaceFolders, removeWorkspaceFolders to fix path dedup comparison failures causing false "Duplicate declaration" errors on Windows

Node.js ESM import() on Windows (affects npm run build):

  • rebuild-libs.mjs, build-iec-types-json.mjs: wrapped resolve() with pathToFileURL() to fix ESM loader rejecting D:\ absolute paths

Filename collision (affects g++ linking):

  • commands.ts: renamed REPL entry from main.cpp to repl_main.cpp to avoid overwriting the generated implementation file when the source file is named main.st

Files changed

  • scripts/rebuild-libs.mjs
  • scripts/build-iec-types-json.mjs
  • vscode-extension/server/src/document-manager.ts
  • vscode-extension/client/src/commands.ts

wattzor added a commit to wattzor/STruCpp that referenced this pull request Jul 27, 2026
Ported relevant parts of Autonomy-Logic#195 and extended the
filename-collision fix to the CLI:

- Normalize backslashes to forward slashes in DocumentManager workspace
  folder set/add/remove so mixed Windows path separators do not cause
  duplicate discovery and false 'Duplicate declaration' diagnostics.
- Rename the VS Code extension's generated REPL harness from main.cpp to
  repl_main.cpp so it no longer overwrites the generated implementation
  file when the source is named main.st.
- Apply the same REPL harness rename in the CLI --build path.
- Add enum-to-struct-field assignment regression tests from upstream
  (Autonomy-Logic#171).

Verification:
- npm run typecheck clean
- npx eslint src/ --quiet clean
- npm test 117 files / 2186 passed
- Manual CLI --build with main.st now produces both main.cpp and
  repl_main.cpp and the binary runs.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Simon Atti <wattimedia@gmail.com>
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.

1 participant