Git Product home page Git Product logo

cursorless-dev / cursorless Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 77.0 15.65 MB

Don't let the cursor slow you down

Home Page: https://www.cursorless.org/

License: MIT License

TypeScript 85.87% Java 0.01% C++ 0.01% Smalltalk 0.01% HTML 0.04% JavaScript 0.66% Python 7.08% Scala 0.05% Shell 0.44% CSS 0.31% Talon 0.38% SCSS 0.01% Scheme 4.28% Go 0.11% MDX 0.47% Nearley 0.18% Lua 0.11%
structure-editor talonvoice voice voice-coding vscode vscode-extension

cursorless's People

Contributors

adityakode avatar alexhwoods avatar andreasarvidsson avatar andrewdant avatar auscompgeek avatar bjaspan avatar bra1ndump avatar brollin avatar brxck avatar c-loftus avatar codesaway avatar dependabot[bot] avatar dgrunwald avatar fidgetingbits avatar fourstepper avatar hermanperkins avatar jmegner avatar johnefford avatar josharian avatar m11nh avatar martinrykfors avatar nathanheffley avatar phillco avatar pokey avatar pre-commit-ci[bot] avatar purplep avatar ronwalker22 avatar saidelike avatar will-sommers avatar wolfmanstout 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cursorless's Issues

Support take every instance of token transformation

  • Do we also want to support taking a certain number of instances?
  • Also support narrowing to instances which appear within another target, eg "take every token fine in class gust"
  • Also support narrowing to instances that appear at the beginning of the line (what would syntax be?)

Have protection against modifying things off screen

If a command, eg "chuck" is about to delete something you can't see, it should either fail or warn. Could have a setting to turn this one off if you like to live dangerously ๐Ÿ˜ˆ

This protection would be important to have before we support #44

Fwiw this support could prob be implemented by a separate extension that Cursorless could then be a client of if it wanted to do something special

Here's some code to get us started. Was originally in extension.ts, but removed as part of #1035 as it is still just unused draft code:

  function checkForEditsOutsideViewport(
    event: vscode.TextDocumentChangeEvent
  ) {
    // TODO: Only activate this code during the course of a cursorless action
    // Can register pre/post command hooks the way we do with test case recorder
    // TODO: Move this thing to a graph component
    // TODO: Need to move command executor and test case recorder to graph
    // component while we're doing this stuff so it's easier to register the
    // hooks
    // TODO: Should run this code even if document is not in a visible editor
    // as long as we are during the course of a cursorless command.
    const editor = vscode.window.activeTextEditor;

    if (
      editor == null ||
      editor.document !== event.document ||
      event.reason === vscode.TextDocumentChangeReason.Undo ||
      event.reason === vscode.TextDocumentChangeReason.Redo
    ) {
      return;
    }

    const ranges = event.contentChanges
      .filter(
        (contentChange) =>
          !editor.visibleRanges.some(
            (visibleRange) =>
              contentChange.range.intersection(visibleRange) != null
          )
      )
      .map(({ range }) => range);

    if (ranges.length > 0) {
      ranges.sort((a, b) => a.start.line - b.start.line);
      const linesText = ranges
        .map((range) => `${range.start.line + 1}-${range.end.line + 1}`)
        .join(", ");
      vscode.window.showWarningMessage(
        `Modification outside of viewport at lines: ${linesText}`
      );
    }
  }

  vscode.workspace.onDidChangeTextDocument(checkForEditsOutsideViewport)

Support type parameters

As mentioned in #24, it might be useful to support type parameters.

I think the simplest place to start for type parameters (eg the identity<Type> example) would be to just add them to the argumentOrParameter matcher. Then you could just say "take arg" if your cursor is sitting inside one of them.

I also think it's potentially worth adding them to the type matcher, but might be a bit tricky because we'd probably only want to catch the type parameter if the mark is in the parameter, not inside eg the function, because in that case we'd prob want the return type

Need to make sure we support the place the type parameter is defined as well as the place that it's instantiated

If we think we'll have a use case for it, we could do something fancier where we can jump from somewhere else to the type parameter of the containing function, but let's see if that ends up being necessary. If we did that, I'd prob call it "type parameter" or "type arg" rather than "type"

Fix "past end of line"

When issuing a command such as "chuck gust past end of line", cursorless incorrectly assumes that "end of line" refers to the current cursor line rather than the line containing "gust".

Support type / interface fields in typescript

The problem

For example in the following code:

interface Foo {
   bar: Bar;
   baz: Baz;
}

If your cursor was before bar, then "take field" would select bar: Bar

Approach

Look for the property_signature node type

A couple options:

  • Introduce a new term "prop". We may also want it to select property accesses (eg foo.bar), and class property definitions
  • Modify "state" to target this scope type. I guess technically these aren't considered statements, but that seems a bit subtle to me
  • Modify "item" to target this scope type

First raised in #24 by @brxck

Add "mark" action to bookmark a target

The problem

Cursorless has no way to store a reference to a target for future use. The most obvious use case for this functionality is basic bookmarking, where a user can create a short name for a location in a document to jump back to later.

However, this basic functionality only scratches the surface of what can be done using an operation that creates a named reference to a cursorless target. There are two main aspects to cursorless that makes this type of bookmark far more powerful than what can be done using a simple bookmarking library.

A rich set of actions

The first component is that cursorless supports many different actions. The basic operation of jumping back to a bookmark as described at the top of this issue can be accomplished by issuing the "take" action on the book mark. Even this operation, though, is likely more powerful than with a traditional bookmarks library, because it can be used to restore an exact set of selections, and these selections will be updated even as the document evolves.

However, these bookmarks can also be referred to without ever jumping to them. For example, a user could book mark a location in a file and then browse around their project directory moving statements and functions into that file by using the bookmark as the destination of a "move" command.

Semantically rich targets

The second component that makes cursorless bookmarks powerful is the fact that a cursorless target can be much more than just a location in a document. Cursorless targets can contain rich contextual information such as how the target functions within the parse tree of the file to enable smart updating such as adding new items to a list. Cursorless targets could also be stitched together into cross file bookmarks to enable updating multiple files at the same time. Cursorless targets also needn't be restricted to locations in documents at all. See below for a bit more about this type of use case.

The solution

  • Add a new action called "mark" which bookmarks its target. This goes into the default "mark" bookmark, which can then be used in a phrase such as "take mark"
  • The user could also say "mark <target> as <word>" and that would create a named bookmark so the user could say "take [mark] <word>"
  • The user could also optionally add a color and an icon which would show up in the gutter of the document and the color would be used to highlight the text of the bookmark
  • If the user doesn't provide color and icon ones will automatically be chosen for them, or potentially just use gray for the color or don't show a color or don't show an icon if they don't specify. We'll have to figure this one out based on what feels right with usage
  • These marks could be in another file, so #45 would apply here
  • Marks should be persisted on disk so that they can last across restarts. Might want to keep them within the workspace?
  • Would need to automatically keep them up-to-date using #191
  • Make sure this feature interacts well with notebooks
  • Need to leverage pokey/command-server#8 to expose the list of known bookmarks as a talon list

Fun stuff

In this section we discuss various advanced / experimental possible use cases for cursorless bookmarks. See What's next for more about this type of use case.

Non-positional targets

These bookmarks could actually be used to capture arbitrary targets, literal strings, snippets made on the fly from targets by specifying "holes", etc. This functionality enables much more complex chains because they can extend beyond a single voice command

These "bookmarks" could go into the user's bookmark library to be used again

Pipelines

Could capture recent sequence of commands, or sequence of commands leading to a bookmark, allowing user to turn that into a reusable pipeline that goes into the library as well. Should these pipelines just be a form of bookmark / target as well?

Smart marks

Could be defined via a regex rather than a range, to make them more robust. Would be useful for long-lived marks, marks that are persisted with the repo, and plop.js-like functionality

Social marks

  • These bookmarks could be shared with other users, creating a library of reusable pipelines
  • For a specific project they could be checked into version control

Viewing marks

  • Could have a web view to visualize the marks

Add "phones" action

Cycles through homophones

Should preserve capitalization

Should set quick action as well when that is supported

Approach:

  1. Use getText action to get text of target back to talon
  2. Look up phones
  3. Use replace action (once supported) to insert next phone

Proper support for subword sequences

Cursorless should understand that subwords in a token are a sequence, and know how to insert / remove delimiters. For camel case it should properly figure out when to upper / lower case

Support more vscode code actions

Today we just support "refactor.extract.constant", but there are many more such as converting a lambda function to add braces etc

We can probably just let user define these in user space, but we should add a few to a Recipe page on wiki and link there from customization doc

Indicating last subword by number causes error

For example "take third word" in the word fooBarBaz yields:

Cannot read property 'end' of undefined

Of course one could say "take last word" instead, which does work.

Full trace from the extension host:

[2021-06-22 11:54:18.382] [exthost] [error] TypeError: Cannot read property 'end' of undefined
	at xv (/home/brock/.vscode/extensions/pokey.cursorless-0.14.0/dist/extension.js:23:9154)
	at /home/brock/.vscode/extensions/pokey.cursorless-0.14.0/dist/extension.js:23:7738
	at Array.map (<anonymous>)
	at as (/home/brock/.vscode/extensions/pokey.cursorless-0.14.0/dist/extension.js:23:7731)
	at $c (/home/brock/.vscode/extensions/pokey.cursorless-0.14.0/dist/extension.js:23:6721)
	at /home/brock/.vscode/extensions/pokey.cursorless-0.14.0/dist/extension.js:23:6551
	at Array.map (<anonymous>)
	at ss (/home/brock/.vscode/extensions/pokey.cursorless-0.14.0/dist/extension.js:23:6544)
	at /home/brock/.vscode/extensions/pokey.cursorless-0.14.0/dist/extension.js:23:12407
	at E._executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:107932)
	at E._doExecuteCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:107077)
	at E.executeCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:106983)
	at Object.executeCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:96:21346)
	at CommandRunner.<anonymous> (/home/brock/.vscode/extensions/pokey.command-server-0.5.1/out/commandRunner.js:76:56)
	at Generator.next (<anonymous>)
	at fulfilled (/home/brock/.vscode/extensions/pokey.command-server-0.5.1/out/commandRunner.js:5:58) cursorless.command

Support "call" action

  • Takes two targets: function to call, and range to wrap
  • Eg "call gust on bat"
  • If "on <target>" is omitted, then it refers to "this", so will wrap cursor

Syntax: "call <target> [on <target>]"
Examples: "call fine", "call fine on gust past each", etc

Support "until"

We'd like to support a form of range that goes until the beginning of a token rather than at the end. For example, "chuck till trap".

Add "sentence" scope type

It would be considered a delimited sequence, so that it would remove trailing periods as necessary. We probably want to use an NLP library for this one to do it properly

  • In addition, it should understand that the first word should be capitalized, and other words don't need to, but may be. This capitalization support might share impl with camel-case (#34), eg how camel case should know that first is lower but rest are upper

Possible libraries to use

Add ordinal scope types

So could say "take next dollar fine" to select the first $ after the given token. Could also say "<ordinal> <symbol>", eg "second dollar".

In addition, could support "next line fine", "third line fine", etc, as well as "next funk fine", etc

For convenience, potentially "down <number>" could be alias for "<ordinal> line".

Would need to support other direction as well, eg "take last dollar fine", or "take second to last dollar fine", tho the latter is a bit verbose

Use "prior" for opposite of "next"

We should also figure out compact grammar for the following:

  • #982
  • Scope and next scope
  • Scope and next two scopes
  • Every scope from scope through end of iteration scope
  • Every scope from scope through start of iteration scope
  • Scope and previous scope
  • Scope and previous two scopes
  • Target past next scope
  • This past next scope
  • Target past previous scope
  • This past previous scope
  • Target past next two scopes (might not need to be compact)
  • How to make these work with "next <symbol>" eg "next comma"
  • How to make these work with "next instance <target>" for selecting next occurrence of a target
    • Does this work for any target or just mark?
    • Where does it start searching? At <target> or cursor or able to search from a different target?

"next <mark>"

It should always be next instance of given mark's text relative to input. So eg if there is a token "hello" with a hat over the h, then "next harp" will select the next instance of hello after the cursor

Should support "every", "first", etc for these as well

Note that for things like :, ,, ), etc, we don't really care about the token that has the hat because it will always just be the one character, so it will behave like we want anyway. For failure modes of this assumption (eg < and <=), we can add something like glyph modifier or something in the future if that becomes a problem

Plurals

Where plurals make sense (eg "three funks"), vendor in the following sections of inflection:

And have csv overrides code generate a list called foo_plural if you pass in a flag asking for plurals

Some proposed spoken forms:

IMG_0044

Support "replace with" action

Eg "replace fine with camel hello world". It would support arbitrary format string ie "replace <target> with <format_string>". The actual replaceWith function would accept a list of strings so that it can operate on compound targets. So talon-side we could support "replace fine and bar with camel hello world and snake hello there".

Could also support things other than format strings after the "with", eg "spell <letters>" or "word" or "round" / "curly" / "square" that would return eg ["(", ")"], to combine with "boundary", allowing commands like "replace border round with square"

It is tempting to support cursorless targets after the "with" as well, eg "replace fine with gust", but this functionality is subsumed by "bring", eg "bring gust to fine", so not sure it's worth the added complexity

Support "name" transformation

Eg name of var in a declaration, class name, function name, etc. Could be extended to support specifying "funk name", "class name", etc. So eg

class Foo:
    def bar():
        baz = 5

If your cursor is on the 5, then:

  • "take name" selects baz,
  • "take state name" also selects baz,
  • "take funk name" selects bar, and
  • "take class name" selects Foo

Support "matching" modifier

We'd like to support the "matching" modifier, which looks for the nearest paired symbol, such as ", (, [, etc, and selects until past the matching symbol, similar to the vim % motion

We also may want a version where you specify which paired token to look for, eg "round", "square", etc

This issue will be implemented by layering on top of #13 by making it synonymous with "past next pair"

Support "join" action to join lines

Eg "join line air past bat". If applied to single line, should prob join with next line, like in vim / vscode.

Could prob use this as a way to remove an empty line after given line?

Could initially implement using setSelection followed by built-in vscode join command

Support specifying thing to join them with, eg ","?

Infer type of first swap argument

To be consistent with the way we infer the type of a start of a range based on the type of the end of the range, we could infer the type of the first swap argument from the type of the second argument. For example, "swap with funk gust", can infer that the first argument is the function containing the cursor.

Support "type" transformation

Would it be possible to add a "type" transformation? In TypeScript, for example:

const logs: { user: string; event: string }[] = [];

I think being able to "take type" and select { user: string; event: string }[] it would be very useful.

Less important imo, but there are also the cases of generics and type parameters to consider?

Fix bug with "every funk" in private class function

Here's a file that triggers the error. Say "take every funk" when cursor is in private function at the bottom


import * as vscode from "vscode";
import { join } from "path";
import { COLORS } from "./constants";
import { SymbolColor } from "./constants";

export type DecorationMap = {
  [k in SymbolColor]?: vscode.TextEditorDecorationType;
};

export interface NamedDecoration {
  name: SymbolColor;
  decoration: vscode.TextEditorDecorationType;
}

export default class Decorations {
  decorations: NamedDecoration[];
  decorationMap: DecorationMap;

  constructor() {
    const iconWidth = "1rem";
    const iconPath = join(__dirname, "..", "images", "hat.svg");

    this.decorations = COLORS.map((color) => ({
      name: color,
      decoration: vscode.window.createTextEditorDecorationType({
        // borderStyle: "solid",
        // borderColor: new vscode.ThemeColor(`cursorless.${color}Border`),
        // borderWidth: "2px 0px 0px 0px",
        // borderRadius: "4px",
        // backgroundColor: new vscode.ThemeColor(`cursorless.${color}Background`),
        rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
        after: {
          margin: `-1rem 0 0 -${iconWidth}`,
          width: iconWidth,
          height: iconWidth,
          color: new vscode.ThemeColor(`cursorless.${color}Border`),
          contentIconPath: iconPath,
        },
      }),
    }));

    this.decorationMap = Object.fromEntries(
      this.decorations.map(({ name, decoration }) => [name, decoration])
    );
  }
  private constructWrapperSvg() {
    const svg = `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 13H5v-2h14v2z"/></svg>`;
    return vscode.Uri.parse(`data:image/svg+xml;utf8,${svg}`);
  }
}

Add a command for toggling decorations

It would be nice to have something hooked up to cursorless.toggleDecorations by default.

Edit (@pokey): We've decided to just add instructions for how to set up your own voice command for this to the wiki under FAQ and recipes

Support numeric ranges for insert

If you have 5 cursors, you could say "insert range 1 to 5 pre this". For example, if you have a cursor at the beginning of each of these lines:

foo
bar
baz
bongo

Then saying "insert range 1 to 4 pre this", you'd get the following:

1foo
2bar
3baz
4bongo

Probably talon would just send a list to vscode, which would then zip it with the targets as normal. So the range would just operate like "square" etc as described in #15

Could also have a simplified version which is just "insert count pre this", or "insert count from two pre this", and it would count as necessary

Could also do alphabet ranges

Rename colour mauve to purple

In cursorless-vscode and cursorless-talon the color purple is referred to as mauve. Update this to purple make it easier for the documentation.

Support `"every <scope>"` / `"<ordinal> <scope>"`

The goal

For example:

  • "every line"
  • "every funk"
  • "every line in class"
  • "first funk"
  • "last line in funk"

See https://github.com/pokey/cursorless-vscode/wiki/Target-overhaul for many more examples

  • Also support "past last", so eg "past last item air", "past last funk air". This would target from the scope containing the mark through the last instance of the scope in its iteration scope
  • Add expansion tests (see also #883)

Implementation

  • This implementation will rely on #210 and #69.
  • See #797

Notes

  • This functionality subsumes today's every funk and first char / last word etc

Questions

  • How do we handle ranges such as today's first past third word or the future first past third funk?

Support "enclosing <symbol>" transformation

We'd like to support transformations such as "outer round" to take everything inside and including the parentheses containing a token, as well as "inner round", "inner square", etc.

Would also be nice to support selecting the delimiter symbols themselves, eg the open and close paren. This could be eg "border round", "border square", etc. Or "disc", or "doughnut", or "bound" or something. This version of the transformation would be useful when combined with a list-based "replace with" command, so could say eg "replace border round with square" to change enclosing parens to square brackets.

parsetree non-functional on windows?

i haven't had a chance to dig into this yet, but parse tree appears to be non-functional on windows at the moment

from the extension log:

[2021-05-10 16:23:45.226] [exthost] [error] Activating extension pokey.parse-tree failed due to an error:
[2021-05-10 16:23:45.227] [exthost] [error] Error: \\?\c:\Users\knaus\.vscode\extensions\pokey.parse-tree-0.2.0\node_modules\tree-sitter\build\Release\tree_sitter_runtime_binding.node is not a valid Win32 application.
\\?\c:\Users\knaus\.vscode\extensions\pokey.parse-tree-0.2.0\node_modules\tree-sitter\build\Release\tree_sitter_runtime_binding.node
	at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1812)
	at Object.Module._extensions..node (internal/modules/cjs/loader.js:1250:18)
	at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1812)
	at Module.load (internal/modules/cjs/loader.js:1039:32)
	at Module._load (internal/modules/cjs/loader.js:932:14)
	at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
	at Function.o._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:27791)
	at Function.E._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:24509)
	at Function.a._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:59194)
	at Module.require (internal/modules/cjs/loader.js:1079:19)
	at v (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:4:694)
	at Object.<anonymous> (c:\Users\knaus\.vscode\extensions\pokey.parse-tree-0.2.0\node_modules\tree-sitter\index.js:3:13)
	at Module.u._compile (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:4:1248)
	at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
	at Module.load (internal/modules/cjs/loader.js:1039:32)
	at Module._load (internal/modules/cjs/loader.js:932:14)
	at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
	at Function.o._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:27791)
	at Function.E._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:24509)
	at Function.a._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:59194)
	at Module.require (internal/modules/cjs/loader.js:1079:19)
	at v (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:4:694)
	at Object.<anonymous> (c:\Users\knaus\.vscode\extensions\pokey.parse-tree-0.2.0\out\extension.js:14:16)
	at Module.u._compile (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:4:1248)
	at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
	at Module.load (internal/modules/cjs/loader.js:1039:32)
	at Module._load (internal/modules/cjs/loader.js:932:14)
	at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
	at Function.o._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:27791)
	at Function.E._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:24509)
	at Function.a._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:59194)
	at Module.require (internal/modules/cjs/loader.js:1079:19)
	at require (internal/modules/cjs/helpers.js:72:18)
	at Function.t [as __$__nodeRequire] (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:5:101)
	at h._loadCommonJSModule (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:25918)
	at h._doActivateExtension (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:91:12016)
	at h._activateExtension (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:91:11072)
	at processTicksAndRejections (internal/process/task_queues.js:97:5)
