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

blade lsp is not activating #7

Open
MarcosIgnacioo opened this issue Dec 12, 2023 · 8 comments
Open

blade lsp is not activating #7

MarcosIgnacioo opened this issue Dec 12, 2023 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@MarcosIgnacioo
Copy link

hellooo sorry to bother big fan of ryour nvim config but i got a problem with the blade lsp which for some reason is not working idk if is the intelisense because for normal php works perfectly, i have installed laravel, php, composer and everything i think i need to run it, i open it even using sudo but the lsp doesnt activate for some reason hope you can help me cause this config is really cool ;D

@kauffinger kauffinger self-assigned this Dec 13, 2023
@kauffinger
Copy link
Owner

Sometimes, when i use s after starting nvim, this happens for me, too.
If that is not the case, you could try adding blade to your nvim-lpsconfig:
See here for the config spec and here for the file that needs to be adjusted.

Let me know if that works for you / open a pr if it does :)

@kauffinger
Copy link
Owner

Just tried and realised it is broken for me, too. My suggested fix did not help yet, I'll look into it.

@kauffinger
Copy link
Owner

Found the issue, it seems that blade as a language causes this, as for some reason, the LSP fails with it now:
[WARN][2023-12-13 07:51:50] ...lsp/handlers.lua:537 "textDocument/didOpen ignored. file:///Users/.../resources/views/pages/links/index.blade.php has unsupported language ID blade."

The fix is to just remove blade as an additional language, so nvim sees it as php. I have no idea why. It might be due to the upcoming release of blade support, thanks to treesitter-blade.

I'll see if removing it has any consequences I am not aware of and push the new version asap. Thanks for noticing!

kauffinger added a commit that referenced this issue Dec 13, 2023
- i do not think this is the correct solution, but it works (it's really ugly)
- we are tricking intelephense into thinking it's started in php and then switch to blade with autocommands
@kauffinger
Copy link
Owner

Hi there, I tried to just use nvim-lspconfig to get it to work, but it didn't. We now have two hacky autocommands that trick intelephense into thinking it's in php, then switch back to blade. This way everything works.

If anyone knows if this can be done cleaner, please comment / push a pr!

Anyways, should work now @MarcosIgnacioo

@kauffinger kauffinger added the help wanted Extra attention is needed label Dec 13, 2023
@kauffinger kauffinger removed their assignment Dec 13, 2023
@MarcosIgnacioo
Copy link
Author

THANK UUUU LOV U BESTIEEEEEE ALSO SO DAM GOOD CONFIGMANNNNNN

@gmnz
Copy link

gmnz commented Sep 8, 2024

Hi, just curious, what is intelephense able to help me with after these autocmds were added? I don't see any completion suggestions or anything else from intelepehnse in blade files, so what should I see? Maybe there's some conflict with my config, but I can't find it if I don't know what exactly doesn't work.

@kauffinger
Copy link
Owner

@gmnz could be that things have changed again, this command enables intelephense to be used in blade files but still using the blade language mode.

Unfortunately I am not able to speedily debug, so you will have to be patient or try yourself.

@gmnz
Copy link

gmnz commented Sep 10, 2024

I've tried a few things but nothing worked so I guess I'll just be patient. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants