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

feat: extension commands #13

Merged
merged 8 commits into from
Mar 28, 2023
Merged

Conversation

devnote-dev
Copy link
Contributor

This PR adds two new commands: restart and disable (and renames the existing one to "lint"). This includes useful window messages with buttons to toggle the extension as a shorthand (see screenshots below). In the process of implementing this, a lot of code was rewritten and updated which should make the extension faster. Closes #12.

image
image
image

package.json Show resolved Hide resolved
src/ameba.ts Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
@veelenga
Copy link
Member

I tested locally, however, on a first run i always receive an exception in the console:

rejected promise not handled within 1 second: Error: Invalid arguments
extensionHostProcess.js:100
stack trace: Error: Invalid arguments
	at new n (/private/var/folders/rt/3thkvgpd4jd0gbr1q_j_f0r00000gn/T/AppTranslocation/14C812DB-71D2-4296-BEF4-89F8CD1D65EF/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:15017)
	at //vscode-crystal-ameba/out/ameba.js:65:39
	at Array.forEach (<anonymous>)
	at Ameba.<anonymous> (/Users/veelenga/Dev/repos/vscode-crystal-ameba/out/ameba.js:62:35)
	at Generator.next (<anonymous>)
	at //vscode-crystal-ameba/out/ameba.js:7:71
	at new Promise (<anonymous>)
	at __awaiter (//vscode-crystal-ameba/out/ameba.js:3:12)
	at //vscode-crystal-ameba/out/ameba.js:32:88
	at ChildProcess.exithandler (node:child_process:415:5)
	at ChildProcess.emit (node:events:526:28)
	at maybeClose (node:internal/child_process:1092:16)
	at Socket.<anonymous> (node:internal/child_process:451:11)
	at Socket.emit (node:events:526:28)
	at Pipe.<anonymous> (node:net:687:12)
	at Pipe.callbackTrampoline (node:internal/async_hooks:130:17)
extensionHostProcess.js:100

@devnote-dev
Copy link
Contributor Author

devnote-dev commented Mar 27, 2023

I didn't come across this error during testing, is this from loading a workspace/file or executing a command?

After investigating a bit, it seems to be caused by the display messages with options which return Thenable<string>: they apparently also need a rejection handler (so much for async-await 🙃). Not a big issue though, I can change them to use .then() instead.

@veelenga veelenga merged commit 115bb1c into crystal-ameba:master Mar 28, 2023
@veelenga
Copy link
Member

Thank you

@devnote-dev devnote-dev deleted the commands branch March 28, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extension restart and disable commands
2 participants