Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Use UUIDs for commands #629

Merged
merged 9 commits into from
Jun 14, 2018
Merged

Use UUIDs for commands #629

merged 9 commits into from
Jun 14, 2018

Conversation

lukel97
Copy link
Collaborator

@lukel97 lukel97 commented Jun 13, 2018

Currently when starting multiple instances of HIE for the same client, it an errors due to registering the same commands multiple times in the initialise response that we send. This happens when creating a multi-root/project workspace in VS Code.

This was discussed here and the suggested solution was to use UUIDs to register commands.
This PR changes the server to register random UUIDs, and maps back and forth between them in code action and execute command requests. You can still send an execute request for "hare:demote" as well as the new random UUID for it, and have the same command executed.

let commands = ["hare:demote", "applyrefact:applyOne"]
uuids :: [UUID]
uuids = randoms gen
return $ BM.fromList (zip commands uuids)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be good to include the original command too, so if the UUID is abcdef, then use a command string of hare:demote:abcdef.

It will make interpreting logs etc much easier.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then we only need one UUID per session too, come to think of it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants