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

Extension adds spurious "macros.inspect" command #60

Open
lilyball opened this issue May 10, 2021 · 0 comments
Open

Extension adds spurious "macros.inspect" command #60

lilyball opened this issue May 10, 2021 · 0 comments

Comments

@lilyball
Copy link

After installing this extension and defining one macro, my keybindings list shows that one macro, but it also shows a second macro called macros.inspect. Invoking this just logs a JavaScript error.

Upon inspection, it appears that the vscode.WorkspaceConfiguration object returned from vscode.workspace.getConfiguration() includes this extra inspect key, and experimentally it appears that inspect is an undocumented key that can be used to get information about settings in this configuration (in particular, it appears to let you extract default vs global vs workspace settings).

In any case, right now the code just hardcodes several keys to ignore

macros/extension.js

Lines 23 to 25 in 96b0d7b

const macros = Object.keys(settings).filter((prop) => {
return prop !== 'has' && prop !== 'get' && prop !== 'update';
});

and really what it should do is skip the hardcoding and just invoke settings.get(name) for each key, as that appears to handle this for you. This will also fix the bug where a macro named "get" will just be silently ignored, as settings.get(name) does the right thing even if the name is one of the functions (such as "get" or "inspect").

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

No branches or pull requests

1 participant