Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(lsp): determine file referrer for each document #23867

Merged
merged 9 commits into from
May 23, 2024

Conversation

nayeemrmn
Copy link
Collaborator

This adds Document:file_referrer which is still unused. It tracks the last file URL in each document's referrer chain. This will allow scope attribution for remote modules for multi-deno.json support. Maybe a strange patch but I want to separate it.

Separates Documents::get() into Documents::get() and Documents::get_or_load(). The former will only return a document that is already registered. The latter takes a referrer. This ensures that every remote module document takes a referrer into account. Most importantly, the TS server's op state will track the last seen referrer when requesting the graph and pass that to Documents::get_or_load() when loading a module source.

@nayeemrmn nayeemrmn changed the title refactor(lsp): determine file referrer each document refactor(lsp): determine file referrer for each document May 17, 2024
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM

@nayeemrmn nayeemrmn merged commit 0a30897 into denoland:main May 23, 2024
17 checks passed
@nayeemrmn nayeemrmn deleted the lsp-file-referrers branch May 23, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants