Git Product home page Git Product logo

vscode-api-playground's Introduction

API Playground

This repo comprises several subdirectories, each of which is a self-contained extension that demonstrates a particular API, repros a bug, answers a stackoverflow question, etc.

Each directory also contains a .vsix file that you can use to install the extension and try it out for yourself.

Extensions:

  • HelloWorld: The default extension generated by the vscode yeoman generator
  • SettingsCycler: An extension that provides commands to toggle or cycle through settings, such as diabling and enabling the minimap, switching between themes, etc. Marketplace
  • NewFileWithLanguageMode: An extension that provides commands to open new files with the language mode set. It allows opening files with the same language mode as the current file, or configuring keybindings to open files with any language mode. Marketplace / Stackoverflow
  • QuickPickDocumentPreview: An extension that demonstrates using a TextDocumentContentProvider to preview different license files while cycling through a QuickPick menu.
  • FocusActiveEditor: An extension that will collapse directories and focus the active editor when switching between editors. Stackoverflow
  • SymbolIcons: An extension that shows a list of all symbol types in vscode to demonstrate their icons. Github

vscode-api-playground's People

Contributors

hoovercj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-api-playground's Issues

[Settings cycler] IDEA / Question: H2 add a delay in a cycler/toggling to showing then hide again?

Hi!

The use case: I have statusbar (and almost everything else) hidden / toggled off.
I would like to check the statusbar, in some situations. So: Issue a command to display statusbar, and after a short delay, it hides itself again.

Two example situations, that differ somewhat:

  1. I simply want to see some information that is displayed in the statusbar, or possibly click on one of the elements (start a share session, or whatever)
  2. When executing some commands, they display results in the statusbar - ideally, I would like to define a command sequence using e g cycler that executes a command, shows the statusbar, waits for a bit (insert delay or callback in x secs), and then hides the statusbar again.

So, this is an idea / feature request for a timer/delay feature!

I can see a few options of how to express it/fit it in, but since I have little clue about the implementation, I will refrain from speculating... :-)

Thanks for a great extension!

How to tell which cycler mode I am currently in

Hi, thanks for cycler!

Sometimes I am in doubt as to which mode of a cycle is currently active. How can I solve this? For example, two solutions I could imagine are

  • make cycler display a symbol in the status bar corresponding to the current mode
  • make cycler print out a message on transitioning between modes, saying what the new mode is

[Settings Cycler] Option to display notification per keybind

Sometimes cycled settings dont have visual cues of them being changed e.g. trim on save.
In this cases I think a notification would be the perfect solution to send some feedback, e.g.:

image

I guess I would add another field to the settings, like "sendNotificationLevel" which could be "none", "info", "warn" etc.
None would be the default and send no notification.

Regards!

Forces output window to be open

I noticed this issue after examining the git output window, which opened in an editor.

image

After I was done examining it, I tried to close the editor window. It reopened immediately.

If I changed the selection of the output window, to tasks, for example, it would immediately open the tasks output in the editor view and any attempts to exit from the editor view would result in the editor view to reopen immediately.

[Settings Cycler] Option to only modify workspace settings

Hey! Thanks for the nice extensions :)

So there is overrideWorkspaceSettings to ensure settings are switched even when the workspace defines them.

Most cases I prefer to edit ONLY workspace settings instead of user ones, so I would love a new flag like setWorkspaceSettings to only edit the toggled setting for the workspace.

This way the user global config remains unchanged and only the workspace reflects toggled changes. Less diff for the settings sync when I only want to locally switch a setting (commonly temporally).

The extension basically already knows how to do it, but right now when overrideWorkspaceSettings is set it only writes to the local workspace settings when the settings key already exists. For this feature we would simply need it to emplace it anyway.

Regards!

[Settings Cycler] Nested settings are clobbered, and should be merged instead

