-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Getting errors on certain files after the new update #40
Comments
Hey @ZayRTun ! Thank you for the kind words Mmm can you comment out the 'php_only' stuff in ;((php_only) @injection.content
; (#set! injection.combined)
; (#set! injection.language php_only))
;((parameter) @injection.content
; (#set! injection.language php_only)) You know the file without any errors, is that also with the If that fixed the issue please do let me know and I will amend the stubs, to avoid confusion until #5 dependancy is fixed! 😊 |
Hi @EmranMR, thanks for the response I tried your suggestion by removing And yeah, both the screenshots above are using Another screenshot just for you reference, both files are almost the same |
@ZayRTun thats so strange😬 can you do me a favour and drop the entire code excerpt from the file that is not working? so that I can copy and paste, to run some tests using the After that I could tell you for certain if it's the neovim, or it's config acting up or the parser, |
@EmranMR sure, here are some that has the error <!DOCTYPE html>
<html class="h-full bg-gray-100" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Fonts -->
{{-- <link rel="stylesheet" href="https://fonts.bunny.net/css2?family=Nunito:wght@400;600;700&display=swap"> --}}
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
<script src="{{ mix('js/app.js') }}" defer></script>
</head>
<body class="h-full font-sans">
<div>
{{ $slot }}
</div>
</body>
</html> <nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
<!-- Primary Navigation Menu -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex">
<!-- Navigation Links -->
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
{{ __('Dashboard') }}
</x-nav-link>
</div>
</div>
<!-- Settings Dropdown -->
<div class="hidden sm:flex sm:items-center sm:ml-6">
<x-dropdown align="right" width="48">
<x-slot name="trigger">
<button
class="flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out">
<div>{{ Auth::user()->name }}</div>
<div class="ml-1">
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path fill-rule="evenodd"
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
clip-rule="evenodd" />
</svg>
</div>
</button>
</x-slot>
<x-slot name="content">
<!-- Authentication -->
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-dropdown-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
{{ __('Log Out') }}
</x-dropdown-link>
</form>
</x-slot>
</x-dropdown>
</div>
<!-- Hamburger -->
<div class="-mr-2 flex items-center sm:hidden">
<button @click="open = ! open"
class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path :class="{ 'hidden': open, 'inline-flex': !open }" class="inline-flex" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
<path :class="{ 'hidden': !open, 'inline-flex': open }" class="hidden" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
</div>
<!-- Responsive Navigation Menu -->
<div :class="{ 'block': open, 'hidden': !open }" class="hidden sm:hidden">
<div class="pt-2 pb-3 space-y-1">
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
{{ __('Dashboard') }}
</x-responsive-nav-link>
</div>
<!-- Responsive Settings Options -->
<div class="pt-4 pb-1 border-t border-gray-200">
<div class="px-4">
<div class="font-medium text-base text-gray-800">{{ Auth::user()->name }}</div>
<div class="font-medium text-sm text-gray-500">{{ Auth::user()->email }}</div>
</div>
<div class="mt-3 space-y-1">
<!-- Authentication -->
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-responsive-nav-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
{{ __('Log Out') }}
</x-responsive-nav-link>
</form>
</div>
</div>
</div>
</nav> |
Hey @ZayRTun thanks for that, Ok so I ran some tests, found a few bugs but unrelated to your problem I think (#41 & #42) haha. The ; File ONE
(blade [0, 0] - [31, 0]
(text [0, 0] - [3, 10])
(php_statement [3, 10] - [3, 57]
(bracket_start [3, 10] - [3, 12])
(php_only [3, 13] - [3, 54])
(bracket_end [3, 55] - [3, 57]))
(text [3, 57] - [11, 41])
(php_statement [11, 41] - [11, 59]
(bracket_start [11, 41] - [11, 43])
(php_only [11, 44] - [11, 56])
(bracket_end [11, 57] - [11, 59]))
(text [11, 59] - [13, 15])
(php_statement [13, 15] - [13, 50]
(bracket_start [13, 15] - [13, 17])
(php_only [13, 18] - [13, 47])
(bracket_end [13, 48] - [13, 50]))
(text [13, 50] - [23, 20]
(comment [16, 8] - [21, 12]
(text [17, 8] - [21, 8])))
(php_statement [23, 20] - [23, 44]
(bracket_start [23, 20] - [23, 22])
(php_only [23, 23] - [23, 41])
(bracket_end [23, 42] - [23, 44]))
(text [23, 44] - [24, 21])
(php_statement [24, 21] - [24, 43]
(bracket_start [24, 21] - [24, 23])
(php_only [24, 24] - [24, 40])
(bracket_end [24, 41] - [24, 43]))
(text [24, 43] - [28, 13])
(php_statement [28, 13] - [28, 24]
(bracket_start [28, 13] - [28, 15])
(php_only [28, 16] - [28, 22])
(bracket_end [28, 22] - [28, 24]))
(php_statement [28, 25] - [28, 41]
(bracket_start [28, 25] - [28, 27])
(php_only [28, 27] - [28, 39])
(bracket_end [28, 39] - [28, 41]))
(text [28, 41] - [31, 0])) ; File TWO
(blade [0, 0] - [142, 0]
(text [0, 0] - [16, 24])
(php_statement [16, 24] - [16, 45]
(bracket_start [16, 24] - [16, 26])
(php_only [16, 27] - [16, 42])
(bracket_end [16, 43] - [16, 45]))
(text [17, 20] - [28, 33])
(php_statement [28, 33] - [28, 57]
(bracket_start [28, 33] - [28, 35])
(php_only [28, 36] - [28, 55])
(bracket_end [28, 55] - [28, 57]))
(text [28, 57] - [50, 36])
(php_statement [50, 36] - [50, 57]
(bracket_start [50, 36] - [50, 38])
(php_only [50, 39] - [50, 54])
(bracket_end [50, 55] - [50, 57]))
(text [50, 57] - [52, 28])
(keyword [52, 28] - [52, 33]
(directive [52, 28] - [52, 33]))
(text [54, 28] - [59, 32])
(php_statement [59, 32] - [59, 51]
(bracket_start [59, 32] - [59, 34])
(php_only [59, 35] - [59, 48])
(bracket_end [59, 49] - [59, 51]))
(text [60, 28] - [110, 16])
(php_statement [110, 16] - [110, 37]
(bracket_start [110, 16] - [110, 18])
(php_only [110, 19] - [110, 34])
(bracket_end [110, 35] - [110, 37]))
(text [111, 12] - [118, 20])
(php_statement [118, 20] - [118, 44]
(bracket_start [118, 20] - [118, 22])
(php_only [118, 23] - [118, 42])
(bracket_end [118, 42] - [118, 44]))
(text [119, 16] - [121, 20])
(php_statement [121, 20] - [121, 45]
(bracket_start [121, 20] - [121, 22])
(php_only [121, 23] - [121, 43])
(bracket_end [121, 43] - [121, 45]))
(text [122, 16] - [127, 44])
(php_statement [127, 44] - [127, 65]
(bracket_start [127, 44] - [127, 46])
(php_only [127, 47] - [127, 62])
(bracket_end [127, 63] - [127, 65]))
(text [127, 65] - [128, 20])
(keyword [128, 20] - [128, 25]
(directive [128, 20] - [128, 25]))
(text [130, 20] - [135, 24])
(php_statement [135, 24] - [135, 43]
(bracket_start [135, 24] - [135, 26])
(php_only [135, 27] - [135, 40])
(bracket_end [135, 41] - [135, 43]))
(text [136, 20] - [142, 0])) Here is how they look in Nova, for the second file I had a close look and I could not find any issues, but the first file there is a tiny bug 🐞 Can you do me a favour and delete this line in the first file and see if it works? {{-- <link rel="stylesheet" href="https://fonts.bunny.net/css2?family=Nunito:wght@400;600;700&display=swap"> --}} |
@ZayRTun I just released Regardless keep me posted here! 👍 |
@EmranMR I just tested with |
@EmranMR I think i found a small little issue. Highlighting goes off after With the
|
@ZayRTun That does not seem to be an issue with Nova With Blade turned onNova with
|
Maybe the configuration picking |
@EmranMR I will look into this like you said, maybe there is something wrong with my lazyvim setup, I am not sure. But anyway thanks to you for all this, been using ur tree sitter the whole day without any issue. |
@ZayRTun definitely keep me posted here and do let us know if you managed to find the root of the problem! Would be interesting to know for future reference! |
@EmranMR I have been checking out treesitter query, and one thing I noticed is that the parser is detecting blade comment Oh, and btw I am using the latest v0.9.2 version. blade commentHTML comment |
Hey @ZayRTun , I think it is the neovim config for sure, as the commit #45 was tested on NeoVim, Nova and Prior to the Here is a screenshot from Nova, and the parse using the command line. All I can suspect is that something is wrong with the config. (blade [0, 0] - [1, 0]
(comment [0, 0] - [0, 43])) Can you send me the AST like above but for the following? <html>
@php
echo "test";
@endphp
{{-- <div>{{echo "test"}</div> --}}
</html> |
@EmranMR Below is what I am getting. It seems that it's being picked as comment in this blade file... Also when ever I insert a comment it always insert html comment <html>
@php
echo 'test';
@endphp
{{-- <div>{{echo "test"}</div> --}}
</html>
my
|
@ZayRTun Mmm that is so strange, so it is basically works when it wants. I I would just dump the config in the discussion below and reference back to this issue. I am sure someone more seasoned with NeoVim would be able to help out.
With regards to:
This is the same case with Nova #18 . So it might actually be a |
This is expected if you're using treesitter based commenting---the reason is that most of the time you're going to be in an html node instead of a blade node since most of the file is html |
I want to express my appreciation to Emran Ramezan and Yaegassy for this Treesitter parser for Laravel Blade. I've been enjoying it a lot, but since the latest update yesterday, I've encountered some errors. It seems to work well on certain Blade files, but on others, I'm facing issues.
I am using it with LazyVim. I am not sure whether it is due tree sitter update or some other plugin. I have also followed the upgrade guide to set up
injections.scm
file.Screenshot of the file where I get the error:
Screenshot of the file where there is no error:
Error message
The text was updated successfully, but these errors were encountered: