Comments (5)
It seems php parser used in this package can't parse syntax.
$ node
Welcome to Node.js v16.16.0.
Type ".help" for more information.
> const parser = require('php-parser')
undefined
> const target = `($value ?? null)?->someProperty;`;
undefined
> const eval = parser.parseEval(target)
Uncaught:
[SyntaxError: Parse Error : syntax error, unexpected '?->' (T_NULLSAFE_OBJECT_OPERATOR), expecting ';' on line 1
] {
lineNumber: 1,
fileName: 'eval',
columnNumber: 16
}
refs: glayzzle/php-parser#1003
If there is no other work around syntax, please use Blade Formatter > Format: No PHP Syntax Check
option.
It will suppress syntax error.
![image](https://private-user-images.githubusercontent.com/1641039/254969919-436a86b1-e9b1-44f7-b4b4-102f32b0c48f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwMzY0NTQsIm5iZiI6MTcxOTAzNjE1NCwicGF0aCI6Ii8xNjQxMDM5LzI1NDk2OTkxOS00MzZhODZiMS1lOWIxLTQ0ZjctYjRiNC0xMDJmMzJiMGM0OGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjJUMDYwMjM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjA2NTk0ZWYwOTg3ZWZlN2YwMWZkZGEzOTQ5YzY1MDdmYzI4YmNiY2E0ZWE3NzQ1YjEwZDZiOWFmMWRlYWFmNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.zgPHasIvdGGJJ7OA8tFol5nAku_xvJgj0orp7uJRlSU)
Configuration file: .bladeformatterrc.json
{
"noPhpSyntaxCheck": true
}
Or using ignore directive will suppress the error.
{{-- blade-formatter-disable --}}
<div>
{{ ($value ?: null)?->someProperty }}
</div>
{{-- blade-formatter-enable --}}
from vscode-blade-formatter.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
from vscode-blade-formatter.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
from vscode-blade-formatter.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
from vscode-blade-formatter.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
from vscode-blade-formatter.
Related Issues (20)
- [Formatting Bug]: @elsecan blade directive is ignored HOT 1
- [Formatting Bug]: not adjusting my text in text format HOT 1
- [Formatting Bug]: Added spaces around hypen even when string in quotes HOT 1
- [Formatting Bug]: HOT 2
- [Formatting Bug]: HOT 2
- [Formatting Bug]: Showing red color
- [Bug]: After the installation, blade files lose syntax highlight! HOT 5
- [Formatting Bug]: HOT 3
- [Formatting Bug]: Components params are broken after formatting - since v0.23 HOT 2
- [Formatting Bug]: Formatter broken php code inside @php @endphp blade tags HOT 1
- [Formatting Bug]: spaces contained in string are broken up when wrapping text. HOT 2
- [Formatting Bug]: The extension ignores, some properties of the main configuration file HOT 2
- [Feature]: Edge Template Support HOT 1
- [Formatting Bug]: Custom directive incorrectly indented HOT 1
- [Bug]: HTML syntax highlighting and html suggestions in .blade.php is gone when I install this extension HOT 4
- [Bug]: Problem with syntax HOT 1
- [Bug]: Extension doesn't work when installed onto a cPanel account HOT 1
- [Formatting Bug]: PHP new with variable name from associative array HOT 1
- [Formatting Bug]: Multiplying `values` attribute!
- [Feature]: Exclude path by default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-blade-formatter.