EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.74k stars 293 forks source link

False syntax error #345

Closed p-josue closed 4 years ago

p-josue commented 4 years ago

Environment(环境)

name version
IDEA version PS-193.6494.47
EmmyLua version 1.3.2.142-IDEA182
OS Windows 10

What are the steps to reproduce this issue?(重现步骤?)

Just write this code IsControlPressed(0, isRDR and INPUT_MP_TEXT_CHAT_ALL or 245)

What happens?(出现什么问题?)

Highlight work wrong, system warn a syntax error

What were you expecting to happen?(期望?)

I think is a correct code, this code isn't mine but doesn't go in error when I run it

Any logs, error output, etc?(有没有什么log, error输出?)

No errors

Any other comments?(其它说明)

This is an screenshoot https://imgur.com/pTo4jDl

adriweb commented 4 years ago

There is no mistake, backtick ` is not a valid symbol in Lua (except in a string), so it is a syntax error.

> print(`42`)
stdin:1: unexpected symbol near '`'
p-josue commented 4 years ago

Thanks for the answer, in my test it works, I don't know if this is the beta version of lua or something different. I will ask you, if you have time, to try this steps please: 1 Go to fivem and follow the steps to create a server (is lua based and really easy&fast to setup) https://docs.fivem.net/docs/server-manual/setting-up-a-server/ 2 In the step 4 you has to download server-data with some resources, the resource that has this character is in this path server-data /resources/[gameplay]/chat/cl.lua:199 3 This works without any problem if you start the server and you can try in server side to easy debug without buying the game

adriweb commented 4 years ago

They use a custom Lua interpreter that adds this as a feature specific to their purposes, as indicated here: https://cookbook.fivem.net/2019/06/23/lua-support-for-compile-time-jenkins-hashes/ and here https://docs.fivem.net/docs/scripting-manual/runtimes/lua/#relative-path-literals

p-josue commented 4 years ago

Really really sorry for making you losing time, thanks for the answer.

rizzdev commented 1 year ago

Can anything be done about this? It is effecting a lot of FiveM developers.