Skip to content

fix: resolve @codemirror/lsp-client from git submodule - #2901

Open
RohitKushvaha01 wants to merge 1 commit into
Acode-Foundation:mainfrom
RohitKushvaha01:fix/use-lsp-client-submodule
Open

RohitKushvaha01 wants to merge 1 commit into
Acode-Foundation:mainfrom
RohitKushvaha01:fix/use-lsp-client-submodule

Conversation

@RohitKushvaha01

@RohitKushvaha01 RohitKushvaha01 commented Sep 15, 2026

Copy link
Copy Markdown
Member
  • setup initializes the submodule before installing dependencies
  • CI checkout steps that install or build fetch submodules recursively
  • rspack treats the submodule's prebuilt dist as a dependency, not as first-party source
  • docs clone with --recurse-submodules and note the setup fallback

This is a Fix for
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/48774

npm refuses to fetch git dependencies (EALLOWGIT), which made
`npm run setup` fail before installing any dependency. The dependency
now points at the local codemirror-lsp-client submodule, pinned to the
same commit the git ref used.

- setup initializes the submodule before installing dependencies
- CI checkout steps that install or build fetch submodules recursively
- rspack treats the submodule's prebuilt dist as a dependency, not as
  first-party source
- docs clone with --recurse-submodules and note the setup fallback
@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR should not merge until archive-based setup can obtain the newly required submodule contents.

Findings

  1. P1 Source archive setup fails

Summary

This PR replaces the Git-hosted CodeMirror LSP dependency with a pinned Git submodule and updates setup, CI, bundling, lockfiles, and contributor documentation accordingly.

  • Initializes or recursively checks out the submodule before dependency installation.
  • Treats the linked package’s prebuilt JavaScript as dependency code in Rspack.
  • Documents recursive cloning and manual submodule recovery.
  • Leaves standard source archives unable to satisfy the new local dependency.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Clone repository] --> B{Submodule populated?}
  B -->|Yes| C[Install local file dependency]
  B -->|No, Git checkout| D[git submodule update]
  D --> C
  B -->|No, source archive| E[Git update fails]
  E --> F{Package files bundled?}
  F -->|Yes| C
  F -->|No| G[Setup throws]
  C --> H[Rspack resolves linked package]
  H --> I[Dependency-only SWC loader]
Loading

Reviews (1) · Last reviewed commit: "fix: resolve @codemirror/lsp-client from..."

Comment thread utils/setup.js
Comment on lines +71 to +83
// Not a git checkout (e.g. source archive) but the sources are already
// there, so the local "file:" dependency can still be installed.
if (fs.existsSync(path.join(submodulePath, "package.json"))) {
console.warn(
`Failed to update git submodules. Using the existing ${LSP_CLIENT_DIR} checkout.`,
);
return;
}

throw new Error(
`Unable to initialize the ${LSP_CLIENT_DIR} submodule. Run "git submodule update --init --recursive" manually and try again.`,
{ cause: error },
);

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.

P1 Source archive setup fails

Standard source archives do not include checked-out Git submodule contents. In that situation, the Git command fails, codemirror-lsp-client/package.json is absent, and setup throws before installing dependencies. This breaks archive-based setup, which previously fetched the Git dependency during installation, even though this fallback explicitly accounts for source archives.

@UnschooledGamer

Copy link
Copy Markdown
Collaborator

For this, The fix will occur in next release on F-droid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants