simoebenhida / laravel-intellisense

Laravel VScode extension
https://marketplace.visualstudio.com/items?itemName=mohamedbenhida.laravel-intellisense
MIT License
162 stars 5 forks source link

Unexpected End of JSON Input in Laravel Intellisense Extension #59

Open felixhaeberle opened 9 months ago

felixhaeberle commented 9 months ago

Description

Encountered a SyntaxError due to an unexpected end of JSON input within the Laravel Intellisense extension for Visual Studio Code. This error arises during the parsing process, potentially indicating an issue with malformed or incomplete JSON data being supplied to JSON.parse.

Error Details

Stack Trace

Potential Issue

The error suggests that JSON.parse is called with a string that does not form a valid JSON structure, possibly due to an incomplete or improperly formatted JSON data source.

Steps to Reproduce

  1. Use the Laravel Intellisense extension (version 0.2.0) in a project within VSCode on Windows.
  2. Trigger an action that involves parsing JSON data through the extension's ViewItemProvider.ts.
  3. The error occurs if the JSON data being parsed is incomplete or improperly formatted.

Expected Behavior

The Laravel Intellisense extension should correctly parse valid JSON input without throwing syntax errors, facilitating the expected intellisense features for Laravel projects.

Actual Behavior

The extension throws a syntax error during JSON parsing due to unexpected end of input, indicating an issue with the JSON data being processed.

Suggested Fix

Environment

Bildschirmfoto 2024-02-08 um 10 43 04
vet-hub commented 1 month ago

Windows - WSL:Ubuntu - Dev Container

Same mistake

ERR Unexpected end of JSON input: SyntaxError: Unexpected end of JSON input at JSON.parse () at v.syncModel (/home/sail/.vscode-server/extensions/mohamedbenhida.laravel-intellisense-0.2.0/dist/extension.js:1:129008) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async v.provideCompletionItems (/home/sail/.vscode-server/extensions/mohamedbenhida.laravel-intellisense-0.2.0/dist/extension.js:1:128573) at async me.provideCompletionItems (/vscode/vscode-server/bin/linux-x64/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:161:118589)