Skip to content

fix(dap): create an expression code fragment as the file of its language, as its parser definition does - #2001

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
muescha:fix/dap-expression-fragment-language-file
Nov 17, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
muescha:fix/dap-expression-fragment-language-file

Conversation

@muescha

@muescha muescha commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1998

Summary

While a DAP session debugs a JavaScript file in an IDE with the JavaScript plugin (IntelliJ IDEA Ultimate, WebStorm, GoLand, …), typing in an expression editor (Evaluate, Watches, a breakpoint condition or logpoint) reports:

java.lang.ClassCastException: class com.redhat.devtools.lsp4ij.dap.evaluation.DAPExpressionCodeFragment
  cannot be cast to class com.intellij.lang.javascript.psi.JSElement
  at com.intellij.lang.javascript.psi.util.JSStubBasedScopeHandler.getScope(JSStubBasedScopeHandler.java:51)
  at com.intellij.lang.javascript.psi.util.JSStubBasedScopeHandler.processDeclarationsInScope(JSStubBasedScopeHandler.java:37)
  at com.intellij.lang.javascript.psi.util.JSStubBasedPsiTreeUtil.processDeclarationsInScope(JSStubBasedPsiTreeUtil.java:232)
  at com.intellij.lang.javascript.psi.impl.JSTextReferenceResolver.doProcessLocalVariants(JSTextReferenceResolver.java:48)
  ...
  at com.intellij.lang.javascript.psi.impl.JSReferenceSetElement.resolve(JSReferenceSetElement.java:54)
  at com.intellij.codeInsight.TargetElementUtilBase.getReferencedElement(TargetElementUtilBase.java:180)
  ...
  at com.intellij.codeInsight.daemon.impl.IdentifierHighlightingComputer.highlightReferencesAndDeclarations(IdentifierHighlightingComputer.kt:213)

IntelliJ blames the JavaScript plugin, but the cause is in LSP4IJ. The same exception comes from identifier highlighting, code completion (JSReferenceCompletionProvider) and JSResolvePrefetch. One IDE log (IntelliJ IDEA 2026.3, IU-263.7307.200) holds it 115 times over two sessions.

With this change, the fragment is created as the file of its language, the way the language's parser definition creates it: a JSFile for JavaScript.

Why the fragment is no JSFile

