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

Color picker breaks when rpy file becomes invalid syntax and doesn't recover #364

Open
Konayachi opened this issue Jul 15, 2023 · 3 comments
Labels
bug Something isn't working t:semantic

Comments

@Konayachi
Copy link

Konayachi commented Jul 15, 2023

Extension version

2.2.2, 2.3.6

Issue description

When UI loads/reloads, extension works as expected.
If I modify the file such that the syntax becomes wrong, the extension breaks and the color pickers disappear (see video).
The only way to get them back is with a complete UI is reload.

renpy.plugin.colors.broken.mp4

I notice this also happens when I change to other longer files but I can't find how to reproduce it reliably.

Scope inspector screenshots

2023-07-16_02-00
2023-07-16_02-01
2023-07-16_02-01_1
2023-07-16_02-01_2
2023-07-16_02-02
2023-07-16_02-02_1

Code

define gui.selected_color = '#ffffff'
define gui.insensitive_color = '#8996be'
@Konayachi
Copy link
Author

Konayachi commented Jul 15, 2023

I found the logs. Unfortunately it has personal data so I'm unsure about sharing the whole file but I found this:

[Default] > Ren'Py extension deactivating

Is this expected to see in the log file when the issue in the video happens?

@brunoais
Copy link

I decided to take a look at this. When the color is temporarily invalid (while the user is typing or even changing using the picker) this appears in the console:

[error] SyntaxError: Invalid flags: dgm
	at _ (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/gruntfuggly.todo-tree-0.0.215-universal/dist/extension.js:114:74341)
	at Array.l (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/gruntfuggly.todo-tree-0.0.215-universal/dist/extension.js:114:3580)
	at Object.parse (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/gruntfuggly.todo-tree-0.0.215-universal/dist/extension.js:114:71938)
	at a.parse (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/gruntfuggly.todo-tree-0.0.215-universal/dist/extension.js:1:12591)
	at Object.parse (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/gruntfuggly.todo-tree-0.0.215-universal/dist/extension.js:114:415)
	at i (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/gruntfuggly.todo-tree-0.0.215-universal/dist/extension.js:52:165)
	at Array.get [as indices] (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/gruntfuggly.todo-tree-0.0.215-universal/dist/extension.js:52:2895)
	at g.applyCaptures (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:263709)
	at g.executeMatchPattern (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:268453)
	at g.applyScanResult (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:269292)
	at g.executePattern (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:269998)
	at g.tokenize (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:263109)
	at p.runTokenizer (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:259273)
	at p.tokenizeDocument (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:259022)
	at h (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:2185)
	at l (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:957)
	at /home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:4424
	at new Promise (<anonymous>)
	at Object.provideDocumentColors (/home/user/.var/app/com.vscodium.codium/data/codium/extensions/luquedaniel.languague-renpy-2.2.2-universal/dist/extension.js:2:4405)
	at Z.provideColors (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:70841)
	at /app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:90351
	at ve._withAdapter (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:76751)
	at ve.$provideDocumentColors (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:90327)
	at i._doInvokeHandler (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:13722)
	at i._invokeHandler (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:13404)
	at i._receiveRequest (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:12120)
	at i._receiveOneMessage (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:10873)
	at s.value (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:8936)
	at c._deliver (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2465)
	at c.fire (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2784)
	at g.fire (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:16738)
	at s.value (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:9484)
	at c._deliver (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2465)
	at c.fire (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2784)
	at g.fire (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:16738)
	at MessagePortMain.<anonymous> (/app/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:7561)
	at MessagePortMain.emit (node:events:513:28)
	at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)

I hope this helps getting this bug fixed

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Feb 20, 2024

Thanks for the stack trace, that might help me find the issue.

As for why this happened; the plugin crashes, causing it to shutdown until you restart visual studio and/or maybe if you open another renpy file

@duckdoom4 duckdoom4 added bug Something isn't working t:semantic and removed topic:syntax labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working t:semantic
Projects
None yet
Development

No branches or pull requests

3 participants