flutter/patch-copied-lsp-sources
Copy JetBrains LSP sources into the Dart plugin and patch them to prevent conflicts and ensure proper configuration.
npx skills add https://github.com/flutter/dart-intellij-third-party --skill patch-copied-lsp-sources
Use this skill whenever JetBrains LSP source files are copied or refreshed from the intellij-community repository into the dart-intellij-third-party plugin. The skill automates the file copying, packaging them under the isolated com.intellij.platform.dartlsp package namespace directly, and applies all necessary adjustments to prevent conflicts with the built-in LSP client of IntelliJ IDEA.
To copy the sources from intellij-community and apply the adjustments automatically:
scripts directory from the repository root, passing the path to the local intellij-community repository as a positional argument: python3 .agents/skills/patch-copied-lsp-sources/scripts/patch.py /path/to/intellij-community
git diff. ./gradlew clean compileKotlin --no-build-cache
> [!NOTE]
> If you only need to re-apply the patches to the existing files in the workspace (without copying fresh files from intellij-community), you can run the script without any arguments:
> `bash
> python3 .agents/skills/patch-copied-lsp-sources/scripts/patch.py
> `
Here is the details of the changes made by the patch script:
platform/lsp/src/com/intellij/platform/lsp into third_party/thirdPartySrc/platform-lsp/src/com/intellij/platform/dartlsp.com.intellij.platform.lsp to com.intellij.platform.dartlsp across all .kt, .java, and .xml source files to avoid split-package classloader collisions and wrong-namespace imports.lsp.server.connect.timeout to dart.lsp.server.connect.timeout in dart-lsp-impl.xml and Lsp4jServerConnector.kt to avoid conflicting with IntelliJ IDEA's default LSP settings.Dart: in dart-lsp-impl.xml and LspServerNotificationsHandlerImpl.kt to avoid conflicts with IntelliJ's platform groups.LSP window/showMessage -> Dart: LSP window/showMessageLSP window/logMessage: errors, warnings -> Dart: LSP window/logMessage: errors, warningsLSP window/logMessage: info, log; $/logTrace -> Dart: LSP window/logMessage: info, log; $/logTraceid="..." attributes from all extension definitions in dart-lsp-impl.xml (except <notificationGroup>), as they are optional and avoid ID collision warnings/conflicts.messages.LspBundle to messages.DartLspBundle in dart-lsp-impl.xml and LspBundle.kt.DartLspBundle.properties resource file under third_party/src/main/resources/messages/ containing the required localization keys.defaultValue="false" for registry key lsp.communication.standard.log.file in dart-lsp-impl.xml to avoid spamming the main idea.log with LSP logs by default, storing them in session-specific files instead.LspIntention to DartLspIntention and update descriptionDirectoryName to DartLspIntention in dart-lsp-impl.xml to prevent collision.if (!ProjectFileIndex.getInstance(project).isInContent(file)) return false from LspServerImpl.isSupportedFile(file) so that the Dart LSP bridge can serve external library files (such as pub-cache packages and Dart SDK libraries like dart:io).Take flutter/patch-copied-lsp-sources from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.