Repository navigation
doc(lsp): the climb to the root is a measured cost, kept on purpose - #367
Merged
Merged
Conversation
A buffer whose ancestors hold no source makes the server list every
directory up to the root, $TMPDIR included, on each check. Nothing on
the way marks where a project ends: there is no manifest and the
server reads no workspace root. Since zrt_listdir sorts once (#361) a
level costs one readdir and one sort, so load_buffer now says that,
and where a bound belongs when either missing thing exists.
Closes #364.
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.
Closes #364.
What
A comment, no behaviour change.
load_buffernow says that a buffer whose ancestors hold no source climbs to thefilesystem root, why that is kept, what it costs, and where a bound would come from.
Why not bound the climb
The issue offered two ways out; this takes the second. A bound needs something that says where a project ends,
and neither candidate exists: there is no manifest (
docs/runtime/package.md's package layer is[not yet]), andthe server reads no
rootUri/workspaceFoldersfrom the client. A.gitmarker would not help the case thatprompted this either — a scratch file in
$TMPDIRhas none above it.Measured
macOS,
$TMPDIRholding 43,653 entries,bin/zergbuilt from main after #361:$TMPDIRBefore #361 the same listing was quadratic and
make lspfailed on this machine; after it, the gate passes.Verified
build,fixpoint,lint,fmt-self,docs-links, each run alone and read. The rest of the board was not runfor a comment-only change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01N8jd1oK2orM6diHxhvWhC7