Skip to content

Commit

Permalink
Updated Readme with less catastrophic writing (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshjoshi authored Jun 26, 2024
1 parent 1bef342 commit abb0045
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.env.*
!.env.example

/.pants.d/
/build/
/coverage/
/dist/
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!assets/pants-logo-square.png
!dist/main.js
!schemas/lift.schema.json
!schemas/science.schema.json
!schemas/lift.toml.json
!syntaxes/language-configuration.json
!syntaxes/pantsbuild.tmLanguage.json
!CHANGELOG.md
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Note: This will currently not work!

The merged code is in the process of being cleaned up and re-written, and it requires a change to `peek` that has not been mainlined. So, for a few weeks, this source code will be super janky.

# Suspenders

Suspenders is a (very) alpha VS Code extension to provide [Pants](https://github.com/pantsbuild/pants) users with some quality-of-workflow improvements.
Suspenders is an alpha VS Code extension to provide [Pants](https://github.com/pantsbuild/pants) users with some quality-of-workflow improvements.

**Note:** A lot of this functionality is proof-of-concept, as Pants requires some additions and optimizations to be able to provide a good experience in VS Code. This extension is being used to determine what can be done, and what needs to be added to Pants. As features are added in Pants, those features can remove the "proof-of-concept" label from this extension.
This repo contains several proof-of-concepts, as Pants requires some additions and optimizations to be able to provide a good experience in VS Code. However, I've found enough utility in several features (e.g. BUILD LSP and TOML schema), that I would consider this a useful plugin to have for Pants users/developers/maintainers.

## Activation

The extension is loaded upon there being a `pants.toml` file in the workspace root.

Expand All @@ -27,6 +25,14 @@ In addition, the command palette has been enhanced with several pants specific c

Experimental build file LSP support was added in [PR #105](https://github.com/RobotPajamas/suspenders/pull/105). It currently requires a manual step of opening the command palette and selecting "Pants: Re-generate BUILD LSP data". This generates BUILD file Python stubs, and restarts `pyright` which now knows to look for those stubs.

### Pants.toml JSON Schema

There is already a JSON schema file uploaded to schema store for each minor release of Pants (e.g. https://json.schemastore.org/pantsbuild-2.21.0.json). Users can setup [Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml) to point to this schema.

Suspenders, however, will generate a `pants.toml` JSON schema for your currently enabled backends upon running "Pants: Re-generate BUILD LSP data". This schema is a subset of the one on schema store.

The only real difference to the user is that the schema store variant might show autocompletions that aren't available until the user activates a specific backend, while the Suspenders-generated version shouldn't have that use case.

## Recommended Plugins

- [Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml) - Provides syntax highlighting for `pants.toml` files, and allows using a Pants.toml JSON schema for validation.
Expand Down
2 changes: 1 addition & 1 deletion schemas/lift.toml.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Generated schema for Science config",
"title": "Generated schema for Lift config",
"type": "object",
"properties": {
"lift": {
Expand Down
2 changes: 1 addition & 1 deletion src/lsp/lift.toml.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Generated schema for Science config",
"title": "Generated schema for Lift config",
"type": "object",
"properties": {
"lift": {
Expand Down

0 comments on commit abb0045

Please sign in to comment.