Skip to content

Remove more cyclic import dependencies #2076

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

Merged
merged 21 commits into from
Dec 1, 2023

Conversation

bjaspan
Copy link
Contributor

@bjaspan bjaspan commented Dec 1, 2023

  • Changes many imports from index files to direct source.
  • Removes cycle from notebook.ts and notebookLegacy.ts.
  • Moves processTargets/targetUtil to processTargets/targets/util so that those files can import from direct source without breaking the barrel boundary.
  • Moves tryConstructPlainTarget and tryConstructLineTarget to PlainTarget and LineTarget, respectively.

The Position/Range/Selection cycle is not touched. There are still some other cycles remaining as well, but this gets a lot of them.

@bjaspan
Copy link
Contributor Author

bjaspan commented Dec 1, 2023

It looks like my notebook.ts refactoring broke something but I do not yet understand the failure message:

  1) Cross-cell set selection
       Cross-cell set selection:
     Error: Extension 'pokey.cursorless' CANNOT use API proposal: notebookEditor.
Its package.json#enabledApiProposals-property declares: [] but NOT notebookEditor.
 The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api pokey.cursorless

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Mostly looks fine; left a pointer for how to fix your notebook issue

One challenge / annoyance will be getting typescript auto-import not to use barrels when it finds them. Otherwise these will just keep popping back up, and even with CI check it will be annoying to have to keep fixing them. There are some settings we can use to tune auto-import; maybe one of them can help us here

Did some research and I see microsoft/TypeScript#45953, which claims to have been solved by microsoft/TypeScript#47516, but that's not what I'm observing 🤔 cc/ @auscompgeek

image

@@ -40,5 +40,7 @@ export async function vscodeEditNewNotebookCellBelow(
}

function isNotebookEditor(editor: VscodeTextEditorImpl) {
return getNotebookFromCellDocument(editor.vscodeEditor.document) != null;
return (
getNotebookFromCellDocumentCurrent(editor.vscodeEditor.document) != null
Copy link
Member

Choose a reason for hiding this comment

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

I think this one needs to be fixed too

@pokey pokey enabled auto-merge December 1, 2023 18:44
@pokey pokey added this pull request to the merge queue Dec 1, 2023
@pokey pokey removed this pull request from the merge queue due to a manual request Dec 1, 2023
@pokey pokey enabled auto-merge December 1, 2023 18:54
@pokey pokey added this pull request to the merge queue Dec 1, 2023
Merged via the queue into cursorless-dev:main with commit 0bec633 Dec 1, 2023
@bjaspan bjaspan deleted the remove-cycles-2 branch January 26, 2024 17:27
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

Successfully merging this pull request may close these issues.

2 participants