Skip to content

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

Merged
opcode81 merged 3 commits into
oraios:mainfrom
BinarySo1o:fix/ts-coverage-dirname-ignore
Jul 21, 2026
Merged

TypeScript: stop hard-ignoring source directories named coverage#1524
opcode81 merged 3 commits into
oraios:mainfrom
BinarySo1o:fix/ts-coverage-dirname-ignore

Conversation

@BinarySo1o

Copy link
Copy Markdown
Contributor

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.
Copilot AI review requested due to automatic review settings July 21, 2026 11:29
@opcode81
opcode81 merged commit 4903da5 into oraios:main Jul 21, 2026
19 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an over-broad hardcoded ignore rule in the TypeScript language servers that excluded any directory named coverage, which unintentionally hid legitimate source directories (e.g. src/routes/coverage/) from symbol extraction. It removes coverage from the TypeScript and vtsls (typescript_vts) directory ignore lists, relying on gitignore to exclude real generated coverage-report output, and adds a regression test plus a changelog entry.

Changes:

  • Stop hard-ignoring directories named coverage in both typescript and typescript_vts language servers.
  • Add a regression test asserting coverage is not ignored while still ignoring standard generated/VCS dirs.
  • Document the fix in CHANGELOG.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/solidlsp/language_servers/typescript_language_server.py Removes coverage from the hardcoded ignored-dirname list for the default TypeScript LS.
src/solidlsp/language_servers/vts_language_server.py Removes coverage from the hardcoded ignored-dirname list for the vtsls-based TypeScript LS.
test/solidlsp/typescript/test_typescript_ignored_dirs.py Adds a regression test for coverage being treated as a valid source directory name.
CHANGELOG.md Adds a release note describing the behavioral change and linking it to #1523.

pytestmark = pytest.mark.typescript


@pytest.mark.parametrize("language_server", [Language.TYPESCRIPT], indirect=True)
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

3 participants