Say when a language has no server instead of just doing less - #78
Merged
Conversation
rust·go·c·cpp·shell·lua·java 는 이미 등록돼 있었음. PATH 에 바이너리 있으면 자동으로 켜짐. 문제는 반대쪽 — 없을 때 아무 말도 안 함. gopls 없으면 Go 파일은 하이라이트만 되고 정의·진단·심볼이 전부 조용히 없다. 앱이 원래 그 정도인 줄 알기 딱 좋음. 레지스트리가 설치된 것만 들고 있어서 없다고 말할 재료도 없었음. 아는 서버 전부를 catalog 로 들고, 그 언어 파일 처음 열 때 한 번 알림. 설치 명령도 같이. TypeScript 는 Monaco 워커가 맡으니까 없다고 안 함. registry() 가 where 를 언어 수만큼 동기로 도는데 그걸 처음 물어보는 쪽이 다 치르고 있었음. 앱 뜬 직후 미리 짓게 함.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the 0.4.0 plan §7 — "attach more language servers". Reading the code first changed what the work was.
They were already attached
rust,go,c,cpp,shell,luaandjavaare all inlspRegistry.cjsand activate automatically when the binary is onPATH. Nothing needed adding.What was actually missing
The registry only kept servers it found. So when
goplsis not installed, a Go file gets syntax highlighting and nothing else — no diagnostics, no go-to-definition, no symbols — and the app never says why. It reads as the app simply being weak at Go.There was no way to say otherwise: to report that something is missing you have to know it could exist.
The catalog now holds every server this app knows about, installed or not, with the command and how to install it. Opening a file of such a language says so once:
Once per language, and only when a file of that language is actually opened. TypeScript is deliberately never reported as missing — Monaco's worker handles it, so saying otherwise would be false.
The decision logic is in
src/engine/lspHint.tsas pure functions (11 tests), including that an unknown language is never reported.Also
registry()runswhere/whichonce per language synchronously, and whoever asked first paid for all of it — which turned out to be the first file open. It is now built shortly after startup instead.Verification
Real app, on a machine with neither
goplsnorrust-analyzer, 5/5: openingmain.gogives the notice with the install command;app.tsstays silent;lib.rsgets its own notice; reopeningmain.gosays nothing.1102 unit tests passing.
npm run typecheckandnpm run buildclean.A probe mistake worth noting: it clicked the
srcfolder before each file, toggling it collapsed, so most file clicks silently did nothing and the run looked like the notice never fired. Expanding once fixed the probe — the app had been correct from the first run.