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

Undefined Offset: 0 #695

Open
MikuAuahDark opened this issue Dec 23, 2018 · 2 comments · May be fixed by #750
Open

Undefined Offset: 0 #695

MikuAuahDark opened this issue Dec 23, 2018 · 2 comments · May be fixed by #750

Comments

@MikuAuahDark
Copy link

Hello, I just installed your PHP Intellisense extension, but I'm getting this error.

Error

DEBUG     Checking PHPLS_ALLOW_XDEBUG

DEBUG     The xdebug extension is not loaded

[Info  - 12:26:17 PM] 1 files total
[Info  - 12:26:17 PM] Indexing project for definitions and static references
Parsing file:///d:/Data/Dev/DevWeb/live2love/audio/download.php
[Error - 12:26:17 PM] Error parsing file:///d:/Data/Dev/DevWeb/live2love/audio/download.php: ErrorException: Undefined offset: 0 in C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\src\Index\Index.php:426
Stack trace:
#0 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\src\Index\Index.php(426): {closure}(8, 'Undefined offse...', 'C:\\Users\\MikuAu...', 426, Array)
#1 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\src\Index\Index.php(435): LanguageServer\Index\Index->removeIndexedDefinition(0, Array, Array, Array)
#2 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\src\Index\Index.php(435): LanguageServer\Index\Index->removeIndexedDefinition(0, Array, Array, Array)
#3 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\src\Index\Index.php(439): LanguageServer\Index\Index->removeIndexedDefinition(1, Array, Array, Array)
#4 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\src\Index\Index.php(190): LanguageServer\Index\Index->removeIndexedDefinition(0, Array, Array, Array)
#5 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\src\PhpDocument.php(132): LanguageServer\Index\Index->removeDefinition('TEST')
#6 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\src\PhpDocumentLoader.php(118): LanguageServer\PhpDocument->updateContent('<?php\r\nconst TE...')
#7 [internal function]: LanguageServer\PhpDocumentLoader->LanguageServer\{closure}()
#8 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\sabre\event\lib\coroutine.php(70): Generator->send('<?php\r\nconst TE...')
#9 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\sabre\event\lib\Promise.php(242): Sabre\Event\{closure}('<?php\r\nconst TE...')
#10 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\sabre\event\lib\Loop\Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#11 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\sabre\event\lib\Loop\Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#12 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\sabre\event\lib\Loop\Loop.php(194): Sabre\Event\Loop\Loop->tick(true)
#13 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\sabre\event\lib\Loop\functions.php(122): Sabre\Event\Loop\Loop->run()
#14 C:\Users\MikuAuahDark\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\bin\php-language-server.php(55): Sabre\Event\Loop\run()
#15 {main}
[Info  - 12:26:17 PM] Indexing project for dynamic references
[Info  - 12:26:17 PM] 0 Packages
[Info  - 12:26:17 PM] All 1 PHP files parsed in 0 seconds. 146 MiB allocated.

I read that php.suggest.basic should be set to false, but then I lost all function suggestions.

Reproduction

<?php
const TEST = 'http://example.com';
<?php
function test(): string
{
	return 'hello';
}

Yes, no matching ?>, that's intended.

php -v

PHP 7.2.13 (cli) (built: Dec  5 2018 07:19:53) ( NTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
@felixfbecker
Copy link
Owner

Which of these files in download.php?

@MikuAuahDark
Copy link
Author

MikuAuahDark commented Dec 23, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants