feat: Add swift support - #3300
Conversation
…ntries file structure is unconventional but it's how I'd like to keep it for now until swift support is nearing completion, at which point it can be made more similar to the other facet definition files I guess?
…orless into swift-support
|
There's also currently a TODO here; as I'm not sure as to which scope facets should be used there |
|
This is a for each loop. A for loop refers to the c-style for loops with an incrementing integer. for val in sequence {} |
That's what I thought, thanks—I just wanted to make sure. I'll remove the TODO and mark the c-style for as |
…despite scopes working in editor
|
As far as I can tell, I'm not doing anything too incorrectly when defining the if-else scopes in |
|
You can use the parse tree command from cursorless-talon-dev to have a look at the parse tree for the tests that are failing and try to figure out why you don't get a match. cursorless/cursorless-talon-dev/src/cursorless_dev.talon Lines 38 to 39 in c090b01 Also I would like you to have a look at how the scope tests are formatted for other languages as well as our format guide. Right now you don't use the standard names or formatting. Also all the recorded tests are not necessary. I don't really know what's up with the folder names, but we only need scope tests when you add a language. The recorded test are either for actions modifiers or just legacy language before we had the scope tests. |
It wasn't that the tests were failing in of themselves, but failing to generate in the first place. I was able to figure out what was going on there and got it working as of the most recent commit.
I didn't realize there was a style guide for those, sorry! It's quite late here so I'll fix those tomorrow.
I have no clue what's up with those either, they're very much not intentionally added and I pretty quickly realized they weren't supposed to be there and stopped including them in commits. I'll go through and remove those manually tomorrow as well. Very good chance they're generating due to something weird in my personal setup, but if other people (on macOS or more generally) start seeing similar behavior when adding scopes to languages/adding new languages to Cursorless, it might be worth investigating separately. |
…cope support, redo scope tests to better fit style guide
two todos (lowercase ones) are questions, while the one that is upercase is a 'proper; todo
|
Just realized five minutes after committing that the ancestor checker predicate is overkill for the purpose I created it for, and that the single-parent check would've worked fine. I'll switch that the next time I have time and capacity to work on this, then, which might not be for a week or so. Lmk if I should also remove the new predicate outright or if it should stay in, since I'm not quite sure if it's possible for someone to make a language feature where it would be necessary? |
|
We can always add the predicate if it's needed. For now please remove any unused code. |
Very much a work in progress right now. The three things that need to be done before this is ready are finishing filling out the list of
unsupportedfacets, getting the test fixtures atresources/fixtures/scopes/swift/branch.if.else.scope,resources/fixtures/scopes/swift/branch.if.scope, andresources/fixtures/scopes/swift/condition.if.scopeto generate properly, and figuring out the language plugin situation for VSCode testing specifically. Apparently, Swift shares the problem gdscript has where the language support extension only runs in a particular environment, so it's going to need the bare-bones language support extension trick as well. I've created a draft for such a thing already and it seems to work fine; should that be put in its own repository and uploaded to the VSCode and OpenVSC marketplaces, or should it live as part of the monorepo?