Closed Leuloch closed 8 years ago
[Enter steps to reproduce below:]
Atom Version: 1.1.0 System: Linux Mint Thrown From: atom-autocomplete-php package, v0.18.1
Uncaught TypeError: className.split is not a function
At /home/justice/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:98
TypeError: className.split is not a function
at Object.module.exports.getFullClassName (/home/justice/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:98:48)
at Object.module.exports.getVariableType (/home/justice/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:614:37)
at Object.module.exports.parseElements (/home/justice/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:711:34)
at Object.module.exports.getCalledClass (/home/justice/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:30:17)
at Object.module.exports.getMemberContext (/home/justice/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:661:28)
at PropertyProvider.module.exports.PropertyProvider.getTooltipForWord (/home/justice/.atom/packages/atom-autocomplete-php/lib/tooltip/property-provider.coffee:17:25)
at PropertyProvider.module.exports.AbstractProvider.showPopoverFor (/home/justice/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:109:24)
at HTMLSpanElement.<anonymous> (/home/justice/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:78:22)
at HTMLDivElement.jQuery.event.dispatch (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
at HTMLDivElement.elemData.handle (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)
10x -3:50.2.0 atom-beautify:beautify-editor (atom-text-editor.editor.is-focused)
-3:43.9.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
-3:42.3.0 atom-beautify:beautify-editor (atom-text-editor.editor.is-focused)
-3:39.5.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
-3:37.1.0 atom-beautify:beautify-editor (atom-text-editor.editor.is-focused)
-3:29.6.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
3x -3:17.1.0 core:backspace (atom-text-editor.editor.mini.is-focused)
-2:36.5.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
-2:34.7.0 atom-beautify:beautify-editor (atom-text-editor.editor.is-focused)
-2:29.8.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
2x -2:28 atom-beautify:beautify-editor (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
-0:37.4.0 key-binding-resolver:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
-0:11.6.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
{
"core": {
"disabledPackages": [
"language-vue-component"
],
"excludeVcsIgnoredPaths": false
}
}
# User
atom-autocomplete-php, v0.18.1
atom-beautify, v0.28.16
color-picker, v2.0.13
emmet, v2.3.14
file-icons, v1.6.11
language-babel, v2.0.2
language-blade, v0.16.0
language-nginx, v0.6.1
language-vue, v0.4.0
linter, v1.10.0
linter-jshint, v1.2.1
linter-jsonlint, v1.0.1
linter-php, v1.1.0
pigments, v0.18.1
synced-sidebar, v0.4.2
# Dev
No dev packages
[Enter steps to reproduce below:]
Atom Version: 1.1.0 System: Microsoft Windows 10 Home Thrown From: atom-autocomplete-php package, v0.18.1
Uncaught TypeError: className.split is not a function
At /C:/Users/ahmed/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:98
TypeError: className.split is not a function
at Object.module.exports.getFullClassName (C:\Users\ahmed\.atom\packages\atom-autocomplete-php\lib\services\php-file-parser.coffee:98:48)
at Object.module.exports.getVariableType (C:\Users\ahmed\.atom\packages\atom-autocomplete-php\lib\services\php-file-parser.coffee:614:37)
at Object.module.exports.parseElements (C:\Users\ahmed\.atom\packages\atom-autocomplete-php\lib\services\php-file-parser.coffee:711:34)
at Object.module.exports.getCalledClass (C:\Users\ahmed\.atom\packages\atom-autocomplete-php\lib\services\php-file-parser.coffee:30:17)
at Object.module.exports.getMemberContext (C:\Users\ahmed\.atom\packages\atom-autocomplete-php\lib\services\php-file-parser.coffee:661:28)
at FunctionProvider.module.exports.FunctionProvider.getTooltipForWord (C:\Users\ahmed\.atom\packages\atom-autocomplete-php\lib\tooltip\function-provider.coffee:18:25)
at FunctionProvider.module.exports.AbstractProvider.showPopoverFor (C:\Users\ahmed\.atom\packages\atom-autocomplete-php\lib\tooltip\abstract-provider.coffee:109:24)
at HTMLSpanElement.<anonymous> (C:\Users\ahmed\.atom\packages\atom-autocomplete-php\lib\tooltip\abstract-provider.coffee:78:22)
at HTMLDivElement.jQuery.event.dispatch (C:\Users\ahmed\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\jquery\dist\jquery.js:4435:9)
at HTMLDivElement.elemData.handle (C:\Users\ahmed\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\jquery\dist\jquery.js:4121:28)
-9:56.4.0 editor:newline (atom-text-editor.editor.is-focused)
-9:52.7.0 core:undo (atom-text-editor.editor.is-focused)
3x -9:52.3.0 core:save (atom-text-editor.editor.is-focused)
-6:49.3.0 editor:newline (atom-text-editor.editor.is-focused)
-6:46.6.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
-6:46.6.0 snippets:expand (atom-text-editor.editor.is-focused.autocomplete-active)
12x -6:36.3.0 autocomplete-plus:activate (atom-text-editor.editor.is-focused)
-3:52.1.0 core:save (atom-text-editor.editor.is-focused)
-3:47.7.0 editor:newline (atom-text-editor.editor.is-focused)
-3:43.7.0 core:cut (atom-text-editor.editor.is-focused)
-3:42.7.0 core:paste (atom-text-editor.editor.is-focused)
2x -3:39.8.0 editor:newline (atom-text-editor.editor.is-focused)
-0:05.5.0 core:save (atom-text-editor.editor.is-focused)
{
"core": {
"themes": [
"atom-material-ui",
"atom-material-syntax"
],
"disabledPackages": [
"highlight-column"
]
},
"atom-autocomplete-php": {
"binComposer": "C:/ProgramData/ComposerSetup/bin/composer.bat"
}
}
# User
atom-autocomplete-php, v0.18.1
atom-beautify, v0.28.16
atom-material-syntax, v0.2.4
atom-material-ui, v0.7.1
autocomplete-php, v0.3.7
color-picker, v2.0.13
file-icons, v1.6.11
highlight-selected, v0.10.1
javascript-snippets, v1.0.0
linter, v1.10.0
linter-jshint, v1.2.1
linter-phpcs, v1.3.0
minimap, v4.16.0
minimap-highlight-selected, v4.3.1
pigments, v0.18.1
Sublime-Style-Column-Selection, v1.3.0
# Dev
No dev packages
am getting this issue while developing laravel
if i do
public function handle($request, Closure $next)
{
$request->*[get the error here]*
}
but if i do
public function handle(Request $request, Closure $next)
{
$request->*[no error here]*
}
its namespacing / type hinting issue
Oh thank you for this help. I'll try to reproduce it.
you welcome :)
(not related but it will be great if it can read Laravel's app.config and link the shortened namespaces)
I don't really know Laravel framework, that's hard for me to do something to support it. If you have any documentation about what you want, it will be nice :+1:
sure :smiley:
Docs: http://laravel.com/docs/5.1 Code API: http://laravel.com/api/5.1
IDE healper (by community): https://github.com/barryvdh/laravel-ide-helper
it would be great if there is an easy way to implement this with this autocomplete package
I need the special features in laravel that is not supported. I guess that "standard" autocomplete is working, but what is not ? (For example, on symfony2, there's service injection that is not "standard" autocomplete)
ok lets not hijack this issue, will do a little research / test and start an issue later... but the most obvious is this https://github.com/laravel/laravel/blob/master/config/app.php#L161
this is how it loads/name hints the namespace
I Have the same issue in Symfony, when I hover method of a non typed variable.
Class starts as public function sendRequest(&$test)
Think you can recognize this ;-)
Same issue:
Atom Version: 1.0.19 System: Ubuntu 15.10 Thrown From: atom-autocomplete-php package, v0.18.1
Uncaught TypeError: className.split is not a function
At /home/andrew/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:98
TypeError: className.split is not a function
at Object.module.exports.getFullClassName (/home/andrew/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:98:48)
at Object.module.exports.getVariableType (/home/andrew/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:614:37)
at Object.module.exports.parseElements (/home/andrew/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:711:34)
at Object.module.exports.getCalledClass (/home/andrew/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:30:17)
at Object.module.exports.getMemberContext (/home/andrew/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:661:28)
at FunctionProvider.module.exports.FunctionProvider.getTooltipForWord (/home/andrew/.atom/packages/atom-autocomplete-php/lib/tooltip/function-provider.coffee:18:25)
at FunctionProvider.module.exports.AbstractProvider.showPopoverFor (/home/andrew/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:109:24)
at HTMLSpanElement.<anonymous> (/home/andrew/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:78:22)
at HTMLDivElement.jQuery.event.dispatch (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
at HTMLDivElement.elemData.handle (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)
-1:52.7.0 core:paste (atom-text-editor.editor.is-focused)
2x -1:48.8.0 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
-1:17.7.0 core:copy (atom-text-editor.editor.is-focused)
2x -1:11.6.0 core:paste (atom-text-editor.editor.is-focused)
-1:06.3.0 core:save (atom-text-editor.editor.is-focused)
5x -0:39.2.0 core:undo (atom-text-editor.editor.is-focused)
-0:36.1.0 core:save (atom-text-editor.editor.is-focused)
2x -0:32.3.0 core:undo (atom-text-editor.editor.is-focused)
3x -0:30.4.0 core:save (atom-text-editor.editor.is-focused)
-0:27.7.0 core:undo (atom-text-editor.editor.is-focused)
2x -0:21.9.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
-0:20.5.0 core:backspace (atom-text-editor.editor.is-focused)
-0:15.8.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused.autocomplete-active)
-0:15.2.0 core:copy (atom-text-editor.editor.is-focused)
-0:13.6.0 core:paste (atom-text-editor.editor.is-focused)
3x -0:11.6.0 core:save (atom-text-editor.editor.is-focused)
{
"core": {
"disabledPackages": [
"metrics"
],
"themes": [
"atom-material-ui",
"atom-material-syntax"
]
},
"atom-autocomplete-php": {}
}
# User
Sublime-Style-Column-Selection, v1.3.0
atom-alignment, v0.12.1
atom-autocomplete-php, v0.18.1
atom-beautify, v0.28.19
atom-material-syntax, v0.2.6
atom-material-ui, v0.8.0
auto-detect-indentation, v0.4.2
autoclose-html, v0.19.0
bottom-dock, v0.3.5
css-snippets, v0.9.0
docblockr, v0.7.3
emmet, v2.3.15
file-icons, v1.6.13
gulp-manager, v0.2.17
highlight-line, v0.11.0
highlight-selected, v0.11.1
language-blade, v0.16.0
laravel, v0.7.0
linter, v1.11.3
linter-bootlint, v0.0.6
linter-csslint, v1.1.0
linter-javac, v1.3.0
linter-manager, v0.2.6
linter-markdown, v1.2.1
linter-pep257, v0.3.1
linter-pep8, v1.0.1
linter-php, v1.1.6
linter-scss-lint, v2.4.0
linter-shellcheck, v1.0.2
pigments, v0.19.1
project-manager, v2.6.5
save-session, v0.15.7
# Dev
No dev packages
Same issue
Atom Version: 1.3.2 System: Mac OS X 10.11 Thrown From: atom-autocomplete-php package, v0.18.4
Uncaught TypeError: className.split is not a function
At /Volumes/Macintosh%20SSD/Applications/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:98
TypeError: className.split is not a function
at Object.module.exports.getFullClassName (/Volumes/Macintosh SSD/Applications/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:98:48)
at Object.module.exports.getVariableType (/Volumes/Macintosh SSD/Applications/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:614:37)
at Object.module.exports.parseElements (/Volumes/Macintosh SSD/Applications/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:711:34)
at Object.module.exports.getCalledClass (/Volumes/Macintosh SSD/Applications/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:30:17)
at Object.module.exports.getMemberContext (/Volumes/Macintosh SSD/Applications/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:661:28)
at PropertyProvider.module.exports.PropertyProvider.getTooltipForWord (/Volumes/Macintosh SSD/Applications/.atom/packages/atom-autocomplete-php/lib/tooltip/property-provider.coffee:17:25)
at PropertyProvider.module.exports.AbstractProvider.showPopoverFor (/Volumes/Macintosh SSD/Applications/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:109:24)
at HTMLSpanElement.<anonymous> (/Volumes/Macintosh SSD/Applications/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:78:22)
at HTMLDivElement.jQuery.event.dispatch (/Applications/.atom/packages/atom-autocomplete-php/node_modules/jquery/dist/jquery.js:4435:9)
at HTMLDivElement.elemData.handle (/Applications/.atom/packages/atom-autocomplete-php/node_modules/jquery/dist/jquery.js:4121:28)
2x -1:48.8.0 core:paste (atom-text-editor.editor.is-focused)
-1:43.7.0 core:move-down (atom-text-editor.editor.is-focused)
-1:39.8.0 core:save (atom-text-editor.editor.is-focused)
-1:39.2.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
-1:39.2.0 core:cancel (atom-text-editor.editor.is-focused)
-0:19.5.0 core:move-left (atom-text-editor.editor.is-focused)
-0:19.3.0 core:paste (atom-text-editor.editor.is-focused)
-0:18.9.0 core:move-down (atom-text-editor.editor.is-focused)
7x -0:18.9.0 core:move-left (atom-text-editor.editor.is-focused)
-0:17.9.0 core:paste (atom-text-editor.editor.is-focused)
-0:17.7.0 core:move-to-bottom (atom-text-editor.editor.is-focused)
5x -0:17.7.0 core:move-left (atom-text-editor.editor.is-focused)
2x -0:07.4.0 core:paste (atom-text-editor.editor.is-focused)
-0:04.1.0 core:select-left (atom-text-editor.editor.is-focused)
-0:03.8.0 core:copy (atom-text-editor.editor.is-focused)
3x -0:02.8.0 core:paste (atom-text-editor.editor.is-focused)
{
"core": {
"ignoredNames": [
".git",
".hg",
".snv",
".DS_Store",
"Thumbs.db",
"*.pyc"
],
"disabledPackages": [
"php-checkstyle",
"linter-jscs",
"linter-pylint"
],
"themes": [
"atom-material-ui",
"chester-atom-syntax"
]
},
"atom-autocomplete-php": {
"insertNewlinesForUseStatements": true
}
}
# User
atom-autocomplete-php, v0.18.4
atom-material-ui, v0.8.0
autocomplete-go, v0.1.1
autocomplete-paths, v1.0.2
autocomplete-python, v1.2.4
chester-atom-syntax, v0.1.1
color-picker, v2.0.14
docblockr, v0.7.3
emmet, v2.3.17
environment, v1.1.1
file-icons, v1.6.13
go-config, v0.3.1
highlight-line, v0.11.0
highlight-selected, v0.11.1
laravel, v0.7.0
linter, v1.11.3
linter-clang, v3.3.0
linter-csslint, v1.1.0
linter-php, v1.1.6
minimap, v4.19.0
minimap-find-and-replace, v4.4.0
minimap-git-diff, v4.1.8
minimap-highlight-selected, v4.3.1
minimap-selection, v4.3.1
omni-ruler, v0.4.2
wrap-guide, v0.38.1
# Dev
No dev packages
I started to get this error too often.
TypeError: className.split is not a function
at Object.module.exports.getFullClassName (/home/umpirsky/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:98:48)
at Object.module.exports.getVariableType (/home/umpirsky/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:614:37)
at Object.module.exports.parseElements (/home/umpirsky/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:711:34)
at Object.module.exports.getCalledClass (/home/umpirsky/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:30:17)
at Object.module.exports.getMemberContext (/home/umpirsky/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:661:28)
at FunctionProvider.module.exports.FunctionProvider.getTooltipForWord (/home/umpirsky/.atom/packages/atom-autocomplete-php/lib/tooltip/function-provider.coffee:18:25)
at FunctionProvider.module.exports.AbstractProvider.showPopoverFor (/home/umpirsky/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:109:24)
at HTMLSpanElement.<anonymous> (/home/umpirsky/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:78:22)
at HTMLDivElement.jQuery.event.dispatch (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
at HTMLDivElement.elemData.handle (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)
I'm still getting this error in Laravel projects, likely because of the non-typehinted requests @Ahmed-90 mentioned above.
@Peekmo This is happening constantly. For me, it seems to happen consistently with only method parameters. I added a console.log className
directly before line 98 (classNameParts = className.split('\\')
) and here is the console output:
Object {type: "ArrayAccess", description: null} Uncaught TypeError: className.split is not a function Object {type: "mixed", description: null} Uncaught TypeError: className.split is not a function
As @Ahmed-90 pointed out - it happens when the method has a Docblock which specifies a @param
type but the method parameter itself is un-typehinted.
Hopefully, this is enough information so that you may be able to fix this bug?
Could this be caused by the closures typically used in the often mentioned Laravel Middlewares? I started to get this error as soon as I changed the middleware to not return the result of the closure but to assign it to a variable.
$response = $next($request);
@elomatreb afaik its for some reason the argument is not typehinted in the middlewares in laravel it worked fine when you type hint it
another thing is laravel have the app config with short namespaces use Hash;
etc.. so logically this plugin wont pick it up
@Ahmed-90 You're right, sorry.
Of course the dynamically loaded namespaces can't be parsed, but since I manually typehint it using @param
, shouldn't it work aswell? This is weird.
@elomatreb the error is muted when i changed it from function handle($request, Closure $next)
to function handle(Request $request, Closure $next)
don't remember the @param tho
For the quick fix I would appreciate just preventing the error, even disabled plugin for that file is better then number of popups.
I really don't have any idea..
@Peekmo to reproduce this error just do fresh install of laravel and generate a middleware
playaround the $request and let the spam begin :tada:
Hello, could you please test the last release ?
Thank you, Peekmo
argh, i have this issue now : https://github.com/Peekmo/atom-autocomplete-php/issues/40 (atom or atom beta, latest versions)
It's still happening :(
@Ahmed-90 Maybe @Peekmo is not Laravel developer and don't know how to do it. Maybe it would be useful for other who want to debut to post sequence of commands to reproduce it, for example:
$ composer instal laravel
$ create midle...
$ atom
@umpirsky even tho its all in the docs but sure why not :+1:
// Create project
$ composer create-project --prefer-dist laravel/laravel testproject
// cd to the testproject folder
// Generate the middleware
$ php artisan make:middleware TestMiddleware
it middleware file will be generated in app\Http\Middleware\TestMiddleware.php
if you need any help or even a team viewer session just tell me we can get on slack, gitter, irc etc.. and arrange that
Thank you for the example.
I tried, and it works with the last version. If you didn't, after the plugin updating, restarts atom ?
@Peekmo Yep works like a charm :smiley:
Thanks
@Peekmo What verion of Atom and package?
Looks good to me.
Thank you very much! Impressively quick fix!
Confirmed, evertythings fine on a sf2 project too! u rock :) :+1:
[Enter steps to reproduce below:]
Atom Version: 1.0.19 System: Ubuntu 14.04.3 Thrown From: atom-autocomplete-php package, v0.18.1
Stack Trace
Uncaught TypeError: className.split is not a function
Commands
Config
Installed Packages