nlipiarski / MCC

Marshal Command Code Syntax Highlighter
GNU General Public License v3.0
14 stars 2 forks source link

Bad highlighting #64

Closed Daminator4113 closed 5 years ago

Daminator4113 commented 5 years ago
  1. Hi, the problem is that some commands are highlighted like is bad, but they are correct.

  2. image

  3. summon armor_stand ~ ~ ~ {ArmorItems:[{},{},{},{id:"minecraft:iron_helmet",Count:1b}]} summon armor_stand ~ ~ ~ {ArmorItems:[{},{},{},{}]} summon armor_stand ~ ~ ~ {Tags:["Something"]} give @p stone{display:{Name:"{\"text\":\"123\"}"}} give @p stone{display:{Lore:["123"]}} tellraw @a {"text":"123","bold":true} tellraw @a {"text":"123","bold":"true"} advancement revoke @a only customs:noteblock/trigger/place_noteblock setblock ~ ~ ~ minecraft:note_block[powered=false] datapack disable "file/MyDatapack"

Daminator4113 commented 5 years ago

I'm sorry, I don't know how to mark an issue as bug or something else ^^'

nlipiarski commented 5 years ago

For me, the fourth and fifth lines are highlighting correctly. Are you sure you are on the newest version? The other ones are still highlighting incorrectly, so I will look at those. You can upgrade packages by hitting ctrl + shift + p and then searching for upgrade package.

Daminator4113 commented 5 years ago

Thank you for responding, then yes I am on the last version of the package and the commands are in 1.13.2 The 4th and 5th lines are correct and should not be highlighted. image

give @p stone{display:{Name:"Hello"}} give @p stone{display:{Name:"\"Hello\""}} give @p stone{display:{Name:"{\"text\":\"Hello\"}"}} give @p stone{display:{Lore:["Hello"]}}

nlipiarski commented 5 years ago

Technically that first command is still valid and so is correctly highlighted even though it doesn't really do what is expected. Also, on my install, all four of those are highlighted correctly Correctly Highlighted Commands Screenshot

Can you run the "list packages" command from the command pallete (ctr + shift + p) and tell me which version of MCC it says is installed?

Daminator4113 commented 5 years ago

image

nlipiarski commented 5 years ago

It appears you have a manually installed version as well as the version installed from package control. If you remove the manually installed one that should fix some of the issues and I am currently working on fixing the rest.

nlipiarski commented 5 years ago

I just put out a release that fixes the highlighting issues. To delete the manual install, you should go to Preferences->Browse Packages and then delete the MCC folder in there. That should fix the rest of your problems.

Daminator4113 commented 5 years ago

This doesn't work, I have tried to remove the package and reinstall it (When I install the package, I use package control), or delete only MCC folder, etc... But nothing work :/

If I delete the MCC folder, it happening this : image

And if I change the color scheme, it recreated an MCC folder, and go back to this : image

I don't know why it doesn't work with me, maybe I do something wrong ?

nlipiarski commented 5 years ago

I'm not entirely sure what's wrong. I thought you had MCC installed locally but I forgot the plugin generates files in there as well. Can you try running upgrade packages again and see if that fixes it?

Daminator4113 commented 5 years ago

always not image image

Daminator4113 commented 5 years ago

I think I have found the problem, but I don't understand why it's happening, I have tried to create an other files with same commands, to see what's happening, and it work! But the old files stil doesn't work, whatever I'm doing

image

nlipiarski commented 5 years ago

Is this the entirety of the file? Does it work if you directly copy paste this file into another one?

Daminator4113 commented 5 years ago

I understand nothing, in my file there are normally other commands before, and I only copied the lines for the examples (give commands). All alone these lines are not highlighted, but with the rest of the file, they are again.

Even worse, if I open the file "uncorrupted" alone, the lines are not highlighted. But if I open the file "corrupted", and the uncorrupted file is open, the lines will be highlighted in the two files

Daminator4113 commented 5 years ago

I think I have found the problem, there is only one command who "corrupts" the files.

nlipiarski commented 5 years ago

Which command?

Daminator4113 commented 5 years ago

She's big, I'll going to try to find what nbt tag do all of that.

nlipiarski commented 5 years ago

If you have problems finding the problem, send me the whole thing. I can look through it myself.

Daminator4113 commented 5 years ago

Ok, here is the command : give @p written_book{pages:["{\"text\":\"TEST\"}"]}

Daminator4113 commented 5 years ago

While you're there, I think I've found another bug, should I create a new issue ?

nlipiarski commented 5 years ago

Yes

Daminator4113 commented 5 years ago

I found new commands who doesn't work correctly :

dominicsherry1 commented 5 years ago
* `give @a bow{Enchantments:[{lvl:1s,id:"minecraft:infinity"}]}`

I notice an issue with a similar command as well. The problem seems to be that the syntax highlighting doesn't know what to do with the s in lvl:1s. For reference, the command I am having trouble with is execute as @s[nbt={SelectedItem:{tag:{Enchantments:[{id: "minecraft:fortune", lvl: 1s}]}}}] if block ~ ~ ~ minecraft:nether_quartz_ore if score rng rand matches ..66 run summon minecraft:item ~ ~ ~ {Item:{id: "minecraft:quartz", Count: 1b}}

Edit: The syntax highlighter doesn't know what to do with a b either as shown here

* `execute as @a[nbt={SelectedItem:{id:"minecraft:redstone_torch",tag:{Record:1b}}}] run say ...`
nlipiarski commented 5 years ago

Sorry for the long delay on this one, but I have been pretty busy the past month or so. These are now fixed in the newest release.