7ute / symbols-list

An alternate symbol list sidebar for Atom.io text editor
GNU General Public License v3.0
32 stars 24 forks source link

Uncaught TypeError: Cannot read property '1' of null #66

Closed vgagnoncoll closed 5 years ago

vgagnoncoll commented 6 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.25.0 x64 Electron: 1.7.11 OS: Microsoft Windows 10 Pro Thrown From: symbols-list package 2.4.1

Stack Trace

Uncaught TypeError: Cannot read property '1' of null

At C:\Users\Vincent\.atom\packages\symbols-list\lib\symbols-list.coffee:134

TypeError: Cannot read property '1' of null
    at /packages/symbols-list/lib/symbols-list.coffee:134:84
    at TextBuffer.module.exports.TextBuffer.scanInRange (~/AppData/Local/atom/app-1.25.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1097:15)
    at TextBuffer.module.exports.TextBuffer.scan (~/AppData/Local/atom/app-1.25.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1052:25)
    at TextEditor.scan (~/AppData/Local/atom/app-1.25.0/resources/app/src/text-editor.js:3363:30)
    at Object.recursiveScanRegex (/packages/symbols-list/lib/symbols-list.coffee:133:33)
    at Object.recursiveScanRegex (/packages/symbols-list/lib/symbols-list.coffee:136:22)
    at Object.recursiveScanRegex (/packages/symbols-list/lib/symbols-list.coffee:136:22)
    at Object.recursiveScanRegex (/packages/symbols-list/lib/symbols-list.coffee:136:22)
    at /packages/symbols-list/lib/symbols-list.coffee:80:25

Commands

 23x -2:28.8.0 intentions:highlight (input.hidden-input)
     -2:27.6.0 core:close (input.hidden-input)
  6x -2:25.5.0 intentions:highlight (input.hidden-input)
     -2:24.9.0 core:close (input.hidden-input)
     -1:54 intentions:highlight (input.hidden-input)
     -1:53.7.0 core:cut (input.hidden-input)
     -1:53 intentions:highlight (input.hidden-input)
     -1:52.8.0 core:save (input.hidden-input)

Non-Core Packages

atom-autocomplete-php 0.25.6 
autocomplete-javascript 0.0.2 
autocomplete-solidity 0.3.4 
busy-signal 1.4.3 
file-icons 2.1.17 
intentions 1.1.5 
language-solidity 0.1.0 
linter 2.2.0 
linter-php 1.5.1 
linter-solidity 0.5.0 
linter-ui-default 1.7.1 
symbols-list 2.4.1 
Torniojaws commented 6 years ago

Still happening. Any update coming?

heywiki commented 6 years ago

I moved back to 2.3.6 untill this is fixed: uninstall current package and then use "apm install symbols-list@2.3.6" from the command line

mbuc82 commented 6 years ago

Hello together,

today symbols-list 2.5.1 was released, which should fix the described problem(s). Would you please verify again and let us know, if there are still issues that prevents you from using the latest version?

Thanks in advance!

Cheers Marco

Saucistophe commented 6 years ago

Nope, it still flares up randomly on my .js files. I can't give you a SSCCE, some files trigger it, some do not; removing code seems to fix it, but reverting it to the previous state does not trigger it back. Weird.

I'm on Windows 10 if that's of any use, and have the following plugins: atom-beautify@0.32.0 atom-ignore@0.2.0 atom-live-server@2.2.0 atom-typescript@12.3.0 build@0.70.0 busy@0.7.0 busy-signal@1.4.3 color-picker@2.2.5 git-blame@1.6.0 highlight-selected@0.13.1 intentions@1.1.5 language-batch@0.4.0 linter@2.2.0 linter-ui-default@1.7.0 minimap@4.29.8 rectangle-selection@0.2.0 stash-tabs@0.1.0 symbols-list@2.5.1 toggler@0.3.1 tree-ignore@0.6.2

nockieboy commented 6 years ago

Still happening - I have one file that it is 100% reproducible with - every time I click its tab to view the contents the error pops up, which is slightly annoying...

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.26.0 ia32 Electron: 1.7.11 OS: Microsoft Windows 10 Pro Thrown From: symbols-list package 2.5.1

Stack Trace

Uncaught TypeError: Cannot read property '1' of null

At C:\Users\Jonathan\.atom\packages\symbols-list\lib\symbols-list.coffee:154

