The IDE's native JavaScript language has dialects, e.g.:
Different dialects can be used for different files with the same extension in different project directories:
Now this may seem contrived, but since IntelliJ IDEA 2026.1 includes native support for JavaScript/TypeScript/CSS but not support for the JavaScript debugger, LSP4IJ + vscode-js-debug provides a nice way to address that gap. However, if a *.js file is evaluated as being ES6 by the IDE, the resulting DAPExpressionCodeFragment can end up evaluated as being base JavaScript, and this results in the following runtime error:
java.lang.AssertionError: Language Language: ECMAScript 6 doesn't participate in view provider com.intellij.psi.SingleRootFileViewProvider{vFile=LightVirtualFile: \DAPExpressionCodeFragment.js, content=VirtualFileContent{size=0}, eventSystemEnabled=true}: [Language: JavaScript]
at com.intellij.extapi.psi.PsiFileBase.findLanguage(PsiFileBase.java:48)
at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:23)
at com.redhat.devtools.lsp4ij.dap.evaluation.DAPExpressionCodeFragment.<init>(DAPExpressionCodeFragment.java:39)
at com.redhat.devtools.lsp4ij.dap.DAPDebuggerEditorsProvider.createExpressionCodeFragment(DAPDebuggerEditorsProvider.java:77)
at com.redhat.devtools.lsp4ij.dap.DAPDebuggerEditorsProvider.createExpressionCodeFragment(DAPDebuggerEditorsProvider.java:70)
at com.intellij.xdebugger.evaluation.XDebuggerEditorsProviderBase.createExpressionCodeFragment(XDebuggerEditorsProviderBase.java:54)
at com.intellij.xdebugger.evaluation.XDebuggerEditorsProviderBase.createDocument(XDebuggerEditorsProviderBase.java:43)
at com.redhat.devtools.lsp4ij.dap.DAPDebuggerEditorsProvider.createDocument(DAPDebuggerEditorsProvider.java:53)
at com.intellij.xdebugger.evaluation.XDebuggerEditorsProviderBase.createDocument(XDebuggerEditorsProviderBase.java:34)
at com.intellij.xdebugger.impl.ui.XDebuggerEditorBase.createDocument(XDebuggerEditorBase.java:359)
at com.intellij.xdebugger.impl.ui.XDebuggerExpressionComboBox.createDocument(XDebuggerExpressionComboBox.java:168)
at com.intellij.xdebugger.impl.ui.XDebuggerExpressionComboBox.lambda$doSetText$0(XDebuggerExpressionComboBox.java:150)
The solution should be to change the way the file is created to use the original file's language instead of its file type, specifically by changing DAPExpressionCodeFragment's constructor from:
new LightVirtualFile("DAPExpressionCodeFragment." + fileType.getDefaultExtension(), fileType, text)),
to:
new LightVirtualFile("DAPExpressionCodeFragment." + fileType.getDefaultExtension(), language, text)),
Note the change from fileType to language when creating the LightVirtualFile. The main potential issue would be if in the process of debugging, files from multiple dialects are included. The alternative would be to use the common base language for the code fragment which, while a least common denominator approach, would be safe for all potential dialects that might come into play during the debugging session.
The IDE's native JavaScript language has dialects, e.g.:
Different dialects can be used for different files with the same extension in different project directories:
Now this may seem contrived, but since IntelliJ IDEA 2026.1 includes native support for JavaScript/TypeScript/CSS but not support for the JavaScript debugger, LSP4IJ + vscode-js-debug provides a nice way to address that gap. However, if a
*.jsfile is evaluated as being ES6 by the IDE, the resultingDAPExpressionCodeFragmentcan end up evaluated as being base JavaScript, and this results in the following runtime error:The solution should be to change the way the file is created to use the original file's language instead of its file type, specifically by changing
DAPExpressionCodeFragment's constructor from:to:
Note the change from
fileTypetolanguagewhen creating theLightVirtualFile. The main potential issue would be if in the process of debugging, files from multiple dialects are included. The alternative would be to use the common base language for the code fragment which, while a least common denominator approach, would be safe for all potential dialects that might come into play during the debugging session.