Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error thrown by autocomplete while typing #1065

Open
5 tasks done
jboilesen opened this issue Jul 24, 2024 · 3 comments
Open
5 tasks done

Error thrown by autocomplete while typing #1065

jboilesen opened this issue Jul 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jboilesen
Copy link

Thanks in advance for your bug report!

  • Have you reproduced issue in safe mode?
  • Have you used the debugging guide to try to resolve the issue?
  • Have you checked our FAQs to make sure your question isn't answered there?
  • Have you checked to make sure your issue does not already exist?
  • Have you checked you are on the latest release of Pulsar?

What happened?

I was simply writing code when autocomplete throw this error.

Pulsar version

1.119.2024071703 x64

Which OS does this happen on?

🐧 Debian based (Linux Mint, Ubuntu, etc.)

OS details

Debian Bookworm

Which CPU architecture are you running this on?

x86_64/AMD64

What steps are needed to reproduce this?

Sincerely, I am not sure how to reproduce this issue.

I was typing in a big file (4000+ lines) in a big project (3000+ files) and autocomplete thrown this error.

Additional Information:

Versions

Pulsar: 1.119.2024071703 x64
Electron: 12.2.3
OS: Debian GNU/Linux
Thrown From: Pulsar Core

Stack Trace

Uncaught TypeError: Cannot read property 'map' of null

At /opt/Pulsar/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1323

TypeError: Cannot read property 'map' of null
    at LanguageLayer.getOrParseTree (/app.asar/src/wasm-tree-sitter-language-mode.js:4133:39)
    at WASMTreeSitterLanguageMode.suggestedIndentForEditedBufferRow (/app.asar/src/wasm-tree-sitter-language-mode.js:1909:39)
    at TextEditor.autoDecreaseIndentForBufferRow (/app.asar/src/text-editor.js:5724:36)
    at Selection.insertText (/app.asar/src/selection.js:579:19)
    at /app.asar/src/text-editor.js:1748:31
    at /app.asar/src/text-editor.js:1801:33
    at Array.map (<anonymous>)
    at /app.asar/src/text-editor.js:1800:60
    at TextBuffer.transact (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1320:16)
    at TextEditor.transact (/app.asar/src/text-editor.js:2467:24)
    at /app.asar/src/text-editor.js:1799:19
    at TextEditor.mergeSelections (/app.asar/src/text-editor.js:4053:20)
    at TextEditor.mergeIntersectingSelections (/app.asar/src/text-editor.js:4015:10)
    at TextEditor.mutateSelectedText (/app.asar/src/text-editor.js:1798:17)
    at TextEditor.insertText (/app.asar/src/text-editor.js:1747:25)
    at /app.asar/node_modules/underscore-plus/lib/underscore-plus.js:77:27)
    at TextEditorComponent.didTextInput (/app.asar/src/text-editor-component.js:1845:24)

Commands

     -1:53.8.0 editor:newline (input.hidden-input)
     -1:53.6.0 core:backspace (input.hidden-input)
     -1:51.3.0 core:save (input.hidden-input)
     -1:46.1.0 autocomplete-plus:cancel (input.hidden-input)
     -1:37.4.0 core:backspace (input.hidden-input)
  4x -1:36.6.0 core:save (input.hidden-input)
  3x -1:21.5.0 core:backspace (input.hidden-input)
  5x -1:01.6.0 core:save (input.hidden-input)
     -0:51.7.0 core:move-left (input.hidden-input)
  4x -0:50 core:save (input.hidden-input)
     -0:45.7.0 core:move-right (input.hidden-input)
     -0:44.3.0 core:backspace (input.hidden-input)
     -0:43 core:save (input.hidden-input)
     -0:40.8.0 core:move-left (input.hidden-input)
  4x -0:39 core:save (input.hidden-input)
     -0:27.9.0 core:delete (input.hidden-input)

Non-Core Packages

git-plus 8.7.1 
platformio-ide-terminal 2.10.1 
@jboilesen jboilesen added the bug Something isn't working label Jul 24, 2024
@savetheclocktower
Copy link
Contributor

Thanks for the report. Can you tell me what sort of file this was? It looks like this was an “injection” scenario — one language embedded in another — so I'm curious to know which language might have the bug here.

@jboilesen
Copy link
Author

jboilesen commented Jul 24, 2024

It happened in a pure .php file with only PHP code (but the project also has HTML, CSS and JS files).

@savetheclocktower
Copy link
Contributor

Strangely, that counts because of the way that the PHP grammar is architected.

I see the bug here (assuming something that may return null is an array without checking it), but I don't yet understand why it happens. Still, I should at least make it so that it doesn't throw an exception.

I'm glad that it's sporadic instead of something that happens all the time. Still, if you figure out reliable reproduction steps, please let me know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants