Skip to content
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

Update VSCode plugin #1895

Merged
merged 21 commits into from
Jun 9, 2024
Merged

Update VSCode plugin #1895

merged 21 commits into from
Jun 9, 2024

Conversation

xsebek
Copy link
Member

@xsebek xsebek commented Jun 4, 2024

  • Update VSCode plugin NPM package
  • Update VSCode syntax
    • Rewrite the definition rule to make it simpler and work with multiline types
      • Use shared #types group with added support for rec
    • Refactor groups to use ordered include patterns and unordered repository of named subgroups
    • Add escape sequences to strings
  • Fix a typo in a regular expression that broke syntax highlighting
  • Generate the syntax JSON file from YAML

@xsebek
Copy link
Member Author

xsebek commented Jun 4, 2024

@byorgey I changed the VSCode swarm syntax parts that I knew were outdated (tydef, case sensitive types) and tried to simplify it. It is still broken, because it stops too early on a line and does not highlight everything:
Screenshot 2024-06-04 at 6 44 57
Note the missing highlighting for end after some other swarm code

I will try to find out what is causing this problem and add more tests, so that this syntax does not rot again.
This old blog post from 2014 that complains about lack of documentation for TextMate grammar has some good insights:
https://www.apeth.com/nonblog/stories/textmatebundle.html

Also the JSON format without comments is annoying, I will have to setup YAML → JSON conversion. 😄

@xsebek xsebek marked this pull request as ready for review June 9, 2024 12:12
@xsebek xsebek requested review from kostmo and byorgey June 9, 2024 12:12
editors/vscode/syntaxes/swarm.tmLanguage.yaml Outdated Show resolved Hide resolved
editors/vscode/DEVELOPING.md Outdated Show resolved Hide resolved
editors/vscode/syntaxes/.gitignore Show resolved Hide resolved
mergify bot pushed a commit that referenced this pull request Jun 9, 2024
When running on macOS, the integration tests open too many file handles,
even when you do not need to run any swarm file tests.
```sh
> cabal run -O0 swarm-integration -- -p editors
swarm-integration: data/scenarios/Challenges/_bucket-brigade/hauler.sw: openFile: resource exhausted (Too many open files)
```
The solution is to get the file paths only and safely open them as needed.
Surprisingly, this even makes the integration test code simpler.

* discovered while fixing failing tests in #1895
@xsebek xsebek added the merge me Trigger the merge process of the Pull request. label Jun 9, 2024
mergify bot pushed a commit that referenced this pull request Jun 9, 2024
* fix an LSP exception on top level comment

Found while testing #1895.
@mergify mergify bot merged commit 478b62c into main Jun 9, 2024
12 checks passed
@mergify mergify bot deleted the vscode branch June 9, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update VSCode configuration to do syntax highlighting for tydef
3 participants