[background info, as the issue was at first that it's not working, but then i figured it out. see below. join me on this small adventure]

I'm trying to cycle colorCustomizations, but it seemed to not be working. The setting is

    "workbench.colorCustomizations": {
        "editorIndentGuide.activeBackground": "#969896",
        "editorWarning.foreground": "#de935f40",
    },

and the cycling settings i've tried are

    "settings.cycle": [{
        "id": "warningSquiggles",
        "overrideWorkspaceSettings": true,
        "values": [{
            "workbench.colorCustomizations.editorWarning.foreground": "#de935f",
            "workbench.colorCustomizations.editorError.foreground": "#d13b2e",
        }, {
            "workbench.colorCustomizations.editorWarning.foreground": "#de935f20",
            "workbench.colorCustomizations.editorError.foreground": "#d13b2e20",
        }]
    }],

and (which worked!)

    "settings.cycle": [{
        "id": "warningSquiggles",
        "overrideWorkspaceSettings": true,
        "values": [{
            "workbench.colorCustomizations": {
                "editorWarning.foreground": "#de935f",
                "editorError.foreground": "#d13b2e"
            },
        }, {
            "workbench.colorCustomizations": {
                "editorWarning.foreground": "#de935f40",
                "editorError.foreground": "#d13b2e40"
            }
        }]
    }],

However, even though this works, if i were to have other colour customizations, they are clobbered and removed.

Thanks for the extension, it does the trick!

"NewFileWithLanguageMode" not working

The setting editor.newFile.withCurrentLanguageMode doesn't exist. I think you can't add new settings to existing keys, i.e. editor? You have to use one for your own extension specifically?

Support for running commands in "command palette".

Is there a way I can call the commands using the Command Palette? My use case is simple: I want to toggle the use of gitIgnore content to show / hide the file search results. Currently, I can call it via keyboard shortcut but It's more ideal for me to use the command palette.

    "settings.cycle": [
        {
            "id": "toggle_gitIgnore_search",
            "overrideWorkspaceSettings": false,
            "values": [
                {
                    "search.useIgnoreFiles": true,
                    "search.useParentIgnoreFiles": true,
                },
                {
                    "search.useIgnoreFiles": false,
                    "search.useParentIgnoreFiles": false,
                }
            ]
        }
    ],

If this feature is not present, can you share your thoughts? I'm thinking of contributing to enable this feature.

command not found

My sortOrder command was working flawlessly, but now the command is not recognized. I've attached an image of the sortOrder command. When I try to run the shortcut I get "command 'cyclerSortOrder' not found." This is the same error appears if Setting Cycler is not installed, so I am guessing that somehow Setting Cycler isn't seeing this command. Any suggestions for troubleshooting would help. Thanks!
image

Prevents Git Diff View

With this plugin installed, the file tree seems to 'steal' focus from VS Code's git diff view

Settings Cycler: console thrown errors (Buffer() is deprecated, Conflict in default settings,..)

(node:535601) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.(Use code --trace-deprecation ... to show where the warning was created)

Conflict in default settings: Ignoring settings.cycle.warnOnWorkspaceSettingsCollisions as settings.cycle is []

Conflict in default settings: Ignoring settings.cycle.logLevel as settings.cycle is []

Is it possible to cycle commands as well as settings?

I'm not clear what counts as "any javascript object" when passing arguments:

What I would like is to use settings cycler to set up a case changing key, which would cycle the selection through lower case, title case, and upper case. If you typed like me, you'd understand why.

But I don't think I can put an editor.action as one of the values to the arguments. Would this be possible?

Breaking intermittently with VS Code v1.27.2

My settings cycler setup worked for a while, but then fails to work after a while and after lots of tweaking I can't get it to work again this time.
The error displayed in a popup is "command 'settings.cycle.miniView' not found".
The "settings.cycle.logLevel": "log" option doesn't seem to produce any additional output.

keybindings.json:

[
    {
        "key": "ctrl+;",
        "command": "settings.cycle.miniView",
    }
]

settings.json User Settings:

{
  "settings.cycle":
  [
    {
      "id": "miniView",
      "overrideWorkspaceSettings": false,
      "values":
      [
        { // full dev mode
          "editor.minimap.enabled": true,
          "editor.folding": true,
          "editor.glyphMargin": true,
          "editor.lineNumbers": "on",
          "scm.diffDecorations": "all",
          "scm.diffDecorationsGutterWidth": 3,
          "workbench.activityBar.visible": true,
          "window.menuBarVisibility": "default",
          "workbench.statusBar.visible": true,
          "workbench.editor.showTabs": true,
        },
        { // compact mode
          "editor.minimap.enabled": false,
          "editor.folding": false,
          "editor.glyphMargin": false,
          "editor.lineNumbers": "off",
          "scm.diffDecorations": "none",
          "scm.diffDecorationsGutterWidth": 1,
          "workbench.activityBar.visible": false,
          "window.menuBarVisibility": "toggle",
          "workbench.statusBar.visible": false,
          "workbench.editor.showTabs": false,
        }
      ]
    }
  ],
}

[Settings Cycler] Feature idea: cycle workspace / folder settings

My use case is wanting to cycle the settings specifically in a single folder, specifically the hidden files setting, like

{
  "files.exclude": {
    "src/**/*.d.ts": true,
    "src/**/*.js": true
  }
}

toggling that true vs false, to show/hide the files built alongside source .ts files.

Command 'toggle' not found

I tried to use this plugin by adding the following to keybindings.json:

{
	"key": "F4",
	"command": "toggle",
	"when": "editorTextFocus",
	"args": {
		"id": "autoReveal", // must be unique
		"overrideWorkspaceSettings": true,
		"values": [ // Note: use the same settings in each values object
			{
			  "explorer.autoReveal": true
			},
			{
			  "explorer.autoReveal": false
			}
		]
	}
}

...but it doesn't work. When I press F4, I get a warning: "command 'toggle' not found".

I'm on Visual Studio Code 1.13.1. There are no error messages in the console (even with settings.cycle.logLevel set to "log").

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.