Skip to content

TypeScript: stop hard-ignoring source directories named coverage#1524

Open
BinarySo1o wants to merge 2 commits into
oraios:mainfrom
BinarySo1o:fix/ts-coverage-dirname-ignore
Open

TypeScript: stop hard-ignoring source directories named coverage#1524
BinarySo1o wants to merge 2 commits into
oraios:mainfrom
BinarySo1o:fix/ts-coverage-dirname-ignore

Conversation

@BinarySo1o

Copy link
Copy Markdown

Problem

The TypeScript language servers (typescript_language_server.py and vts_language_server.py) hard-ignore any directory named coverage in is_ignored_dirname:

return super().is_ignored_dirname(dirname) or dirname in ["node_modules", "dist", "build", "coverage"]

The intent is to skip Jest/nyc coverage-report output, but the match is on bare dirname, so it also excludes legitimate source directories named coverage (e.g. a REST resource at src/routes/coverage/). Symbol tools then fail with Cannot extract symbols for every file under such a dir, even though it is not gitignored and is_ignored_path reports it as not ignored — and there is no config hook to override is_ignored_dirname.

Fixes #1523.

Fix

Remove "coverage" from the hardcoded list in both TS servers. A real coverage-report directory is generated output and is essentially always gitignored, so gitignore already excludes it — mirroring the reasoning in #1203 (only hardcode what's universal; rely on gitignore for generated dirs).

node_modules / dist / build are intentionally left in place to keep this a single, well-scoped change.

Test

Adds test/solidlsp/typescript/test_typescript_ignored_dirs.py (mirroring test_toml_ignored_dirs.py): asserts coverage, src, lib, routes are not ignored while node_modules / dist / build / .git still are.

Both TypeScript language servers hard-ignored any directory named
`coverage` in `is_ignored_dirname`, intending to skip coverage-report
output but matching by bare dirname — which also hid legitimate source
directories named `coverage` (e.g. `src/routes/coverage/`) from symbol
tools. Generated report dirs are already covered by gitignore, so the
hardcoded entry is removed.

Adds a regression test asserting `coverage`/`src`/`lib`/`routes` are not
ignored while `node_modules`/`dist`/`build`/`.git` still are.

Fixes oraios#1523.
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.

TypeScript/vtsls language servers hard-ignore any directory named coverage, hiding legitimate source dirs from symbol tools

1 participant