TypeError: Cannot read property '1' of null
    at /packages/symbols-list/lib/symbols-list.coffee:154:84
    at TextBuffer.module.exports.TextBuffer.scanInRange (~/AppData/Local/atom/app-1.26.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1097:15)
    at TextBuffer.module.exports.TextBuffer.scan (~/AppData/Local/atom/app-1.26.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1052:25)
    at TextEditor.scan (~/AppData/Local/atom/app-1.26.0/resources/app/src/text-editor.js:3363:30)
    at Object.recursiveScanRegex (/packages/symbols-list/lib/symbols-list.coffee:153:33)
    at Object.recursiveScanRegex (/packages/symbols-list/lib/symbols-list.coffee:156:22)
    at Object.recursiveScanRegex (/packages/symbols-list/lib/symbols-list.coffee:156:22)
    at Object.recursiveScanRegex (/packages/symbols-list/lib/symbols-list.coffee:156:22)
    at /packages/symbols-list/lib/symbols-list.coffee:93:29

Commands

Non-Core Packages

atom-beautify 0.32.2 
atom-clock 0.1.16 
atom-minify 0.8.0 
auto-detect-indentation 1.3.0 
autoclose-html 0.23.0 
busy-signal 1.4.3 
color-picker 2.3.0 
git-control 0.9.0 
highlight-selected 0.13.1 
intentions 1.1.5 
language-z80asm 0.34.0 
less-than-slash 0.18.0 
linter 2.2.0 
linter-csslint 2.0.0 
linter-htmlhint 1.4.0 
linter-jshint 3.1.6 
linter-ui-default 1.7.1 
merge-conflicts 1.4.5 
minimap 4.29.8 
minimap-highlight-selected 4.6.1 
minimap-pigments 0.2.2 
open-recent 5.0.0 
php-cs-fixer 4.1.1 
php-twig 4.0.0 
pigments 0.40.2 
Sublime-Style-Column-Selection 1.7.4 
symbols-list 2.5.1 
wordcount 2.10.4 
alp1396 commented 6 years ago

Bug still present. Update to 2.5.1 does not helped

RobMayer commented 6 years ago

Still happening, I'm afraid. Using a PHP file, albeit one that does not have a class in it.

BelgianShepherd commented 5 years ago

Have so far had this error in 2 files and by a process of elimination it went away when I changed any line that started with

// TODO:

Just changing it to:

// x TODO:

was enough.

Torniojaws commented 5 years ago

Still happens with Python files. I don't remember seeing it in JS files anymore though.

nockieboy commented 5 years ago

Have so far had this error in 2 files and by a process of elimination it went away when I changed any line that started with

// TODO:

Just changing it to:

// x TODO:

was enough.

Can confirm that this works for me at least.

scsmash3r commented 5 years ago

Have so far had this error in 2 files and by a process of elimination it went away when I changed any line that started with

// TODO:

Just changing it to:

// x TODO:

was enough.

Confirming this behavior too. It will also throw an error if words are: HACK, FIXME

7ute commented 5 years ago

Hi, Did the last release (v2.5.2) fix it for you ? If not, could we have test file with the bare minimum to trigger the failure ? Thank you :)

scsmash3r commented 5 years ago

Hi, Did the last release (v2.5.2) fix it for you ? If not, could we have test file with the bare minimum to trigger the failure ? Thank you :)

Specs: Atom: 1.34.0 (will also try on 1.35.1, since it was released not so long ago, but I doubt that will fix the problem) Electron: 2.0.16 Chrome: 61.0.3163.100 Node: v8.9.3

It seems that now it throws same error, but it's "slice" instead "1": image

Bare minimum to trigger an error:

  1. Create .js file, i.e.
  2. Put some code:
    
    var somevar = 1;

/ COMMENT / var somevar2 = 2; / TODO This will cause 'Uncaught TypeError' /

/ COMMENT ADD / var func = function() {

// FIXME: This will also cause 'Uncaught TypeError'
var somevar3 = 3;

};


3. Save file, trigger an error.
7ute commented 5 years ago

Thank you @scsmash3r for these details. I've isolated the problem, happening only on windows created files (with CRLF as line separator), and pushed a fix in v2.5.4

If this problem happens again, feel free to comment this issue (ideally with a test file)

scsmash3r commented 5 years ago

Seems that now 'TODO', 'FIXME', 'HACK' words are not working in .php files at all.

Bare minimum:

  1. Create .php file
  2. Put contents:
    
    <?php
    /**
    * @link string
    * @copyright string
    * @license string
    */
    namespace frontend\components;

use Something;

/**