Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
adds formatter capabilities using typstfmt (#243)
Browse files Browse the repository at this point in the history
* adds formatter capabilities using typstfmt

* hide the formatter behind an experimental option

* update readme

* run prettier

* fix cargo deny

* cargo update

* simplify

* change hash to rev

* add deny exception for typstfmt

* log ExternalPackageManager's provider success

* look for local packages in the right directory

* don't return time information from datetime.today

* use more scope/thread functions

* correctly detect subpaths

* build(deps-dev): bump the vscode-deps group

Bumps the vscode-deps group in /editors/vscode with 2 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [eslint](https://github.com/eslint/eslint).


Updates `@types/node` from 20.4.9 to 20.5.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `eslint` from 8.46.0 to 8.47.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.46.0...v8.47.0)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: vscode-deps
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: vscode-deps
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump the rust-deps group with 1 update

Bumps the rust-deps group with 1 update: [tokio](https://github.com/tokio-rs/tokio).

- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-1.30.0...tokio-1.31.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-deps
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump versions to v0.9.2

* use correct source/pdf URIs

* bump versions to v0.9.3

* dynamically register formatter

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: nvarner <nathanmvarner@protonmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nathan Varner <17197562+nvarner@users.noreply.github.com>
  • Loading branch information
4 people authored Aug 19, 2023
1 parent bc8b418 commit fc6af75
Show file tree
Hide file tree
Showing 10 changed files with 281 additions and 33 deletions.
117 changes: 88 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ tracing-subscriber = { version = "0.3.17", default-features = false, features =
"fmt",
] }
walkdir = "2.3"
typstfmt_lib = { git = "https://github.com/astrale-sharp/typstfmt", rev = "8404a15" }

# jaeger
opentelemetry = { version = "0.20.0", optional = true }
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A language server for [Typst](https://typst.app/).
- Syntax highlighting, error reporting, code completion, and function signature
help
- Compiles to PDF on save (configurable to as-you-type, or can be disabled)
- Experimental formatting using [typstfmt](https://github.com/astrale-sharp/typstfmt)

This repo consists of:

Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ skip-tree = [
[sources]
unknown-registry = "deny"
unknown-git = "deny"
allow-git = ["https://github.com/astrale-sharp/typstfmt.git"]

[sources.allow-org]
github = ["typst"]
16 changes: 15 additions & 1 deletion editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@
],
"default": "off",
"description": "Traces the communication between VS Code and the language server."
},
"typst-lsp.experimentalFormatterMode": {
"title": "Enable Experimental Formatter",
"description": "The extension can format Typst files using typstfmt (experimental).",
"type": "string",
"default": "off",
"enum": [
"off",
"on"
],
"enumDescriptions": [
"Formatter is not activated.",
"Experimental formatter is activated."
]
}
}
},
Expand Down Expand Up @@ -312,13 +326,13 @@
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@vscode/vsce": "^2.20.1",
"ovsx": "^0.8.3",
"esbuild": "^0.19.0",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-promise": "^6.1.1",
"ovsx": "^0.8.3",
"prettier": "^3.0.1",
"typescript": "^5.1.6"
}
Expand Down
Loading

0 comments on commit fc6af75

Please sign in to comment.