8 Commits
Author SHA1 Message Date
MaxandYu-0312 6f86ae308e fix(solidity): isolate Hardhat state on macOS (#1910)
* fix(solidity): isolate Hardhat state on macOS

---------

Co-authored-by: Yu-0312 <2.66498311e+08+Yu-0312@users.noreply.github.com>
2026-09-03 15:21:15 +02:00
Dominik Jain d2cf18ddcb Refactoring: Rename Language to LanguageServerId
This resolves a long-standing naming issue in Serena & SolidLSP.
2026-07-22 20:55:36 +02:00
xormania 90334cc131 Solidity: await validation completion for diagnostics instead of a fixed wait
The Nomic solidity-language-server validates asynchronously: document
changes are debounced (~250ms), validation runs a forge/solc compile,
and completion is signalled with the custom notification
custom/validation-job-status -- emitted on every completion path
(success, validation failure, job errors; verified in the bundled 0.8.4
package, which publishes the document's diagnostics before the signal).
Serena ignored the signal ("Unhandled method
'custom/validation-job-status'") and waited a fixed 2.5s for a
non-empty publishDiagnostics, returning [] whenever validation finished
later. Warm environments fit the window; slow or cold ones (macOS and
Windows CI runners, which download solc 0.8.20 on every run -- the CI
cache only covers ~/.serena/language_servers/static, not
~/.local/share/svm) often do not. This is the root cause of the
empty-diagnostics failures of test_file_diagnostics[solidity]: xfailed
on macOS since its introduction (bd7e64e8) and failing on Windows on
Tests run #4236, job catch-all (windows-latest). Shrinking the wait
reproduces the exact failure signature (AssertionError: []) on Linux.

Changes:
- Handle custom/validation-job-status (threading.Event + last payload).
  The payload carries no document URI, so the event is global to the
  server instance.
- request_text_document_diagnostics keeps the 2.5s non-empty publish
  wait as the fast path. When it misses, it awaits the completion
  signal against a 60s deadline (aligned with the indexing wait) and
  takes the generation-advancing publication for the request URI,
  accepting an empty result as the validated answer; a completion that
  brings no publication for the URI (e.g. one belonging to another
  document) re-arms the wait until the deadline. If the signal never
  arrives, a warning is logged and the previous empty-result behavior
  applies, bounded by the deadline.
- Remove the darwin xfail from test_file_diagnostics; add regression
  tests for the fallback delivery (fast path forced to miss), for the
  never-signalled bound, and for re-arming on a spurious completion
  belonging to another document.
- CHANGELOG entry under Language Servers.

Design notes:
- Mirrors #1639 (TypeScript/VTS: event-based indexing wait replacing a
  fixed sleep).
- The simpler alternative -- accepting empty publications and raising
  the fixed wait -- was rejected: without the completion signal, an
  early clear-on-open publication would be taken as the answer, and
  every clean file would stall for the full wait.
- Supersedes the quarantine approach of draft PR #1674 (broadening the
  xfail to non-Linux); whichever lands second resolves the trivial
  conflict on the xfail block.
2026-07-10 20:17:39 -04:00
Michael Panchenko bd7e64e85a Fixed diagnostics files uri handling, added low-level tests 2026-04-29 23:52:26 +02:00
Michael Panchenko c55e0c900e Diagnostics, implementation and definition tools (WIP) 2026-04-29 23:52:26 +02:00
Michael Panchenko d30cdf8474 Fix symbol name resolution in selected LS (#1247)
Adds tests for name resolution for each language and fixes the name resolution where tests have failed.

Also:

Extends python tests to cover ty
Extends skipping conditions for several LS (but only when not in CI)
Better test output in CI
Removed a wrong python test (started failing for ty and should have failed for pyright too)
2026-04-01 16:29:00 +02:00
Michael Panchenko 0bbd9e375e Reformat (minor, after replacing black with ruff)
Black dependency created a dependabot warning and couldn't be bumped since it collided with pathspec dependencies. Since ruff can also format, black is not needed. But we now have these small format changes, mostly in test files
2026-03-23 21:10:41 +01:00
Vinh Tran 6d6f55308f feat(solidlsp): add Solidity language server support (#1156)
Integrates the Nomic Foundation @nomicfoundation/solidity-language-server
as a new Language.SOLIDITY backend (experimental). Supports .sol files with
go-to-definition, find references, document symbols, hover, and diagnostics.
The server is automatically installed via npm on first use.
2026-03-13 13:14:09 +01:00