fix: lsp startup failure#2060
Conversation
Greptile SummaryThis PR fixes LSP startup failures by expanding port file discovery to include a new Confidence Score: 4/5Safe to merge — the fix correctly broadens port file search paths and makes startup failures explicit with proper cleanup. No P0/P1 bugs found. Changes are well-scoped: multi-path discovery is correct, the new throw surfaces real failures, and cleanup in the catch block is complete. One minor silent-failure edge (already-managed server, bridge mode, no port found) falls through without a port but is pre-existing behaviour not worsened by this PR. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ensureServerRunning] --> B{managedServers has key?}
B -- Yes --> C{bridge && !bridge.port?}
C -- Yes --> D{existing.port?}
D -- Yes --> E[Return uuid + existing.port]
D -- No --> F[getLspPort - try /public then /alpine/home]
F -- Found --> G[Cache port, return uuid + port]
F -- Not found --> H[Return uuid only - no port]
C -- No --> H
B -- No --> I[resolveStartCommand]
I --> J[startInteractiveServer]
J --> K{bridge && !bridge.port?}
K -- Yes --> L[waitForPort 10s]
L -- Found --> M[Cache port in entry]
M --> N[Return uuid + discoveredPort]
L -- Not found --> O[throw Error - port undiscovered]
O --> P[catch: show error, stop server, delete entry, throw LSP_SERVER_UNAVAILABLE]
K -- No --> Q{server.transport.url?}
Q -- Yes --> R[waitForWebSocket]
R --> N
Q -- No --> N
Reviews (1): Last reviewed commit: "fix: lsp startup failure" | Re-trigger Greptile |
No description provided.