Skip to content

feat: add single-file mode support#528

Merged
magnus-madsen merged 1 commit into
masterfrom
feat/single-file-mode
Mar 22, 2026
Merged

feat: add single-file mode support#528
magnus-madsen merged 1 commit into
masterfrom
feat/single-file-mode

Conversation

@magnus-madsen
Copy link
Copy Markdown
Member

@magnus-madsen magnus-madsen commented Mar 22, 2026

Summary

  • Show a warning notification when the extension activates in single-file mode (no workspace folder open)
  • Use currently open .flix text documents for file discovery instead of workspace glob patterns
  • Replace filesystem watchers with onDidOpenTextDocument/onDidCloseTextDocument listeners to track files
  • Suppress the "file not part of project" warning since there is no project boundary
  • Set REPL cwd to the active file's parent directory so it can find the file

Builds on the preparatory refactoring in #527.

Test plan

  • Open a standalone .flix file (no folder) → warning popup appears, compiler starts, diagnostics work
  • Open additional .flix files → they are picked up by the compiler
  • Close a .flix file → it is removed from the compiler
  • Open a Flix project folder → all existing behavior unchanged, no warning popup
  • Run existing integration tests (npm test)

🤖 Generated with Claude Code

Support opening standalone `.flix` files without a workspace folder.
LSP features (diagnostics, completions, hover, go-to-definition, etc.)
now work in single-file mode.

Changes:
- Show warning notification on activation when in single-file mode
- Use open text documents for file discovery instead of glob patterns
- Replace filesystem watchers with document open/close listeners
- Suppress "file not part of project" warning (no project boundary)
- Set REPL cwd to the active file's directory in single-file mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@magnus-madsen magnus-madsen merged commit cb4ef2f into master Mar 22, 2026
11 checks passed
@magnus-madsen magnus-madsen deleted the feat/single-file-mode branch March 22, 2026 11:35
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