DAPDebuggerEditorsProvider.createExpressionCodeFragment() gives the fragment the file type and language of the file being debugged (a dialect such as ECMAScript 6 is degraded to the file type's language, JavaScript). It then created new DAPExpressionCodeFragment(...), a PsiFileBase in that language.

A PsiFileBase takes only the parser from the language: its tree is JavaScript PSI under a root node of the type JSFileElementType. The file object itself is LSP4IJ's own class. It implements neither JSFile nor JSElement. The language's own file class (JSFileImpl) is only created by JSParserDefinition.createFile(), which LSP4IJ never called.

The JavaScript plugin relies on the file class matching the root node. Claude Code decompiled the JavaScript plugin of 2026.3:

  • JSStubBasedScopeHandler.getScope() looks for the enclosing scope with JSStubBasedPsiTreeUtil.getContextOfType(context, SCOPE_TYPES, false) and casts the result to JSElement.
  • JSTreeUtil.ScopeTypesHolder.SCOPE_TYPES includes every JSFileElementType.
  • getContextOfType() returns a PsiFileImpl as the scope when types.contains(file.getFileElementType()).

For a reference at file level, the scope is the fragment, and the cast fails. The same code (and the same cast) is in the JavaScript plugin of 2024.2. An instanceof in the JavaScript plugin would avoid the exception, but the assumption itself is a reasonable one that most language plugins make: a file whose root node is of their file element type is their file class.

History

When Commit / issue What changed
2025-01-04, 0.10.0 3499339e "feat: initialize DAP support" DAPExpressionCodeFragment extends PsiFileBase, created with the language of the debugged file. The cause of this bug is in this design.
2025-06 redhat-developer/lsp4ij#1118 Debugging JavaScript in GoLand: PsiFileBase asserts "Language: ECMAScript 6 doesn't participate in view provider". The fragment for a JavaScript file could not be created at all, which hid the cast.
2026-04-08, 0.19.3 redhat-developer/lsp4ij#1466 (68700d7a), the fix for redhat-developer/lsp4ij#1465 A dialect is degraded to the file type's language. The JavaScript fragment is now created, and its PSI is reachable for the JavaScript plugin: the cast becomes possible.
2026-10-22, not released yet 6a31cee0 "fix: make a DAP expression code fragment physical when IntelliJ asks" The fragment of an expression editor is physical, as IntelliJ asks. IntelliJ now runs all of its highlighting passes and inspections on it, and the exception comes on nearly every key stroke.

So the bug has been in the code since DAP support started. It could be hit from 0.19.3 on, and it is frequent since 6a31cee. Few users run into it: it needs a DAP debug adapter for JavaScript (for example the vscode-js-debug template) in an IDE that has the JavaScript plugin. IntelliJ IDEA Community has no JavaScript plugin, and in IDEA Ultimate or WebStorm most people use the built-in JavaScript debugger.

Other languages

The same design breaks other languages, too. Claude Code ran a temporary probe in the test sandbox (IntelliJ IDEA Ultimate 2024.2 with its bundled plugins). For every registered language with a parser definition, it created a fragment from several expressions and resolved all references in it.

With new DAPExpressionCodeFragment(...) (before this change), 20 of 89 languages failed:

Failure Languages
The fragment is cast to the language's file class JavaScript, ECMAScript 6, TypeScript, TypeScript JSX, Flow JS, MongoJSExt (JSElement); JSP (BaseJspFile)
The fragment cannot be created: the parser definition's file belongs to another language (the same kind of failure as redhat-developer/lsp4ij#1465) XHTML (XML != XHTML), GitIgnore, HgIgnore, DockerIgnore, GitExclude (IgnoreLang != …), FTL (FTL> != FTL)
The language's PSI needs its own file or context EL, SpEL, MicronautEL (ELResolveUtil.processEmptyContext), PointcutExpression (AopPointcutUtil.getHolder), Markdown (flavour not set)
Not related to the fragment (also fails for a file that IntelliJ creates itself) Declarative (Android classes missing in the sandbox), SQLDateTime (injection-only, its lexer throws)

With this change, only the last two still fail. Both fail the same way with IntelliJ's own PsiFileFactory.createFileFromText(), so they are not caused by the fragment.

The probe covers reference resolution only. Completion, annotators and inspections on the old fragment may fail in more languages.

Change

DAPExpressionCodeFragment.create(text, fileType, language, debugProcess, project, physical):

  1. If the language has a parser definition, it creates a LightVirtualFile with the file type and language and sets up its PSI with PsiFileFactoryImpl.trySetupPsiForFile(file, language, physical, false). That is what PsiFileFactory.createFileFromText() does: the language's own file view provider (a template language such as JSP or FreeMarker has one) creates the file of the language through its parser definition.
  2. The DAP debug process is put on the file as user data (Key), not into a field of a subclass.
  3. Only for a language without a parser definition does it still create a DAPExpressionCodeFragment.

physical is passed to the view provider as before ("event system enabled"), so a physical fragment stays physical: the fix of 6a31cee is kept, and the existing tests for it pass.

DAPDebuggerEditorsProvider.createExpressionCodeFragment() calls DAPExpressionCodeFragment.create(...).

DAPCompletionProcessor found the expression editor by instanceof DAPExpressionCodeFragment and got the current stack frame from it. It now calls DAPExpressionCodeFragment.getCurrentDapStackFrame(psiFile), which reads the user data and so works for any file class.

Other solutions considered

Always plain text. Creating every fragment as a plain text file would avoid all language plugin code, so no language could fail in it. But the expression editor would lose everything the language gives it: syntax highlighting, brace matching, commenting, the language's own completion. DAP completion would still work (DAPCompletionProcessor is registered for language="any"). That is a big loss for a rare bug, and it would undo what redhat-developer/lsp4ij#1466 set out to keep.

Plain text file type with the language's syntax highlighter only. Giving the fragment the plain text language but the debugged file type would keep the colors, but the file view provider takes its base language from the file type, so file type and language would disagree, the same kind of mismatch that #1118 and #1465 hit.

An own language for the fragment. A DAP expression language that delegates its lexer and highlighter to the debugged language would keep the colors and keep language plugins out. It would need its own parser definition, file type and highlighter factory, and still lose brace matching, commenting and the language's completion. Much more code for less function.

Fix it in the JavaScript plugin. An instanceof JSElement in JSStubBasedScopeHandler.getScope() would avoid this one cast, but not the casts in JSP, the language mismatches, or the next language plugin that relies on its own file class.

Possible hardening on top (not in this PR):

  • If the language's file cannot be created (trySetupPsiForFile() returns null or throws), fall back to a plain text fragment instead of a DAPExpressionCodeFragment in the foreign language. That would catch errors when the file is created. Parsing is lazy, so it would not catch a lexer that throws later (SQLDateTime).
  • If the language's inspections turn out to be noisy in a fragment (for example "unresolved variable" for a variable of the debuggee), a ProblemHighlightFilter could switch off problem highlighting for files with the DAP user data. This has not been seen yet.

Tests

  • DAPDebuggerEditorsProviderTest (runs with IntelliJ IDEA Community, as on CI):
    • new testWithALanguageWhoseFileIsCreatedByAnotherLanguage: an XHTML fragment is created, is an XmlFile and is physical. Before this change it fails with AssertionError: Language: XML != Language: XHTML.
    • testWithDialectLanguage now also asserts that the JSON fragment is a JsonFile, the file of its language. Before this change it is a DAPExpressionCodeFragment.
  • New DAPExpressionCodeFragmentJavaScriptTest: creates fragments of a .js file from several expressions and resolves all references in them. Before this change, o["x"] fails with the ClassCastException above, with the same stack (JSLiteralTextReference → JSTextReferenceResolver → JSStubBasedScopeHandler.getScope). It needs the JavaScript plugin and returns at once without it. A plain identifier such as x + y resolves another way and does not fail. See the open point below: as the build is now, this test runs nowhere.

Open point: the JavaScript test runs nowhere

Since redhat-developer/lsp4ij#1931 (4ffed454), prepareTestSandbox in build.gradle.kts disables the bundled JavaScript and com.intellij.css plugins, so that they do not take the .js, .ts and .css files of the other tests away from LSP4IJ. That is right for those tests, but it also means DAPExpressionCodeFragmentJavaScriptTest returns at once everywhere, including the CI job on IntelliJ IDEA 2026.3 (IU). The JavaScript plugin depends on the CSS plugin, so both have to be enabled for the test to run.

To run it locally, as done for this PR:

  1. In gradle.properties: platformType=IU and platformBundledPlugins=…,JavaScript,JavaScriptDebugger.
  2. In build.gradle.kts: comment out disabledPlugins.addAll("JavaScript", "com.intellij.css") in prepareTestSandbox.
  3. ./gradlew test --tests 'com.redhat.devtools.lsp4ij.dap.*'

A possible way to make it run on CI (not in this PR, happy to add it here or in a follow-up if you like it):

  • A Gradle property, for example -PtestWithJavaScriptPlugin, that leaves the two plugins enabled in prepareTestSandbox.
  • One more step in the IU job of ci.yml that runs only the tests which need the JavaScript plugin with that property, for example ./gradlew test --tests '*JavaScriptTest' -PplatformType=IU -PtestWithJavaScriptPlugin. The other tests keep running with both plugins disabled.

Removing the line from #1931 is no option: the other tests would lose their .js, .ts and .css files to the IDE's plugins again.

How this was checked

On upstream main 21a3f42a, with IntelliJ IDEA 2024.2 (the platformVersion of gradle.properties):

  • With platformType=IC (as on CI): all 328 tests in com.redhat.devtools.lsp4ij.dap.* pass. DAPDebuggerEditorsProviderTest fails without this change and passes with it; DAPExpressionCodeFragmentJavaScriptTest returns at once (no JavaScript plugin).
  • With platformType=IU, the bundled JavaScript plugin, and JavaScript and com.intellij.css enabled in the test sandbox (see the open point above): DAPExpressionCodeFragmentJavaScriptTest fails without this change with the ClassCastException (the fragment is a DAPExpressionCodeFragment) and passes with it (the fragment is a JSFileImpl). All 328 tests in com.redhat.devtools.lsp4ij.dap.* pass.
  • The probe over all languages, described above (not part of this PR).

IDE re-test

IntelliJ IDEA 2026.3 (IU-263.7307.200) with its bundled JavaScript plugin, and a DAP debug adapter for JavaScriptCore, run as a DAP run configuration. The debuggee stops at a debugger; statement in a .js file. Then, in the same steps before and after this change, with idea.log emptied first:

  • Evaluate: type item["count"], evaluate, delete it; the same with item.count.
  • Watches: add item["count"], then edit it (type and delete).
  • A breakpoint condition: item["count"] > 0.

Before: 0.30.0-SNAPSHOT from main, without this change

idea.log has the ClassCastException 59 times (message and stack lines). That is 17 SEVERE reports, all with "Plugin to blame: JavaScript and TypeScript":

Reported by SEVERE reports
InspectionRunner 10
Unhandled exception in the kernel (ExceptionsKt) 4
CompletionProgressIndicator 1
JSResolvePrefetch 1
Alarm 1

18 of the stacks also go through identifier highlighting (IdentifierHighlightingComputer). Each stack is the one above: JSLiteralTextReference → JSTextReferenceResolver → JSStubBasedScopeHandler.getScope().

After: this branch

The plugin built from this branch, installed in the same IDE, and the IDE restarted. The same steps.

Count in idea.log
ClassCastException 0
DAPExpressionCodeFragment 0
SEVERE reports 0
WARN entries 3, none related: 2 from PerformanceWatcherImpl ("responsive for long enough"), 1 from Alarm ("Do not create alarm without coroutineScope" in IntelliJ's DetailController)

🤖 Generated with Claude Code

DAPExpressionCodeFragment extends PsiFileBase: it took only the parser of
the debugged file's language, so its tree was that language's PSI under a
root node of the language's file element type, but the file was LSP4IJ's
own class, not the file class of the language. Language plugins rely on
that class. While debugging JavaScript with the JavaScript plugin
installed, JSStubBasedScopeHandler.getScope() found the fragment as the
scope by its JSFileElementType and cast it to JSElement, so typing in an
expression editor reported a ClassCastException from highlighting,
completion and resolve. In other languages the fragment could not be
created at all (XHTML, the ignore languages, FreeMarker), or was cast to
the language's file class (JSP).

DAPExpressionCodeFragment.create() now sets up the PSI of the language
for the fragment as PsiFileFactory.createFileFromText() does, with the
language's own view provider, which creates the language's file through
its parser definition. A physical fragment stays physical. The debug
process is kept as user data on the file, and DAPCompletionProcessor
reads it from there instead of by instanceof. A DAPExpressionCodeFragment
is created only for a language without a parser definition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Debugger expression fragments now better preserve the source language and file type, improving expression handling for languages such as JavaScript and XHTML.
    • Completion continues to use the active debug stack frame when available, including for parser-created expression files.

DAP expression fragments now use language-specific PSI files when parser definitions are available. The debug process is stored as PSI user data, and completion obtains the current stack frame through a static accessor.

Changes: DAP expression PSI creation

Layer / File(s) Summary
Create language-specific expression PSI
src/main/java/com/redhat/devtools/lsp4ij/dap/evaluation/DAPExpressionCodeFragment.java
A factory creates a language-specific PSI file when possible and falls back to DAPExpressionCodeFragment. Both creation paths store the debug process as user data.
Use the factory and retrieve the stack frame
src/main/java/com/redhat/devtools/lsp4ij/dap/DAPDebuggerEditorsProvider.java, src/main/java/com/redhat/devtools/lsp4ij/dap/completion/DAPCompletionProcessor.java, src/test/java/com/redhat/devtools/lsp4ij/dap/DAPDebuggerEditorsProviderTest.java, src/test/java/com/redhat/devtools/lsp4ij/dap/DAPExpressionCodeFragmentJavaScriptTest.java
The editor provider uses the factory, and completion reads the stack frame from the original PSI file. Tests cover XHTML PSI creation and reference resolution in JavaScript expression fragments.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: lagergren, angelozerr

Merge Risk: Minimal · up to 17d8b

Expression fragments in DAP debugging now use the language's own PSI file, which should remove the reported ClassCastException. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: DAP expression code fragments are created as the file of their language, matching the language's parser definition. The raw summary confirms this: create() uses the p…
Linked Issues check Passed Objective from #1998: a JavaScript DAP expression fragment must not be a DAPExpressionCodeFragment, so that the JavaScript plugin's JSElement cast does not fail. At reviewed head 17d8bdc, DAPExpressi…
Out of Scope Changes check Passed The changed files are DAPDebuggerEditorsProvider (factory call), DAPCompletionProcessor (uses the static stack-frame accessor instead of instanceof), DAPExpressionCodeFragment (new factory, user-data …
Description check Passed The description is directly related to the changeset. It names the ClassCastException in JavaScript DAP expression fragments, explains the cause (DAPExpressionCodeFragment is a PsiFileBase, not the la…
Full details: Title check

Explanation

The title states the main change: DAP expression code fragments are created as the file of their language, matching the language's parser definition. The raw summary confirms this: create() uses the parser definition, and the fragment falls back to DAPExpressionCodeFragment only without one. The title is specific and accurate, though long (103 characters).

Full details: Linked Issues check

Explanation

Objective from #1998: a JavaScript DAP expression fragment must not be a DAPExpressionCodeFragment, so that the JavaScript plugin's JSElement cast does not fail. At reviewed head 17d8bdc, DAPExpressionCodeFragment.create(...) calls PsiFileFactoryImpl.trySetupPsiForFile(file, language, physical, false) when the language has a parser definition, so the fragment is the language's own file class (JSFile for JavaScript). The DAP debug process is stored as file user data (DEBUG_PROCESS), and getCurrentDapStackFrame(PsiFile) reads it for any file class. Physical behavior is preserved by passing physical to the view provider. The fallback to DAPExpressionCodeFragment applies only when no parser definition exists. DAPDebuggerEditorsProvider uses the factory, and DAPCompletionProcessor uses the static accessor. Automated test: DAPExpressionCodeFragmentJavaScriptTest resolves references in JavaScript fragments and checks the expected behavior. The test returns at once when the JavaScript plugin is absent, which is the default CI sandbox, so it verifies the fix only when that plugin is enabled. The author reports a local run with the plugin enabled: it fails on main and passes with the change. DAPDebuggerEditorsProviderTest also covers the file-class behavior (XHTML, JSON). #1465 is closed and serves as context only.

Full details: Out of Scope Changes check

Explanation

The changed files are DAPDebuggerEditorsProvider (factory call), DAPCompletionProcessor (uses the static stack-frame accessor instead of instanceof), DAPExpressionCodeFragment (new factory, user-data accessor, constructor kept for languages without a parser definition), and the DAP tests. Each change supports the #1998 objective: the factory creates the language file, and the completion processor must read the debug process from a file of any class. No change was found that is unrelated to DAP expression fragments.

Full details: Description check

Explanation

The description is directly related to the changeset. It names the ClassCastException in JavaScript DAP expression fragments, explains the cause (DAPExpressionCodeFragment is a PsiFileBase, not the language's file class), and describes the fix: creating the fragment via the language's parser definition, storing the debug process as user data, and updating DAPCompletionProcessor. It also covers tests and verification.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4ff243a-a67c-427d-9a33-b74dbcb40edf
Commits

Reviewing files that changed from the base of the PR and between 21a3f42 and 17d8bdc.

Files selected for processing: 5

  • src/main/java/com/redhat/devtools/lsp4ij/dap/DAPDebuggerEditorsProvider.java
  • src/main/java/com/redhat/devtools/lsp4ij/dap/completion/DAPCompletionProcessor.java
  • src/main/java/com/redhat/devtools/lsp4ij/dap/evaluation/DAPExpressionCodeFragment.java
  • src/test/java/com/redhat/devtools/lsp4ij/dap/DAPDebuggerEditorsProviderTest.java
  • src/test/java/com/redhat/devtools/lsp4ij/dap/DAPExpressionCodeFragmentJavaScriptTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.11111% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.10%. Comparing base (21a3f42) to head (17d8bdc).

Files with missing lines Patch % Lines
...p4ij/dap/evaluation/DAPExpressionCodeFragment.java 60.00% 3 Missing and 3 partials ⚠️
.../lsp4ij/dap/completion/DAPCompletionProcessor.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2001      +/-   ##
==========================================
- Coverage   49.13%   49.10%   -0.04%     
==========================================
  Files         812      812              
  Lines       32975    32987      +12     
  Branches     5101     6739    +1638     
==========================================
- Hits        16201    16197       -4     
- Misses      14234    14244      +10     
- Partials     2540     2546       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lagergren

Copy link
Copy Markdown
Collaborator

@muescha Thanks! Since CI can't show the JavaScript case, I checked this one locally before merging it for 0.30.0.

DAPExpressionCodeFragmentJavaScriptTest returns at its first line in every run. CI's default legs run IntelliJ IDEA Community, which has no JavaScript plugin, and on Ultimate and the unified IntelliJ IDEA, build.gradle.kts disables the JavaScript plugin in the test sandbox (prepareTestSandbox, since #1931). So its comment, that it runs with platformType=IU and the bundled JavaScript plugin, doesn't hold. #2007 is about a test task in which it can run.

I ran it, with a broader check, on IntelliJ IDEA Ultimate 2024.2 with the bundled JavaScript plugin and that sandbox line commented out, for 15 Evaluate-style expressions (x + y, o["x"], "x" in o, o.hasOwnProperty("x"), Reflect.get(o, "x"), document.getElementById("x"), require("x"), undefinedName.foo, …):

  • On main, resolving the references threw the ClassCastException of DAP: typing in an expression editor throws a ClassCastException when the JavaScript plugin is installed #1998 for 7 of them, and the highlighting passes threw it for 2 of those.
  • With this PR, nothing throws, and each fragment is a JSFileImpl. DAPExpressionCodeFragmentJavaScriptTest passes.
  • With all 140 default-on JavaScript inspections enabled, no fragment gets a warning or an error, before or after. The same inspections report unresolved variables and unused code in an ordinary .js file, so IntelliJ simply doesn't inspect these fragments. The change adds no marks in Evaluate, Watches or breakpoint conditions.
  • All DAP tests pass on Ultimate with this PR.

DAP completion still finds its stack frame: DAPCompletionProcessor reads the debug process from parameters.getOriginalFile(), which keeps the user data, not from completion's copy of the file.

Not covered: Python with debugpy, since Ultimate doesn't bundle the Python plugin, and a live debug session.

@lagergren lagergren added this to the 0.30.0 milestone Nov 17, 2026
@lagergren
lagergren merged commit 4ab08d4 into redhat-developer:main Nov 17, 2026
10 checks passed
lagergren added a commit that referenced this pull request Nov 17, 2026
… their own (#2008)

The tests' sandbox disables the JavaScript and CSS plugins (#1931), and CI's default legs run IntelliJ
IDEA Community, which has neither. So DAPExpressionCodeFragmentJavaScriptTest (#2001) returned at its
first line in every run and passed without testing anything.

testJavaScript, registered with intellijPlatformTesting.testIde, runs the tests named
*JavaScriptPluginTest in a sandbox of its own, which keeps the JavaScript plugin; test leaves them out.
The IntelliJ Platform Gradle Plugin makes check run it. On IntelliJ IDEA Ultimate (-PplatformType=IU),
which bundles the plugin, it runs, as on CI's 2026.3 leg; elsewhere it is skipped. The test is renamed
to DAPExpressionCodeFragmentJavaScriptPluginTest, and fails instead of returning when the plugin isn't
loaded.

Validated:
- testJavaScript on IntelliJ IDEA Ultimate 2024.2 and 2026.3: 1 test, 0 failures.
- With the production change of #2001 reverted, it fails with the ClassCastException of #1998.
- On Community (the default), testJavaScript is skipped, and test doesn't run the test.
- The configuration cache is stored and reused.

Fixes #2007
@muescha
muescha deleted the fix/dap-expression-fragment-language-file branch November 20, 2026 00:36
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.

DAP: typing in an expression editor throws a ClassCastException when the JavaScript plugin is installed

2 participants