Mac: A certain file won't open an editor tab

After I upgraded to 11.0.3, there's a single file in one project that will not open in WebStorm (Mac).  I have no idea why. There's no error message.

Attached is a screenshot showing that when I click on the file, it shows up in the breadcrumb view at the top of the Webstorm window, but no editor tab opens.

Does anyone have an idea what could be happening?



Attachment(s):
Webstorm-Issue.png
7 comments
Comment actions Permalink

With WebStorm 12 EAP I actually get an AssertionError:

Attempt to create a composite block with no children
java.lang.AssertionError: Attempt to create a composite block with no children
 at com.intellij.webcore.formatter.CompositeBlock.<init>(CompositeBlock.java:26)
 at com.intellij.webcore.formatter.chainedMethods.CallChainBlockBuilder$ReferenceBlock.<init>(CallChainBlockBuilder.java:251)
 at com.intellij.webcore.formatter.chainedMethods.CallChainBlockBuilder.a(CallChainBlockBuilder.java:241)
 at com.intellij.webcore.formatter.chainedMethods.CallChainBlockBuilder.buildBlocks(CallChainBlockBuilder.java:88)
 at com.intellij.lang.javascript.formatter.blocks.JSBlock.buildChainBlocks(JSBlock.java:184)
 at com.intellij.lang.javascript.formatter.blocks.JSBlock.getSubBlocks(JSBlock.java:120)
 at com.intellij.psi.formatter.common.NewLineBlocksIterator.a(NewLineBlocksIterator.java:115)
 at com.intellij.psi.formatter.common.NewLineBlocksIterator.a(NewLineBlocksIterator.java:100)
 at com.intellij.psi.formatter.common.NewLineBlocksIterator.a(NewLineBlocksIterator.java:55)
 at com.intellij.psi.formatter.common.NewLineBlocksIterator.hasNext(NewLineBlocksIterator.java:48)

0
Comment actions Permalink

Does the problem persists after invalidating caches (File/Invalidate caches, Restart)? If yes, can you attach a file that shows up the issue plus your settings (File/Export settings)?

0
Comment actions Permalink

Invalidate and restart did not fix the problem. Still getting the exceptions in WebStorm 12 EAP.  Attached are my settings and the individual file.



Attachment(s):
LoginRoutes.js
settings.jar
0
Comment actions Permalink

I just found another file that has the same issue.

I also did a full

rm -rf repo
git clone [myrepo]

and the error persists. I still cannot open either of these files.



Attachment(s):
PipRoutes.js
0
Comment actions Permalink

Can't recreate in EAP when using your settings and files... Please try creating a new project and copy both attachjed files to it - can you open these files in this new project?

0
Comment actions Permalink

problem is tracked as https://youtrack.jetbrains.com/issue/WEB-19713, please follow it for updates

0
Comment actions Permalink

Per that issue, I removed comments that I had between chained statements:

function getSAMLToken (req, res, next) {

 
  if (req.body.tokenid && req.body.agentid) {
    
require('rest').
      wrap(require('rest/interceptor/mime')).
      wrap(require('rest/interceptor/timeout'), { timeout: 15000 }).
      wrap(require('rest/interceptor/basicAuth'), {
        
username: config.get('security.pingOne.clientId'),
        password: config.get('security.pingOne.secret')
      })({
path: 'https://sso.connect.pingidentity.com/sso/TXS/2.0/1/' + req.body.tokenid }).


the file will now open, but syntax highlighting stops working about halfway through the file.  If I change a line of a chained call, I get an exception.

For example, if I change

    Promise.then();

to

    Promise.
        then();

I get this exception:


java.lang.IndexOutOfBoundsException: Index: 152, Size: 0
 at java.util.ArrayList.rangeCheck(ArrayList.java:653)
 at java.util.ArrayList.get(ArrayList.java:429)
 at com.intellij.openapi.editor.impl.view.TextLayoutCache.a(TextLayoutCache.java:113)
 at com.intellij.openapi.editor.impl.view.TextLayoutCache.invalidateLines(TextLayoutCache.java:106)
 at com.intellij.openapi.editor.impl.view.EditorView.invalidateRange(EditorView.java:296)
 at com.intellij.openapi.editor.impl.EditorImpl$1.attributesChanged(EditorImpl.java:404)
 at com.intellij.openapi.editor.impl.EditorImpl$1.afterAdded(EditorImpl.java:369)
 at com.intellij.openapi.editor.impl.MarkupModelImpl.fireAfterAdded(MarkupModelImpl.java:237)
 at com.intellij.openapi.editor.impl.MarkupModelImpl.a(MarkupModelImpl.java:139)
 at com.intellij.openapi.editor.impl.MarkupModelImpl.addRangeHighlighterAndChangeAttributes(MarkupModelImpl.java:125)
 at com.intellij.codeInsight.daemon.impl.UpdateHighlightersUtil.a(UpdateHighlightersUtil.java:408)
 at com.intellij.codeInsight.daemon.impl.UpdateHighlightersUtil.addHighlighterToEditorIncrementally(UpdateHighlightersUtil.java:115)
 at com.intellij.codeInsight.daemon.impl.HighlightingSessionImpl$1.process(HighlightingSessionImpl.java:126)
 at com.intellij.codeInsight.daemon.impl.HighlightingSessionImpl$1.process(HighlightingSessionImpl.java:122)
 at com.intellij.util.containers.TransferToEDTQueue.processNext(TransferToEDTQueue.java:99)
 at com.intellij.util.containers.TransferToEDTQueue.access$300(TransferToEDTQueue.java:37)
 at com.intellij.util.containers.TransferToEDTQueue$1.run(TransferToEDTQueue.java:58)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)

UPDATE:

The syntax highlighting I'm able to resolve by finding where it stops, and hitting ENTER after the last ".".  It appears that there is definitely something wrong with how that last dot on a line chaining feature is implemented.

0

Please sign in to leave a comment.