Skip to content

Simplify Server by moving bits of code toWorkspaceProjects - #9822

Merged
jtulach merged 1 commit into
apache:masterfrom
jtulach:jtulach/RefactorToWorkspaceProjects
Nov 22, 2026
Merged

jtulach merged 1 commit into
apache:masterfrom
jtulach:jtulach/RefactorToWorkspaceProjects

Conversation

@jtulach

@jtulach jtulach commented Nov 22, 2026

Copy link
Copy Markdown
Contributor
  • while trying to use Unify and speed opening of DirectoryGroup up #9821 in java.lsp.server I realized...
  • I find the Server.java file a little bit too large
  • hence, before doing anything else
  • here is a 1:1 refactoring that introduces WorkspaceProjects dedicated class

@jtulach jtulach self-assigned this Nov 22, 2026
@jtulach jtulach added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests labels Nov 22, 2026
@jtulach
jtulach force-pushed the jtulach/RefactorToWorkspaceProjects branch from 392b175 to c79b31f Compare November 22, 2026 09:13
@jtulach jtulach changed the title Simplify Server by extracting some code toWorkspaceProjects Simplify Server by moving bits of code toWorkspaceProjects Nov 22, 2026

@eppleton eppleton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I compared every line removed from Server.java with the new WorkspaceProjects.java (ignoring whitespace), and it is the 1:1 move described. The only differences are the expected ones: the logger, request processor and telemetry constants are now package-level on Server, the client is accessed through a supplier, and all four synchronized (this) blocks moved together with the fields they guard. Callers elsewhere in the module only use openedProjects() via LspServerState, which still delegates. Looks good to me.

Two small remarks, neither blocking:

  1. LanguageServerImpl had its own logger (...protocol.Server$LanguageServerImpl), which is removed here, so all its messages, including the project-opening FINE/FINER logs, now go to ...protocol.Server. Nothing in the repo depends on the old name, but anyone enabling this logging via -J-D...Server$LanguageServerImpl.level=FINER (e.g. from bug-report instructions) would silently stop seeing it.
  2. In WorkspaceProjects.java around line 373, the comment "// Wait for all priming builds, even those already pending, to finish:" ended up joined to the preceding }); line.

@jtulach
jtulach merged commit 95eae73 into apache:master Nov 22, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants