- closes https://github.com/cursorless-dev/cursorless/issues/945
- closes https://github.com/cursorless-dev/cursorless/issues/1044
- depends on https://github.com/cursorless-dev/cursorless/pull/1322
- depends on https://github.com/cursorless-dev/cursorless/pull/1327
## Checklist
- [x] Split into smaller PRs for ease of review
- [x] Try DX tests again
https://github.com/cursorless-dev/cursorless/discussions/1289
- [x] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [x] File issue for speeding up cheatsheet / making it not optional
locally https://github.com/cursorless-dev/cursorless/issues/1307
- [x] Set package manager in package.json
https://nodejs.org/api/packages.html#packagemanager
- [x] Re-add lint rule to prevent api types from importing anything
- [x] Try local install
- [x] Make sure cheatsheet works
- [x] Make sure local extension build depends on building cheatsheet, or
allows no cheatsheet
- [x] Figure out why we're getting so many extra `internal` modules
- [x] Update https://github.com/cursorless-dev/cursorless/issues/931 to
indicate we're now patching instead of swizzling
- [x] Make sure lint rules are actually running in CI
- [x] Check that we've addressed everything in
https://github.com/cursorless-dev/cursorless/issues/945
- [x] Incorporate changes from
https://github.com/cursorless-dev/cursorless/pull/1166
- [x] ~~Make sure this PR doesn't break doc links; see
https://github.com/cursorless-dev/cursorless/pull/942#discussion_r968556276~~
There's no way to avoid these links getting broken if we upgrade
typedoc; filed https://github.com/cursorless-dev/cursorless/issues/1304
to track
- [x] Revert https://github.com/cursorless-dev/cursorless/pull/1284
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] I have not broken the cheatsheet
- [x] Generate cursorless-vscode package.json automatically, and change
the name we use to `@cursorless/cursorless-vscode` in the `package.json`
checked into source control
- [x] Be sure to update meta-updater to check for that instead of name
`cursorless` (see fixme in its `index.ts`)
## Desiderata
- From https://github.com/cursorless-dev/cursorless/discussions/1289
### Correctly flagging errors
- [x] `D1`: It is a compile error to import external packages that are
not listed in `package.json`
- [x] `D1.1`: `vscode` (for some reason this one behaves strangely)
- [x] `D1.2`: Other packages
- [x] `D2`: It is **not** a compile error to import from local packages
that you depend on, using our preferred syntax (eg `@cursorless/foo`)
- [x] `D3`: It is a compile error to import from local packages that you
depend on, **not** using our preferred syntax (eg `../foo`)
- [x] `D4`: It is a compile error to import from local packages that you
do **not** depend on, either
- [x] `D4.1`: using our non-preferred syntax (eg `../packages/foo`), or
- [x] `D4.2`: using preferred syntax (eg `@cursorless/foo`)
- [ ] `D5`: It is a compile error to import from anything other than
`index.ts` in another module
- [x] `D5.1`: **no** `@cursorless/foo/bar`
- [x] `D5.2`: **no** `../foo/bar`
- [x] `a`: Even if you depend on the module
- [ ] `b`: Even if `bar` was re-exported in `foo/index.ts`. In that case
it should be required to import `@cursorless/foo`. Untested, but
probably works, and I ran out of steam 😅
- [x] `D6`: It is **not** a compile error to import external packages
listed in `package.json`
- [x] `D6.1`: `vscode` (for some reason this one behaves strangely)
- [x] `D6.2`: Other packages
### Auto-import
- [x] `D7`: Auto-import doesn't import from external packages not listed
in `package.json`
- [x] `D7.1`: `vscode` (for some reason this one behaves strangely)
- [x] `D7.2`: Other packages
- [x] `D8`: Auto-import imports from external packages listed in
`package.json`
- [x] `D8.1`: `vscode` (for some reason this one behaves strangely)
- [x] `D8.2`: Other packages
- [x] `D9`: Auto-import imports from local packages that you depend on,
using our preferred syntax (eg `@cursorless/foo`)
- [x] `D10`: Auto-import doesn't import from local packages that you
don't depend on
- [x] `D11`: Auto-import doesn't import from anything other than
`index.ts` in another package (eg **no** `@cursorless/foo/bar`)
- [x] `D11.1`: When you depend on the package
- [x] `D11.2`: When you don't depend on the package
### Other DX
- [x] `D12`: Find references across projects when no file from the
referencing project is open
- [x] `D13`: Rename across projects when no file from the referencing
project is open
- [x] `D14`: Jump to definition across projects
- [ ] `D15`: It is easy to move a file from one package to another
- [ ] `D16`: It is easy to create a new package
- [ ] `D17`: Breakpoints work in Cursorless extension
- [x] `D18`: Breakpoints work on Cursorless root website
- [ ] `D19`: Breakpoints work on Cursorless docs website
Fixed the v1 to v2 script to preserve order and not drop any values.
- [ ] ~~Use normalisation code for updating fixtures in
a4cee9611f/src/test/suite/recorded.test.ts (L130-L138~~)
(filed https://github.com/cursorless-dev/cursorless/issues/1168 to
follow up on this one)
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
I noticed that `eslint --fix` didn't remove unused imports and `eslint
src --ext ts` complained with a warning about an existing unused one:
```
$ eslint src --ext ts
.../src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts
1:10 warning 'window' is defined but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars
```
I imagine this is because most people are fixing this up using the
Visual Studio Code action, but it's nice to have everything working from
the command line. Also JetBrains will only do it if `eslint --fix` does,
hence my motivation :)
This adds the configuration such that `eslint src --ext ts --fix`
removed unused imports, and fixes the existing unused imports in the
codebase. Let me know if I made a mistake.
## Checklist
- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet_html)
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Started working on our own replacement for vscode types
* remove unused imports
* More workl
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* more changes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* More stuff
* Stuff stuff
* Some super secret clean up stuff
* Additional changes beyond human comprehension
* clean up
* Trans dimensional super fixes
* Mind boggling changes
* Hopefully done with this suffering
* Fixed circular dependencies
* Updated fake ide
* Added test for position
* Added range test
* Added getter to vscode editable editor implementation
* Convert position
* Added text line implementation
* Better handling of selections
* group document by uri
* Remove on use to vscode converter
* Clean up tests
* Make sure functions use arrow format
* Use weak map to keep track of text editors
* cleanup
* empty
* use arrow functions
* updated lock file
* restore normal methods for position and range
* Remove arrow expressions as method
* added is active on the text editor
* Error when trying to deselect all selections
* added types
* Make use of `@cursorless` imports
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Moved vscode utilities
* update
* Fixed stupid bug
* empty
* stuff
* stuff
* Added to empty range on position
* cleaned up vscode edit
* clean up
* clean up vscode focus editor
* move creation of text editors into ide
* cleanup
* moved get node at location into editor
* empty
* remove spread
* Add license reference
* use full vscode implementation
* Revert "moved get node at location into editor"
This reverts commit 4c2ec1cfab.
* remove location type
* Switch `getNodeAtLocation` to use document
* Use editable editor for performing edits
* Add `ide` reference to editable text editor
* docs
* Tweak
* tweak
* Fix bug with id / editor generation
* Remove unnecessary functions
* Tweak name
* merged vscode text editor implementations
* Add back comments about range adjustment
* Tweak docstrings
* docs
* add a couple tests
* Updated line behavior
* Test tweaks
* updated behavior
* added selection isEqual
* `isEqual` => `isRangeEqual`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* cleanup
* Capture more unit tests in launch config
* move `openNewEditor`
* Basic `TextLine` test
* Selection + more range tests
* yarn.lock tweak
* more line tests
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Added word separator setting. Removed language specific regex components.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated tests
* Word separator is now a list
* Update documentation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Mock word separators for tests
* Minor tweaks
* Update src/core/tokenizerConfiguration.ts
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Revert "Minor tweaks"
This reverts commit b7f3695975.
* cleanup
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Use join to create key
* Update src/core/tokenizer.ts
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Update docs
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Improve cheatsheet update machinery
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Tweak
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Renamed weak target, Renamed is weak, Added explicit range attribute
* Don't remove leading or trailing delimited ranges for empty selection
* Added clone parameters
* Updated comment
* Always create continuous range
* Renamed UnTypedRangeTarget to UnTypedTarget
* Process targets before test recorded command hook
* Added tests
* Renamed to ifUntyped
* Added item tests
* Cleanup
* Update src/typings/targetDescriptor.types.ts
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Update src/typings/targetDescriptor.types.ts
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Cleanup
* Cleanup
* Added tests
* Cleanup
* Added tests
* added tests
* Use undefined return value in error test cases
* Docstring
* Better error type for no inside / bounds
* Remove code sharing from ThatStage and CursorStage
* Doc strings
* Switch test subset
* Fix docstring link
* Record alternate "leading funk" test
* Record some more tests
* Add a bunch of tests
* Cleaned up from review
* Docstring
* More tests
* One more test
* Another test
* Rollback imports to avoid circular import
* Improve test
* Revert "Rollback imports to avoid circular import"
This reverts commit 9ad7e9fdf9.
* Fix imports
* Add tests; fix bug with `"every block"`
* Minor tweak
* Fix doc
* Docstrings
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Cheatsheet nx html generation
* HTML cheatsheet talon side
* HTML cheatsheet VSCode extension-side
* Tweak deploy
* identifier => id
* Tweaks from PR feedback
* Rename dir
* update defaults.json
* Remove nx-welcome.tsx
* Upgrade vscode test package version
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* licenses
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Pin vscode version
* Bump pin
* Wrap old focus notebook code in legacy function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix notebook focusing
* Test on later version of VSCode
* revert licences csv
* Change Github action setup
* Add NB
* Fix import
* Remove unused code
* Add function to check legacy notebook version
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fixed bug in removal range for range target
* A dead delimiter highlight to range target
* Added token context to all marks
* Added correct token context too regex
* Don't unifi ranges on content only removal
* Update the test
* Added feature to run single recorded test
* Updated tests
* Fallback on token context for containing scope
* Updated target inference
* general refactoring of removable ranges
* Updated unify removal targets
* Fixed that mark bug on set selection
* Fixed is reverse bug on vertical range targets
* Fixed is reverse bug on vertical range targets
* Set empty delimiter on end of and start of positions
* Updated test
* Fixed last tests
* Added description to run single recorded test
* At dead tests for bring before and after file
* Update to removal ranges
* Mark cleanup
* Added interior only and exclude interior as proper modifiers
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added support for every line
* Only select lines with content
* Added take every paragraph
* Added every file line and block tests
* Added take every token
* Added every too regex stages
* Cleanup
* Moved example of custom test transformation to docs
* Update src/core/commandVersionUpgrades/upgradeV1ToV2/commandV1.types.ts
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Update src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeV1ToV2.ts
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added OO targets
* Fixed merge conflict
* Reversed order of migration modifiers
* Default to array
* Cleaned up inference code
* Added paragraph target
* Better updates of new range
* oo targets past all test
* Added line and paragraph tests
* Highlight update
* Added script to show unused exports
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added line 2 unused export
* Default modifiers to empty array
* Don't use hat map
* Modifiers default to undefined
* Fixed is implicit inference
* Removed get tokens function
* Update src/core/commandVersionUpgrades/upgradeV1ToV2/commandV1.types.ts
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Update src/core/inferFullTargets.ts
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* General cleanup
* Added notebook cell target
* Support delimiter based edit newline (#684)
* Added delimiter based edit line
* Added support for arbitrary delimiters
* Added tests
* Renamed is above to is before
* Better handling of empty lines
* Cleanup
* Added default delimiters for some common scope types
* Run yarn
* Attempt to fix raw delimiter
* Fixed delimiter
* Revert "Attempt to fix raw delimiter"
This reverts commit 0de07989dc.
* Revert "Fixed delimiter"
This reverts commit a035390f78.
* Use low dash unique with
* Made base target abstract
* Updated tests
* Added return type
* Fixed compilation errors
* Updated position
* Add empty string as default delimiter for sub tokens
* Updated bugs
* Cleanup
* Added tests
* Updated inference of implicit target
* Updated spoken forms in test
* Utilize getters
* Refactored getters and setters for targets
* Implemented get final stages
* Added final stages to process targets
* Cleanup
* Converted command action into object with associated arguments
* Switch to complex scope types
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Remove scope type type from base target
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated to edit new context
* Added bring statement test
* Change behavior of pour line
* Use weak containing line stage for edit new
* Updated edit new
* Get targets in correct order
* Updated selection for editor
* Cleanup
* New attempt at EditNew
* Added rich targets
* Updated edit new with proper line handling
* Only used single edit
* Added comment
* Added comment
* Cleanup
* Added derived target
* Moved weak target into base target class
* Cleanup
* Updated action form
* Updated scope type for tests
* Fix upgrade path with ordinal range
* Pass leading and trailing delimiters to super constructor
* Learn to spell
* Updated more tests
* Cleanup
* Fixed bug taking matching pair in error code
* Added block tests
* Fixed test
* Added support for custom delimiters in copy lines
* Fix package json
* Fix one test
* Updated tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Disabled phrase snapshot on recorded test runner
* Updated test and upgrade path
* Fixed failing hat map tests
* Added sleep option to recorded tests
* Verbosity for the win
* Tweak modify of week stage
* Minor python cleanup
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Don't de duplicate that mark
* Use utility function to set selection that deduplicates
* Make document content range the entire file including white lines
* Added source mark to wrap action
* Added source mark to actions wrap and rewrap
* Updated error messages
* Updated tests
* Don't focus editor on notebook cell insertion
* Cleanup
* Don't update selection on notebook cell insertion
* Add comment
* Various fixes
* More renames and stuff
* Fix bug with missing delimiters in weak targets
* Update src/processTargets/processTargets.ts
Co-authored-by: Will Sommers <will.sommers@gmail.com>
* Unify implementation of copy lines and edit new actions
* Rename
* Started working on lazy removal
* Clarify processPrimitiveTarget
* Tweak
* Tweak again
* Imports fix
* All tests pass
* Updated highlights
* Highlight updates on continuous range target
* Moved edit decorations into graph
* Added decorations to test recorder and runner
* Updated to highlight recorder test
* Added decorations test
* Added decorations test
* Added leading and trailing delimiters as separate stage and target
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Create edits in actual targets
* Use object oriented targets to construct edits
* Enabled bring before and after without to
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix
* Support fully compositional modifiers
Fixes#69
* Getting started
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Start using InsertionRemovalBehavior
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Cleanup
* Tweak
* More cleanup
* More tweaks
* Tweaks
* More cleanup
* Cleanup
* Removed padding from float and drop
* Updated that mark on pour action
* Lots of stuff
* Fixed removal behavior on scope type target
* Hide panel on recorded test sweet startup
* More stuff
* More stuff
* Cleanup
* Some stuff clean up whatever don't care
* Committed some stuff
* Stuff
* Updated tests
* Support chuck after and chuck before
* Add hack for "paste to to"
* Add run single test launch config
* Add comment about running a single test to contributing docs
* Update cursorless-talon/src/csv_overrides.py
* Update cursorless-talon/src/positional_target.py
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Update cursorless-talon/src/positional_target.py
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
* Use plain target in clear action
* Initial modifier unification work
* Unify simple modifiers
* docstring
* Clean up position code
* At a couple comments
* Creates separate file for target descriptor types
* Separate notebook cell edit new from regular edit new
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixed that mark on notebook cells
* Cleanup
* More positional tweaks on talon side
* Removes support for chuck after and chuck before
* Clean up names
* Use proper error for syntax scope not found
* Record tests for leading trailing before and after
* Add chuck before after to upgrade
* Failed attempt at trying to simplify edit new
* Revert "Failed attempt at trying to simplify edit new"
This reverts commit 52193ae651.
* Cleanup vscode ignore
* Fixed regression in vertical range target (#735)
* Revert generic insert empty lines code
* Add broken float and puff tests
* Add working puff float drop tests
* Switch to mocha grep syntax for running subset of tests
* Make subdir for insert empty lines tests
* Support updating fixture decorations
* Add decorations to float drop puff tests
* Cleanup test case recorder docs
* Add bunch of clone tests
* Move files
* More cleanup
* `PartialTargetDesc` => `PartialTargetDescriptor`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Re-add provenance file
* Comments
* Bump package version
* Attempt to fix docs link
Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Will Sommers <will.sommers@gmail.com>