[2021-05-10 16:23:45.453] [exthost] [info] ExtensionService#_doActivateExtension vscode.github {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
[2021-05-10 16:23:45.453] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/github/dist/extension.js
[2021-05-10 16:23:45.459] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug {"startup":false,"extensionId":{"value":"ms-vscode.js-debug","_lower":"ms-vscode.js-debug"},"activationEvent":"onCommand:extension.js-debug.clearAutoAttachVariables"}
[2021-05-10 16:23:45.459] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/extension.js
[2021-05-10 16:23:45.535] [exthost] [info] ExtensionService#_doActivateExtension ms-python.python {"startup":false,"extensionId":{"value":"ms-python.vscode-pylance","_lower":"ms-python.vscode-pylance"},"activationEvent":"onLanguage:python"}
[2021-05-10 16:23:45.535] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/knaus/.vscode/extensions/ms-python.python-2021.4.765268190/out/client/extension
[2021-05-10 16:23:45.648] [exthost] [info] eager extensions activated
[2021-05-10 16:23:45.677] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication {"startup":false,"extensionId":{"value":"vscode.github-authentication","_lower":"vscode.github-authentication"},"activationEvent":"onAuthenticationRequest:github"}
[2021-05-10 16:23:45.677] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/github-authentication/dist/extension.js
[2021-05-10 16:23:45.686] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":false,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"onStartupFinished"}
[2021-05-10 16:23:45.686] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/emmet/dist/node/emmetNodeMain
[2021-05-10 16:23:45.693] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":false,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"onStartupFinished"}
[2021-05-10 16:23:45.693] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/merge-conflict/dist/mergeConflictMain
[2021-05-10 16:23:45.697] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender {"startup":false,"extensionId":{"value":"ms-vscode-remote.remote-wsl-recommender","_lower":"ms-vscode-remote.remote-wsl-recommender"},"activationEvent":"onStartupFinished"}
[2021-05-10 16:23:45.697] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/ms-vscode-remote.remote-wsl-recommender/dist/extension.js
[2021-05-10 16:23:45.704] [exthost] [info] ExtensionService#_doActivateExtension vscode.testing-editor-contributions {"startup":false,"extensionId":{"value":"vscode.testing-editor-contributions","_lower":"vscode.testing-editor-contributions"},"activationEvent":"onStartupFinished"}
[2021-05-10 16:23:45.704] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/testing-editor-contributions/dist/extension.js
[2021-05-10 16:23:45.707] [exthost] [info] ExtensionService#_doActivateExtension dbaeumer.vscode-eslint {"startup":false,"extensionId":{"value":"dbaeumer.vscode-eslint","_lower":"dbaeumer.vscode-eslint"},"activationEvent":"onStartupFinished"}
[2021-05-10 16:23:45.707] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/knaus/.vscode/extensions/dbaeumer.vscode-eslint-2.1.20/client/out/extension
[2021-05-10 16:23:45.714] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl {"startup":false,"extensionId":{"value":"ms-vscode-remote.remote-wsl","_lower":"ms-vscode-remote.remote-wsl"},"activationEvent":"onStartupFinished"}
[2021-05-10 16:23:45.714] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/knaus/.vscode/extensions/ms-vscode-remote.remote-wsl-0.54.6/dist/extension
[2021-05-10 16:23:45.979] [exthost] [info] ExtensionService#_doActivateExtension ms-python.vscode-pylance {"startup":false,"extensionId":{"value":"ms-python.vscode-pylance","_lower":"ms-python.vscode-pylance"},"activationEvent":"onLanguage:python"}
[2021-05-10 16:23:45.979] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/knaus/.vscode/extensions/ms-python.vscode-pylance-2021.4.3/dist/extension.bundle.js
[2021-05-10 16:24:27.651] [exthost] [info] extension host terminating: received terminate message from renderer
[2021-05-10 16:24:28.671] [exthost] [info] exiting with code 0
[2021-05-10 16:24:28.907] [exthost] [info] extension host started
[2021-05-10 16:24:28.976] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication {"startup":false,"extensionId":{"value":"vscode.microsoft-authentication","_lower":"vscode.microsoft-authentication"},"activationEvent":"onAuthenticationRequest:microsoft"}
[2021-05-10 16:24:28.976] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/microsoft-authentication/dist/extension.js
[2021-05-10 16:24:28.984] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":"*"}
[2021-05-10 16:24:28.984] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/debug-auto-launch/dist/extension
[2021-05-10 16:24:28.986] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
[2021-05-10 16:24:28.986] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/git/dist/main
[2021-05-10 16:24:28.999] [exthost] [info] ExtensionService#_doActivateExtension pokey.command-server {"startup":true,"extensionId":{"value":"pokey.command-server","_lower":"pokey.command-server"},"activationEvent":"*"}
[2021-05-10 16:24:28.999] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/knaus/.vscode/extensions/pokey.command-server-0.3.4/out/extension.js
[2021-05-10 16:24:29.002] [exthost] [info] ExtensionService#_doActivateExtension pokey.parse-tree {"startup":true,"extensionId":{"value":"pokey.cursorless","_lower":"pokey.cursorless"},"activationEvent":"*"}
[2021-05-10 16:24:29.002] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/knaus/.vscode/extensions/pokey.parse-tree-0.2.0/out/extension.js
[2021-05-10 16:24:29.008] [exthost] [error] Activating extension pokey.parse-tree failed due to an error:
[2021-05-10 16:24:29.009] [exthost] [error] Error: \\?\c:\Users\knaus\.vscode\extensions\pokey.parse-tree-0.2.0\node_modules\tree-sitter\build\Release\tree_sitter_runtime_binding.node is not a valid Win32 application.
\\?\c:\Users\knaus\.vscode\extensions\pokey.parse-tree-0.2.0\node_modules\tree-sitter\build\Release\tree_sitter_runtime_binding.node
	at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1812)
	at Object.Module._extensions..node (internal/modules/cjs/loader.js:1250:18)
	at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1812)
	at Module.load (internal/modules/cjs/loader.js:1039:32)
	at Module._load (internal/modules/cjs/loader.js:932:14)
	at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
	at Function.o._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:27791)
	at Function.E._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:24509)
	at Function.a._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:59194)
	at Module.require (internal/modules/cjs/loader.js:1079:19)
	at v (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:4:694)
	at Object.<anonymous> (c:\Users\knaus\.vscode\extensions\pokey.parse-tree-0.2.0\node_modules\tree-sitter\index.js:3:13)
	at Module.u._compile (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:4:1248)
	at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
	at Module.load (internal/modules/cjs/loader.js:1039:32)
	at Module._load (internal/modules/cjs/loader.js:932:14)
	at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
	at Function.o._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:27791)
	at Function.E._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:24509)
	at Function.a._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:59194)
	at Module.require (internal/modules/cjs/loader.js:1079:19)
	at v (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:4:694)
	at Object.<anonymous> (c:\Users\knaus\.vscode\extensions\pokey.parse-tree-0.2.0\out\extension.js:14:16)
	at Module.u._compile (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:4:1248)
	at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
	at Module.load (internal/modules/cjs/loader.js:1039:32)
	at Module._load (internal/modules/cjs/loader.js:932:14)
	at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
	at Function.o._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:27791)
	at Function.E._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:24509)
	at Function.a._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:59194)
	at Module.require (internal/modules/cjs/loader.js:1079:19)
	at require (internal/modules/cjs/helpers.js:72:18)
	at Function.t [as __$__nodeRequire] (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:5:101)
	at h._loadCommonJSModule (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:25918)
	at h._doActivateExtension (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:91:12016)
	at h._activateExtension (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:91:11072)
	at processTicksAndRejections (internal/process/task_queues.js:97:5)
	at async Promise.all (index 3)
	at async Promise.all (index 0)

