Add vscode workspaces and settings (#387)

* Add recommended root extensions

* Add typescript and solidity workspace settings

* Add rust settings and extensions

* Update some root settings

* Comment unused rust vars as revealed by analyzer

* Remove root extensions in favor of workspace

* Update README with VSCode hint
pull/392/head
Yorke Rhodes 3 years ago committed by GitHub
parent a9f3397b37
commit 1d572ba887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      README.md
  2. 43
      mono.code-workspace
  3. 13
      rust/.vscode/extensions.json
  4. 6
      rust/.vscode/settings.json
  5. 8
      rust/abacus-base/src/contract_sync/mod.rs
  6. 14
      solidity/.vscode/extensions.json
  7. 11
      solidity/.vscode/settings.json
  8. 12
      typescript/.vscode/extensions.json
  9. 8
      typescript/.vscode/settings.json

@ -65,32 +65,28 @@ Commits (and tags) for this repo require [signature verification](https://docs.g
### Workspaces
This monorepo uses [NPM Workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces/). Installing dependencies, building, testing, and running prettier for all packages can be done from the root directory of the repository.
This monorepo uses [Yarn Workspaces](https://yarnpkg.com/features/workspaces). Installing dependencies, building, testing, and running prettier for all packages can be done from the root directory of the repository.
- Installing dependencies
```bash
npm install
yarn install
```
- Building
```bash
npm run build
```
- Testing
```bash
npm run test
yarn build
```
- Running prettier
```bash
npm run prettier
yarn prettier
```
If you are using [VSCode](https://code.visualstudio.com/), you can launch the [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) with `code mono.code-workspace`, install the recommended workspace extensions, and use the editor settings.
### Rust
- install [`rustup`](https://rustup.rs)

@ -0,0 +1,43 @@
{
"settings": {
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications", // only formats git changes
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.configPath": ".prettierrc",
"workbench.editor.labelFormat": "medium",
"npm.packageManager": "yarn",
"npm.enableRunFromFolder": true,
"npm.scriptExplorerAction": "run",
"npm.fetchOnlinePackageInfo": true,
"scm.diffDecorationsGutterPattern": {
"added": true
},
},
"folders": [
{
"path": "./typescript"
},
{
"path": "./solidity"
},
{
"path": "./rust"
}
],
"extensions": {
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"GitHub.copilot-nightly",
"GitHub.vscode-pull-request-github",
"eamodio.gitlens",
"bierner.github-markdown-preview",
"ms-vsliveshare.vsliveshare-pack",
"esbenp.prettier-vscode"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
}

@ -0,0 +1,13 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"panicbit.cargo",
"tamasfe.even-better-toml",
"matklad.rust-analyzer",
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}

@ -0,0 +1,6 @@
{
"files.exclude": {
"target": true,
"**/bin": true,
},
}

@ -588,10 +588,10 @@ mod test {
#[tokio::test]
async fn handles_missing_rpc_messages() {
test_utils::run_test_db(|db| async move {
let first_root = H256::from([0; 32]);
let second_root = H256::from([1; 32]);
let third_root = H256::from([2; 32]);
let fourth_root = H256::from([2; 32]);
// let first_root = H256::from([0; 32]);
// let second_root = H256::from([1; 32]);
// let third_root = H256::from([2; 32]);
// let fourth_root = H256::from([2; 32]);
let mut message_vec = vec![];
AbacusMessage {

@ -0,0 +1,14 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"JuanBlanco.solidity",
"tintinweb.vscode-ethover",
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
]
}

@ -0,0 +1,11 @@
{
"files.exclude": {
"**/node_modules": true,
"**/*.js": {"when": "$(basename).ts"},
"**/*.map": {"when": "$(basename).map"},
"**/artifacts": true,
"**/cache": true,
"**/dist": true,
"**/types": true,
},
}

@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"tintinweb.vscode-ethover",
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
]
}

@ -0,0 +1,8 @@
{
"files.exclude": {
"**/node_modules": true,
"**/*.js": {"when": "$(basename).ts"},
"**/*.map": {"when": "$(basename).map"},
"**/dist": true,
},
}
Loading…
Cancel
Save