You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While reviewing #1407 we found real duplication in the parser. The same pattern likely exists across the codebase — this issue is to do a systematic audit of the entire repo and refactor.
editors/ — VS Code extension, tree-sitter grammar, neovim queries (highlights.scm copies are explicitly maintained dupes per syntax-sources.md, but check for accidental ones)
docs/site/ — docs (likely fine, but check for repeated example boilerplate)
While reviewing #1407 we found real duplication in the parser. The same pattern likely exists across the codebase — this issue is to do a systematic audit of the entire repo and refactor.
Scope: the whole repo
Rust crates
crates/floe-core/(the largest):cst/— covered by Refactor parser duplication in cst.rs #1411, can skiplexer.rs,parser.rslower/— visitor/lowering passeschecker/— type checking, manycheck_*methodscodegen/typescript/— emission (49unused_selfallows from chore: [#969] add strict clippy lints and fix all violations #1405 are concentrated here, smells like dispatch repetition)formatter/— formatting passes (similar shape to codegen)desugar.rs,exhaustiveness.rs,resolve.rs,walk.rs,sourcemap.rs,type_layout.rsinterop/dts.rs+interop/tsgo/probe_gen.rs— large filesstdlib/(21 files) — likely have repeated registration boilerplateOther crates:
crates/floe-cli/— CLI commandscrates/floe-lsp/— LSP handlers (handler-per-feature pattern often duplicates)crates/floe-doc-check/crates/floe-test-helpers/crates/floe-wasm/Non-Rust
integrations/— npm packages (@floeorg/core,vite-plugin,esbuild-plugin,register,hono)editors/— VS Code extension, tree-sitter grammar, neovim queries (highlights.scm copies are explicitly maintained dupes persyntax-sources.md, but check for accidental ones)docs/site/— docs (likely fine, but check for repeated example boilerplate)tests/lsp/+tests/cst/What to look for
expect/expect_kindfrom cst.rs (Refactor parser duplication in cst.rs #1411). Grep for suspiciously similar names.self.x(A) || self.x(B) || self.x(C)patterns that beg for anany/inhelper.matcharms that look slightly different but do the same thing under different names.Suggested approach
tokeiorcargo treeto find the largest files.Tests
Existing tests should cover all behavior. After each refactor:
cargo clippy --profile ci --workspace -- -D warningszero errorscargo test --workspaceall pass