Support "wrap with snippet"

The goal

VSCode has support for snippets that can take a selection. We'd like to use this to enable things such as "if state wrap air", "try state wrap air", etc

Implementation plan

Extension

We propose to add a new action. Check out simple actions like ExtractVariable as a starting point.

The action will call editor.insertSnippet.

We will keep language-specific snippets for each syntactic scope type, similar to how we do for finding containing scope; see eg https://github.com/pokey/cursorless-vscode/blob/fdebfe93c7871a3e3bf832532f51cf64b8f3c3a8/src/languages/python.ts#L46-L68 Note that the snippet will leverage TM_SELECTED_TEXT to refer to where the target that is wrapped will go. We can add tabstops for things like if statement guard, catch block, etc

The action will take an extra arg which is the scopetype to wrap with, eg ifStatement. See Wrap for example of taking extra args

Talon

Add a new capture like "wrap" that accepts a scope type. Something like "<scopeType> wrap <target>"

Unify several editing actions

I believe the following actions fit into a common framework:

  • "clear"
  • "bring"
  • "move"
  • "replace with"
  • "drink"
  • "pour"

I believe they fall along a couple axes:

Edit mode / source Modify token itself Insert before / after token
Formatter output (eg "camel hello world") "replace with" / "change to" "add" / "insert" / "type"
Move cursor to edit "clear" "drink" / "pour" / "add"?
From another target "bring" / "move" "bring" / "move"
From the clipboard "paste" "paste"

Support "paste" action

  • Trims clipboard then splits lines
  • If number of lines divisible by number of targets, groups clipboard lines per target
  • If not divisible, broadcasts clipboard text for each target

Merge sequential pending change highlights

There are a couple commands where the pending change highlights appear in sequence. This slows down the action and makes it so that sometimes the cursorless decorations will move before another command can be executed. We'd like to make these commands show the highlights at the same time. The commands are:

  • use
  • carve

Be smart about sequences of words separated by spaces

Cursorless has support for handling delimited sequences, eg argument lists. We should add support for cursorless automatically detecting that a token is in a sequence of whitespace-delimited tokens so that it can do smart things like automatically removing extra spaces the way it does with commas. This functionality will be useful for editing prose

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.