Bump Rust version to nightly-2021-06-17 (https://github.com/enso-org/ide/pull/1675)

Original commit: 8b971cd7cd
This commit is contained in:
Michael Mauderer 2021-07-20 15:50:38 +01:00 committed by GitHub
parent a085ab41a2
commit 69be61133c
100 changed files with 232 additions and 694 deletions

View File

@ -104,7 +104,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly-2021-05-12 toolchain: nightly-2021-06-17
override: true override: true
- name: Install Prettier - name: Install Prettier
run: npm install --save-dev --save-exact prettier run: npm install --save-dev --save-exact prettier
@ -133,7 +133,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly-2021-05-12 toolchain: nightly-2021-06-17
override: true override: true
- name: Run tests (no WASM) - name: Run tests (no WASM)
run: node ./run test --no-wasm --skip-version-validation run: node ./run test --no-wasm --skip-version-validation
@ -154,7 +154,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly-2021-05-12 toolchain: nightly-2021-06-17
override: true override: true
- name: Install wasm-pack (macOS) - name: Install wasm-pack (macOS)
env: env:
@ -208,7 +208,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly-2021-05-12 toolchain: nightly-2021-06-17
override: true override: true
- name: Install wasm-pack (macOS) - name: Install wasm-pack (macOS)
env: env:
@ -285,7 +285,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly-2021-05-12 toolchain: nightly-2021-06-17
override: true override: true
- name: Install wasm-pack (macOS) - name: Install wasm-pack (macOS)
env: env:

View File

@ -1,481 +1,8 @@
{ {
"name": "build-script", "name": "build-script",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 2, "lockfileVersion": 1,
"requires": true, "requires": true,
"packages": {
"": {
"name": "build-script",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"glob": "^7.1.6",
"js-yaml": "4.0.0",
"ncp": "^2.0.0",
"semver": "7.3.4",
"yargs": "^15.3.0"
},
"devDependencies": {
"prettier": "2.2.0",
"prettier-plugin-toml": "0.3.1"
}
},
"node_modules/@toml-tools/lexer": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/@toml-tools/lexer/-/lexer-0.3.1.tgz",
"integrity": "sha512-CCKHQb5OWpgFu47MQ2rcql4AnE9GaehNk/c1oJOyOBovED6XmdzQPXsvPSu+NJ9lToqJNoX+nLXQsB8WyQGdzQ==",
"dev": true,
"dependencies": {
"chevrotain": "4.1.1"
}
},
"node_modules/@toml-tools/parser": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/@toml-tools/parser/-/parser-0.3.1.tgz",
"integrity": "sha512-vadwVx5TkgByt19dbp/rfIUKPkDdn5werANYvziiGK9wHlqPA0BWnvOloQw/dPDxF31+Ag0+zarXJpPDdRsPPg==",
"dev": true,
"dependencies": {
"@toml-tools/lexer": "^0.3.1",
"chevrotain": "4.1.1"
}
},
"node_modules/@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
},
"node_modules/ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"engines": {
"node": ">=8"
}
},
"node_modules/ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dependencies": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"node_modules/balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"engines": {
"node": ">=6"
}
},
"node_modules/chevrotain": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-4.1.1.tgz",
"integrity": "sha512-NQky1HQyiAzxsxpq4Ppt47SYO2U3JLtmfs85QPf3kYSzGBjjp5AA8kqjH8hCjGFRpaQ781QOk1ragQIOkBgUTA==",
"dev": true,
"dependencies": {
"regexp-to-ast": "0.3.5"
}
},
"node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"node_modules/decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
}
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"engines": {
"node": ">=8"
}
},
"node_modules/js-yaml": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz",
"integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==",
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dependencies": {
"p-locate": "^4.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/ncp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
"integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=",
"bin": {
"ncp": "bin/ncp"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/p-limit": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz",
"integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==",
"dependencies": {
"p-try": "^2.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dependencies": {
"p-limit": "^2.2.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"engines": {
"node": ">=8"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/prettier": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.0.tgz",
"integrity": "sha512-yYerpkvseM4iKD/BXLYUkQV5aKt4tQPqaGW6EsZjzyu0r7sVZZNPJW4Y8MyKmicp6t42XUPcBVA+H6sB3gqndw==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/prettier-plugin-toml": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/prettier-plugin-toml/-/prettier-plugin-toml-0.3.1.tgz",
"integrity": "sha512-j47DEO/dN/acU1nSL/B7q4A4Z2SYJhpWPCLPkcmfAXIQC6A5GD6Ao/bi9HRHZ8ueIDOauqjuAQbnvRxLXMjazA==",
"dev": true,
"dependencies": {
"@toml-tools/parser": "^0.3.1",
"prettier": "^1.16.0"
}
},
"node_modules/prettier-plugin-toml/node_modules/prettier": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=4"
}
},
"node_modules/regexp-to-ast": {
"version": "0.3.5",
"resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.3.5.tgz",
"integrity": "sha512-1CJygtdvsfNFwiyjaMLBWtg2tfEqx/jSZ8S6TV+GlNL8kiH8rb4cm5Pb7A/C2BpyM/fA8ZJEudlCwi/jvAY+Ow==",
"dev": true
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
},
"node_modules/semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
},
"node_modules/string-width": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
"integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dependencies": {
"ansi-regex": "^5.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/which-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
},
"node_modules/wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"node_modules/y18n": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
},
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"node_modules/yargs": {
"version": "15.3.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.0.tgz",
"integrity": "sha512-g/QCnmjgOl1YJjGsnUg2SatC7NUYEiLXJqxNOQU9qSpjzGtGXda9b+OKccr1kLTy8BN9yqEyqfq5lxlwdc13TA==",
"dependencies": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"dependencies": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
},
"engines": {
"node": ">=6"
}
}
},
"dependencies": { "dependencies": {
"@toml-tools/lexer": { "@toml-tools/lexer": {
"version": "0.3.1", "version": "0.3.1",

View File

@ -14,7 +14,7 @@ const yaml = require('js-yaml')
// ================= // =================
const NODE_VERSION = '14.15.0' const NODE_VERSION = '14.15.0'
const RUST_VERSION = 'nightly-2021-05-12' const RUST_VERSION = read_rust_toolchain_version()
const WASM_PACK_VERSION = '0.9.1' const WASM_PACK_VERSION = '0.9.1'
const FLAG_NO_CHANGELOG_NEEDED = '[ci no changelog needed]' const FLAG_NO_CHANGELOG_NEEDED = '[ci no changelog needed]'
const FLAG_FORCE_CI_BUILD = '[ci build]' const FLAG_FORCE_CI_BUILD = '[ci build]'
@ -25,6 +25,10 @@ const FLAG_FORCE_CI_BUILD = '[ci build]'
// === Utils === // === Utils ===
// ============= // =============
function read_rust_toolchain_version() {
return fss.readFileSync(paths.root + "/rust-toolchain").toString().trim()
}
function job(platforms,name,steps,cfg) { function job(platforms,name,steps,cfg) {
if (!cfg) { cfg = {} } if (!cfg) { cfg = {} }
return { return {

View File

@ -19,7 +19,7 @@ async function init () {
console.log("Checking versions of installed packages.") console.log("Checking versions of installed packages.")
await cmd.check_version('node',node_lts_version) await cmd.check_version('node',node_lts_version)
await cmd.check_version('npm',npm_lts_version) await cmd.check_version('npm',npm_lts_version)
await cmd.check_version('rustc','1.54.0-nightly',{ await cmd.check_version('rustc','1.55.0-nightly',{
preprocess:(v)=>v.substring(6,20) preprocess:(v)=>v.substring(6,20)
}) })
} }

View File

@ -1 +1 @@
nightly-2021-05-12 nightly-2021-06-17

View File

@ -49,7 +49,7 @@ pub fn entry_point_complex_shape_system() {
let world = World::new(&web::get_html_element_by_id("root").unwrap()); let world = World::new(&web::get_html_element_by_id("root").unwrap());
let scene = world.scene(); let scene = world.scene();
let camera = scene.camera().clone_ref(); let camera = scene.camera().clone_ref();
let navigator = Navigator::new(&scene,&camera); let navigator = Navigator::new(scene,&camera);
let logger = Logger::new("ShapeView"); let logger = Logger::new("ShapeView");
let theme_manager = theme::Manager::from(&scene.style_sheet); let theme_manager = theme::Manager::from(&scene.style_sheet);

View File

@ -85,7 +85,7 @@ pub fn entry_point_dom_symbols() {
iter_to_change = 50; iter_to_change = 50;
i = (i + 1) % 2; i = (i + 1) % 2;
for (j, object) in css3d_objects.iter_mut().enumerate() { for (j, object) in css3d_objects.iter_mut().enumerate() {
layers[(i + j) % 2].manage(&object); layers[(i + j) % 2].manage(object);
} }
} }
iter_to_change -= 1; iter_to_change -= 1;

View File

@ -140,7 +140,7 @@ pub fn entry_point_mouse_events() {
let scene = app.display.scene(); let scene = app.display.scene();
let camera = scene.camera().clone_ref(); let camera = scene.camera().clone_ref();
let navigator = Navigator::new(&scene,&camera); let navigator = Navigator::new(scene,&camera);
std::mem::forget(shape); std::mem::forget(shape);
std::mem::forget(navigator); std::mem::forget(navigator);

View File

@ -64,7 +64,7 @@ fn init(app:&Application) {
// === Scroll Area === // === Scroll Area ===
let scroll_area = ScrollArea::new(&app); let scroll_area = ScrollArea::new(app);
app.display.add_child(&scroll_area); app.display.add_child(&scroll_area);
scroll_area.resize(Vector2(200.0,200.0)); scroll_area.resize(Vector2(200.0,200.0));
scroll_area.set_content_width(300.0); scroll_area.set_content_width(300.0);

View File

@ -43,7 +43,7 @@ pub fn entry_point_shape_system() {
let world = World::new(&web::get_html_element_by_id("root").unwrap()); let world = World::new(&web::get_html_element_by_id("root").unwrap());
let scene = world.scene(); let scene = world.scene();
let camera = scene.camera().clone_ref(); let camera = scene.camera().clone_ref();
let navigator = Navigator::new(&scene,&camera); let navigator = Navigator::new(scene,&camera);
let sprite_system = ShapeSystem::new(&world,&shape()); let sprite_system = ShapeSystem::new(&world,&shape());
let sprite = sprite_system.new_instance(); let sprite = sprite_system.new_instance();
sprite.size.set(Vector2::new(300.0, 300.0)); sprite.size.set(Vector2::new(300.0, 300.0));

View File

@ -18,7 +18,7 @@ pub fn entry_point_sprite_system() {
let world = World::new(&web::get_html_element_by_id("root").unwrap()); let world = World::new(&web::get_html_element_by_id("root").unwrap());
let scene = world.scene(); let scene = world.scene();
let camera = scene.camera().clone_ref(); let camera = scene.camera().clone_ref();
let navigator = Navigator::new(&scene,&camera); let navigator = Navigator::new(scene,&camera);
let sprite_system = SpriteSystem::new(&world); let sprite_system = SpriteSystem::new(&world);
let sprite2 = sprite_system.new_instance(); let sprite2 = sprite_system.new_instance();

View File

@ -24,7 +24,7 @@ pub fn entry_point_sprite_system_benchmark() {
let world = World::new(&web::get_html_element_by_id("root").unwrap()); let world = World::new(&web::get_html_element_by_id("root").unwrap());
let scene = world.scene(); let scene = world.scene();
let camera = scene.camera().clone_ref(); let camera = scene.camera().clone_ref();
let navigator = Navigator::new(&scene,&camera); let navigator = Navigator::new(scene,&camera);
let sprite_system = SpriteSystem::new(&world); let sprite_system = SpriteSystem::new(&world);
let sprite1 = sprite_system.new_instance(); let sprite1 = sprite_system.new_instance();

View File

@ -77,7 +77,7 @@ impl<M:Model,F:Frp<M>> Component<M,F> {
impl<M: display::Object,F> display::Object for Component<M,F> { impl<M: display::Object,F> display::Object for Component<M,F> {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.display_object() self.model.display_object()
} }
} }

View File

@ -224,7 +224,7 @@ impl DropDownMenu {
// === Layouting === // === Layouting ===
let menu_height = DEPRECATED_Animation::<f32>::new(&network); let menu_height = DEPRECATED_Animation::<f32>::new(network);
eval menu_height.value ([model](height) { eval menu_height.value ([model](height) {

View File

@ -263,9 +263,9 @@ impl ListView {
let model = &self.model; let model = &self.model;
let scene = app.display.scene(); let scene = app.display.scene();
let mouse = &scene.mouse.frp; let mouse = &scene.mouse.frp;
let view_y = DEPRECATED_Animation::<f32>::new(&network); let view_y = DEPRECATED_Animation::<f32>::new(network);
let selection_y = DEPRECATED_Animation::<f32>::new(&network); let selection_y = DEPRECATED_Animation::<f32>::new(network);
let selection_height = DEPRECATED_Animation::<f32>::new(&network); let selection_height = DEPRECATED_Animation::<f32>::new(network);
frp::extend!{ network frp::extend!{ network

View File

@ -446,7 +446,7 @@ impl List {
debug!(logger, "Setting new model {model:?} for entry {id}; \ debug!(logger, "Setting new model {model:?} for entry {id}; \
old entry: {entry.id.get():?}."); old entry: {entry.id.get():?}.");
match model { match model {
Some(model) => entry.set_model(id,&model), Some(model) => entry.set_model(id,model),
None => { None => {
error!(logger, "Model provider didn't return model for id {id}."); error!(logger, "Model provider didn't return model for id {id}.");
entry.set_model(id,&default()) entry.set_model(id,&default())

View File

@ -91,10 +91,10 @@ impl ScrollArea {
let content = display::object::Instance::new(&logger); let content = display::object::Instance::new(&logger);
display_object.add_child(&content); display_object.add_child(&content);
let h_scrollbar = Scrollbar::new(&app); let h_scrollbar = Scrollbar::new(app);
display_object.add_child(&h_scrollbar); display_object.add_child(&h_scrollbar);
let v_scrollbar = Scrollbar::new(&app); let v_scrollbar = Scrollbar::new(app);
display_object.add_child(&v_scrollbar); display_object.add_child(&v_scrollbar);
v_scrollbar.set_rotation_z(-90.0_f32.to_radians()); v_scrollbar.set_rotation_z(-90.0_f32.to_radians());

View File

@ -19,6 +19,8 @@ use crate::shadow;
struct Background { struct Background {
pub width : Var<Pixels>, pub width : Var<Pixels>,
pub height : Var<Pixels>, pub height : Var<Pixels>,
#[allow(dead_code)]
// This field is not used but should stay as part of the API for future use.
pub corner_radius : Var<Pixels>, pub corner_radius : Var<Pixels>,
pub shape : AnyShape, pub shape : AnyShape,
} }
@ -129,7 +131,11 @@ pub mod track {
/// Struct that contains the shape used to indicate an overflow (a triangle), and some metadata /// Struct that contains the shape used to indicate an overflow (a triangle), and some metadata
/// that can be used to place and align it. /// that can be used to place and align it.
struct OverflowShape { struct OverflowShape {
#[allow(dead_code)]
// This field is not used but should stay as part of the API for future use.
pub width : Var<Pixels>, pub width : Var<Pixels>,
#[allow(dead_code)]
// This field is not used but should stay as part of the API for future use.
pub height : Var<Pixels>, pub height : Var<Pixels>,
pub shape : AnyShape pub shape : AnyShape
} }

View File

@ -74,10 +74,10 @@ pub fn from_shape_with_parameters_and_alpha
let shadow = shadow.translate((parameters.offset_x.px(),parameters.offset_y.px())); let shadow = shadow.translate((parameters.offset_x.px(),parameters.offset_y.px()));
let base_color = Var::<color::Rgba>::from(parameters.base_color); let base_color = Var::<color::Rgba>::from(parameters.base_color);
let base_color = base_color.multiply_alpha(&alpha); let base_color = base_color.multiply_alpha(alpha);
let fading_color = Var::<color::Rgba>::from(parameters.fading); let fading_color = Var::<color::Rgba>::from(parameters.fading);
let fading_color = fading_color.multiply_alpha(&alpha); let fading_color = fading_color.multiply_alpha(alpha);
let shadow_color = color::gradient::Linear::<Var<color::LinearRgba>> let shadow_color = color::gradient::Linear::<Var<color::LinearRgba>>
::new(fading_color.into_linear(),base_color.into_linear()); ::new(fading_color.into_linear(),base_color.into_linear());
@ -95,7 +95,7 @@ pub fn add_to_dom_element(element:&DomSymbol, style:&StyleWatch,logger:&Logger)
let blur = style.get_number(ensogl_theme::shadow::html::blur); let blur = style.get_number(ensogl_theme::shadow::html::blur);
let spread = style.get_number(ensogl_theme::shadow::html::spread); let spread = style.get_number(ensogl_theme::shadow::html::spread);
let shadow = format!("{}px {}px {}px {}px rgba(0,0,0,{})",off_x,off_y,blur,spread,alpha); let shadow = format!("{}px {}px {}px {}px rgba(0,0,0,{})",off_x,off_y,blur,spread,alpha);
element.dom().set_style_or_warn("box-shadow",shadow,&logger); element.dom().set_style_or_warn("box-shadow",shadow,logger);
} }

View File

@ -256,6 +256,6 @@ impl<Shape:ColorableShape+'static> ToggleButton<Shape>{
impl<T:display::Object> display::Object for ToggleButton<T> { impl<T:display::Object> display::Object for ToggleButton<T> {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.icon.display_object() self.model.icon.display_object()
} }
} }

View File

@ -234,7 +234,7 @@ where F:AnyFnEasing, OnStep:Callback<T>, OnEnd:Callback<EndStatus> {
/// Start the animator. /// Start the animator.
pub fn start(&self) { pub fn start(&self) {
if self.animation_loop.get().is_none() { if self.animation_loop.get().is_none() {
let animation_loop = animation::Loop::new(step(&self)); let animation_loop = animation::Loop::new(step(self));
self.animation_loop.set(Some(animation_loop)); self.animation_loop.set(Some(animation_loop));
self.data.active.set(true); self.data.active.set(true);
} }

View File

@ -69,7 +69,7 @@ where Callback : RawLoopCallback {
let weak_data = Rc::downgrade(&data); let weak_data = Rc::downgrade(&data);
let on_frame = move |time| weak_data.upgrade().for_each(|t| t.borrow_mut().run(time)); let on_frame = move |time| weak_data.upgrade().for_each(|t| t.borrow_mut().run(time));
data.borrow_mut().on_frame = Some(Closure::new(on_frame)); data.borrow_mut().on_frame = Some(Closure::new(on_frame));
let handle_id = web::request_animation_frame(&data.borrow_mut().on_frame.as_ref().unwrap()); let handle_id = web::request_animation_frame(data.borrow_mut().on_frame.as_ref().unwrap());
data.borrow_mut().handle_id = handle_id; data.borrow_mut().handle_id = handle_id;
Self {data} Self {data}
} }

View File

@ -606,7 +606,7 @@ where T:Value, OnStep:Callback1<T>, OnStart:Callback0, OnEnd:Callback1<EndStatus
fn start(&self) { fn start(&self) {
if self.animation_loop.get().is_none() { if self.animation_loop.get().is_none() {
let frame_rate = self.frame_rate.get(); let frame_rate = self.frame_rate.get();
let step = step(&self); let step = step(self);
let animation_loop = animation::Loop::new_with_fixed_frame_rate(frame_rate,step); let animation_loop = animation::Loop::new_with_fixed_frame_rate(frame_rate,step);
self.animation_loop.set(Some(animation_loop)); self.animation_loop.set(Some(animation_loop));
self.on_start.call(); self.on_start.call();

View File

@ -251,7 +251,7 @@ impl Registry {
mouse_down <- mouse.down.map (f!((t) model.shortcuts_registry.on_press(t.simple_name()))); mouse_down <- mouse.down.map (f!((t) model.shortcuts_registry.on_press(t.simple_name())));
mouse_up <- mouse.up.map (f!((t) model.shortcuts_registry.on_release(t.simple_name()))); mouse_up <- mouse.up.map (f!((t) model.shortcuts_registry.on_release(t.simple_name())));
event <- any(kb_down,kb_up,mouse_down,mouse_up); event <- any(kb_down,kb_up,mouse_down,mouse_up);
eval event ((m) model.process_rules(&m)); eval event ((m) model.process_rules(m));
} }
Self {model,network} Self {model,network}
} }

View File

@ -39,7 +39,7 @@ impl NavigatorModel {
let max_zoom = 10000.0; let max_zoom = 10000.0;
let disable_events = Rc::new(Cell::new(true)); let disable_events = Rc::new(Cell::new(true));
let (simulator,resize_callback,_events) = Self::start_navigator_events let (simulator,resize_callback,_events) = Self::start_navigator_events
(&scene,camera,min_zoom,max_zoom,Rc::clone(&zoom_speed),Rc::clone(&pan_speed), (scene,camera,min_zoom,max_zoom,Rc::clone(&zoom_speed),Rc::clone(&pan_speed),
Rc::clone(&disable_events)); Rc::clone(&disable_events));
Self {_events,simulator,resize_callback,zoom_speed,pan_speed,disable_events} Self {_events,simulator,resize_callback,zoom_speed,pan_speed,disable_events}
} }
@ -64,7 +64,7 @@ impl NavigatorModel {
, pan_speed : SharedSwitch<f32> , pan_speed : SharedSwitch<f32>
, disable_events : Rc<Cell<bool>> , disable_events : Rc<Cell<bool>>
) -> (physics::inertia::DynSimulator<Vector3>,callback::Handle,NavigatorEvents) { ) -> (physics::inertia::DynSimulator<Vector3>,callback::Handle,NavigatorEvents) {
let simulator = Self::create_simulator(&camera); let simulator = Self::create_simulator(camera);
let panning_callback = enclose!((scene,camera,mut simulator,pan_speed) move |pan: PanEvent| { let panning_callback = enclose!((scene,camera,mut simulator,pan_speed) move |pan: PanEvent| {
let fovy_slope = camera.half_fovy_slope(); let fovy_slope = camera.half_fovy_slope();
let distance = camera.position().z; let distance = camera.position().z;

View File

@ -430,7 +430,7 @@ impl Dom {
/// Constructor. /// Constructor.
pub fn new(logger:&Logger) -> Self { pub fn new(logger:&Logger) -> Self {
let root = web::create_div(); let root = web::create_div();
let layers = DomLayers::new(&logger,&root); let layers = DomLayers::new(logger,&root);
root.set_class_name("scene"); root.set_class_name("scene");
root.set_style_or_panic("height" , "100vh"); root.set_style_or_panic("height" , "100vh");
root.set_style_or_panic("width" , "100vw"); root.set_style_or_panic("width" , "100vw");
@ -478,20 +478,20 @@ impl DomLayers {
let front = DomScene::new(logger); let front = DomScene::new(logger);
let fullscreen_vis = DomScene::new(logger); let fullscreen_vis = DomScene::new(logger);
let back = DomScene::new(logger); let back = DomScene::new(logger);
canvas.set_style_or_warn("height" , "100vh" , &logger); canvas.set_style_or_warn("height" , "100vh" , logger);
canvas.set_style_or_warn("width" , "100vw" , &logger); canvas.set_style_or_warn("width" , "100vw" , logger);
canvas.set_style_or_warn("display" , "block" , &logger); canvas.set_style_or_warn("display" , "block" , logger);
// Position must not be "static" to have z-index working. // Position must not be "static" to have z-index working.
canvas.set_style_or_warn("position" , "absolute", &logger); canvas.set_style_or_warn("position" , "absolute", logger);
canvas.set_style_or_warn("z-index" , "2" , &logger); canvas.set_style_or_warn("z-index" , "2" , logger);
canvas.set_style_or_warn("pointer-events", "none" , &logger); canvas.set_style_or_warn("pointer-events", "none" , logger);
front.dom.set_class_name("front"); front.dom.set_class_name("front");
front.dom.set_style_or_warn("z-index", "3", &logger); front.dom.set_style_or_warn("z-index", "3", logger);
back.dom.set_class_name("back"); back.dom.set_class_name("back");
back.dom.set_style_or_warn("pointer-events", "auto", &logger); back.dom.set_style_or_warn("pointer-events", "auto", logger);
back.dom.set_style_or_warn("z-index" , "0" , &logger); back.dom.set_style_or_warn("z-index" , "0" , logger);
fullscreen_vis.dom.set_class_name("fullscreen_vis"); fullscreen_vis.dom.set_class_name("fullscreen_vis");
fullscreen_vis.dom.set_style_or_warn("z-index" , "1" , &logger); fullscreen_vis.dom.set_style_or_warn("z-index" , "1" , logger);
dom.append_or_panic(&canvas); dom.append_or_panic(&canvas);
dom.append_or_panic(&front.dom); dom.append_or_panic(&front.dom);
dom.append_or_panic(&back.dom); dom.append_or_panic(&back.dom);
@ -779,7 +779,7 @@ impl SceneData {
let on_change = enclose!((dirty_flag) move || dirty_flag.set()); let on_change = enclose!((dirty_flag) move || dirty_flag.set());
let var_logger = Logger::sub(&logger,"global_variables"); let var_logger = Logger::sub(&logger,"global_variables");
let variables = UniformScope::new(var_logger); let variables = UniformScope::new(var_logger);
let symbols = SymbolRegistry::mk(&variables,&stats,&logger,on_change); let symbols = SymbolRegistry::mk(&variables,stats,&logger,on_change);
// FIXME: This should be abstracted away and should also handle context loss when Symbol // FIXME: This should be abstracted away and should also handle context loss when Symbol
// definition will be finally refactored in such way, that it would not require // definition will be finally refactored in such way, that it would not require
// Scene instance to be created. // Scene instance to be created.

View File

@ -68,7 +68,7 @@ fn setup_camera_perspective(dom:&web::JsValue, near:f32, matrix:&Matrix4<f32>) {
// details. // details.
unsafe { unsafe {
let matrix_array = matrix.js_buffer_view(); let matrix_array = matrix.js_buffer_view();
js::setup_camera_perspective(&dom,&near.into(),&matrix_array) js::setup_camera_perspective(dom,&near.into(),&matrix_array)
} }
} }
@ -79,7 +79,7 @@ fn setup_camera_orthographic(dom:&web::JsValue, matrix:&Matrix4<f32>) {
// details. // details.
unsafe { unsafe {
let matrix_array = matrix.js_buffer_view(); let matrix_array = matrix.js_buffer_view();
js::setup_camera_orthographic(&dom,&matrix_array) js::setup_camera_orthographic(dom,&matrix_array)
} }
} }
@ -186,7 +186,7 @@ impl DomScene {
let dom = object.dom(); let dom = object.dom();
let data = &self.data; let data = &self.data;
if object.is_visible() { if object.is_visible() {
self.view_projection_dom.append_or_panic(&dom); self.view_projection_dom.append_or_panic(dom);
} }
object.display_object().set_on_hide(f_!(dom.remove())); object.display_object().set_on_hide(f_!(dom.remove()));
object.display_object().set_on_show(f__!([data,dom] { object.display_object().set_on_show(f__!([data,dom] {

View File

@ -467,7 +467,7 @@ impl LayerModel {
graph.extend(self.depth_order.borrow().clone().into_iter()); graph.extend(self.depth_order.borrow().clone().into_iter());
for element in &*self.elements.borrow() { for element in &*self.elements.borrow() {
if let LayerElement::ShapeSystem(id) = element { if let LayerElement::ShapeSystem(id) = element {
if let Some(info) = self.shape_system_to_symbol_info_map.borrow().get(&id) { if let Some(info) = self.shape_system_to_symbol_info_map.borrow().get(id) {
for &id2 in &info.below { graph.insert_dependency(*element,id2.into()); } for &id2 in &info.below { graph.insert_dependency(*element,id2.into()); }
for &id2 in &info.above { graph.insert_dependency(id2.into(),*element); } for &id2 in &info.above { graph.insert_dependency(id2.into(),*element); }
} }

View File

@ -47,7 +47,7 @@ pub fn set_object_transform(dom:&web::JsValue, matrix:&Matrix4<f32>) {
// details. // details.
unsafe { unsafe {
let matrix_array = matrix.js_buffer_view(); let matrix_array = matrix.js_buffer_view();
js::set_object_transform(&dom,&matrix_array); js::set_object_transform(dom,&matrix_array);
} }
} }

View File

@ -292,8 +292,8 @@ impl Symbol {
let shader_dirty = ShaderDirty::new(mat_dirt_logger,Box::new(on_mut)); let shader_dirty = ShaderDirty::new(mat_dirt_logger,Box::new(on_mut));
let surface_on_mut = Box::new(f!(surface_dirty.set())); let surface_on_mut = Box::new(f!(surface_dirty.set()));
let shader_on_mut = Box::new(f!(shader_dirty.set())); let shader_on_mut = Box::new(f!(shader_dirty.set()));
let shader = Shader::new(shader_logger,&stats,shader_on_mut); let shader = Shader::new(shader_logger,stats,shader_on_mut);
let surface = Mesh::new(surface_logger,&stats,surface_on_mut); let surface = Mesh::new(surface_logger,stats,surface_on_mut);
let variables = UniformScope::new(Logger::sub(&logger,"uniform_scope")); let variables = UniformScope::new(Logger::sub(&logger,"uniform_scope"));
let global_variables = global_variables.clone_ref(); let global_variables = global_variables.clone_ref();
let bindings = default(); let bindings = default();
@ -540,10 +540,10 @@ impl Symbol {
/// is executed, both program and VAO are bound to None. /// is executed, both program and VAO are bound to None.
fn with_program<F:FnOnce(&WebGlProgram)>(&self, context:&Context, f:F) { fn with_program<F:FnOnce(&WebGlProgram)>(&self, context:&Context, f:F) {
if let Some(program) = self.shader.program().as_ref() { if let Some(program) = self.shader.program().as_ref() {
context.use_program(Some(&program)); context.use_program(Some(program));
let bindings = self.bindings.borrow(); let bindings = self.bindings.borrow();
if let Some(vao) = bindings.vao.as_ref() { if let Some(vao) = bindings.vao.as_ref() {
vao.with(|| { f(&program) }); vao.with(|| { f(program) });
} }
context.use_program(None); context.use_program(None);
} }

View File

@ -137,7 +137,7 @@ impl World {
// TODO: We may want to enable it on weak hardware. // TODO: We may want to enable it on weak hardware.
// pixel_read_pass.set_threshold(1); // pixel_read_pass.set_threshold(1);
let pipeline = RenderPipeline::new() let pipeline = RenderPipeline::new()
.add(SymbolsRenderPass::new(&self.scene.symbols(),&self.scene.layers)) .add(SymbolsRenderPass::new(self.scene.symbols(),&self.scene.layers))
.add(ScreenRenderPass::new(self)) .add(ScreenRenderPass::new(self))
.add(pixel_read_pass); .add(pixel_read_pass);
self.scene.renderer.set_pipeline(pipeline); self.scene.renderer.set_pipeline(pipeline);

View File

@ -261,17 +261,17 @@ impl Cursor {
// host during the movement. After it is fully attached, cursor moves with the same // host during the movement. After it is fully attached, cursor moves with the same
// speed as the scene when panning. // speed as the scene when panning.
// //
let press = Animation :: <f32> :: new(&network); let press = Animation :: <f32> :: new(network);
let radius = DEPRECATED_Animation :: <f32> :: new(&network); let radius = DEPRECATED_Animation :: <f32> :: new(network);
let size = DEPRECATED_Animation :: <Vector2> :: new(&network); let size = DEPRECATED_Animation :: <Vector2> :: new(network);
let offset = DEPRECATED_Animation :: <Vector2> :: new(&network); let offset = DEPRECATED_Animation :: <Vector2> :: new(network);
let color_lab = DEPRECATED_Animation :: <Vector3> :: new(&network); let color_lab = DEPRECATED_Animation :: <Vector3> :: new(network);
let color_alpha = DEPRECATED_Animation :: <f32> :: new(&network); let color_alpha = DEPRECATED_Animation :: <f32> :: new(network);
let inactive_fade = DEPRECATED_Animation :: <f32> :: new(&network); let inactive_fade = DEPRECATED_Animation :: <f32> :: new(network);
let host_position = DEPRECATED_Animation :: <Vector3> :: new(&network); let host_position = DEPRECATED_Animation :: <Vector3> :: new(network);
let host_follow_weight = DEPRECATED_Animation :: <f32> :: new(&network); let host_follow_weight = DEPRECATED_Animation :: <f32> :: new(network);
let host_attached_weight = DEPRECATED_Tween :: new(&network); let host_attached_weight = DEPRECATED_Tween :: new(network);
let port_selection_layer_weight = Animation :: <f32> :: new(&network); let port_selection_layer_weight = Animation :: <f32> :: new(network);
host_attached_weight.set_duration(300.0); host_attached_weight.set_duration(300.0);
color_lab.set_target_value(DEFAULT_COLOR.opaque.into()); color_lab.set_target_value(DEFAULT_COLOR.opaque.into());

View File

@ -13,7 +13,6 @@
#![feature(fn_traits)] #![feature(fn_traits)]
#![feature(specialization)] #![feature(specialization)]
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(try_trait)]
#![feature(marker_trait_attr)] #![feature(marker_trait_attr)]
#![feature(min_type_alias_impl_trait)] #![feature(min_type_alias_impl_trait)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]

View File

@ -58,7 +58,7 @@ TextureReload for Texture<GpuOnly,I,T> {
let format = Self::gl_format().into(); let format = Self::gl_format().into();
let elem_type = Self::gl_elem_type(); let elem_type = Self::gl_elem_type();
self.context().bind_texture(target,Some(&self.gl_texture())); self.context().bind_texture(target,Some(self.gl_texture()));
self.context().tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array self.context().tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array
(target,level,internal_format,width,height,border,format,elem_type,None).unwrap(); (target,level,internal_format,width,height,border,format,elem_type,None).unwrap();

View File

@ -62,7 +62,7 @@ Texture<RemoteImage,I,T> {
let height = 1; let height = 1;
let border = 0; let border = 0;
let color = vec![0,0,255,255]; let color = vec![0,0,255,255];
self.context().bind_texture(Context::TEXTURE_2D,Some(&self.gl_texture())); self.context().bind_texture(Context::TEXTURE_2D,Some(self.gl_texture()));
self.context().tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array self.context().tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array
(target,level,internal_format,width,height,border,format,elem_type,Some(&color)).unwrap(); (target,level,internal_format,width,height,border,format,elem_type,Some(&color)).unwrap();
} }

View File

@ -72,21 +72,21 @@ pub trait CompilationTarget {
impl CompilationTarget for Shader { impl CompilationTarget for Shader {
fn check(&self, ctx: &Context) -> bool { fn check(&self, ctx: &Context) -> bool {
ctx.get_shader_parameter(&self, Context::COMPILE_STATUS).as_bool().unwrap_or(false) ctx.get_shader_parameter(self, Context::COMPILE_STATUS).as_bool().unwrap_or(false)
} }
fn logs(&self, ctx: &Context) -> String { fn logs(&self, ctx: &Context) -> String {
unwrap_error(ctx.get_shader_info_log(&self)) unwrap_error(ctx.get_shader_info_log(self))
} }
} }
impl CompilationTarget for Program { impl CompilationTarget for Program {
fn check(&self, ctx: &Context) -> bool { fn check(&self, ctx: &Context) -> bool {
ctx.get_program_parameter(&self, Context::LINK_STATUS).as_bool().unwrap_or(false) ctx.get_program_parameter(self, Context::LINK_STATUS).as_bool().unwrap_or(false)
} }
fn logs(&self, ctx: &Context) -> String { fn logs(&self, ctx: &Context) -> String {
unwrap_error(ctx.get_program_info_log(&self)) unwrap_error(ctx.get_program_info_log(self))
} }
} }
@ -160,7 +160,7 @@ pub fn link_program(ctx:&Context, vert_shader:&Shader, frag_shader:&Shader) -> R
/// Set the array buffer data with floats. /// Set the array buffer data with floats.
pub fn set_buffer_data(gl_context:&Context, buffer:&WebGlBuffer, data:&[f32]) { pub fn set_buffer_data(gl_context:&Context, buffer:&WebGlBuffer, data:&[f32]) {
let target = Context::ARRAY_BUFFER; let target = Context::ARRAY_BUFFER;
gl_context.bind_buffer(target,Some(&buffer)); gl_context.bind_buffer(target,Some(buffer));
set_bound_buffer_data(gl_context,target,data); set_bound_buffer_data(gl_context,target,data);
} }
@ -175,7 +175,7 @@ pub fn set_buffer_data(gl_context:&Context, buffer:&WebGlBuffer, data:&[f32]) {
fn set_bound_buffer_data(gl_context:&Context, target:u32, data:&[f32]) { fn set_bound_buffer_data(gl_context:&Context, target:u32, data:&[f32]) {
let usage = Context::STATIC_DRAW; let usage = Context::STATIC_DRAW;
unsafe { unsafe {
let float_array = Float32Array::view(&data); let float_array = Float32Array::view(data);
gl_context.buffer_data_with_array_buffer_view(target,&float_array,usage); gl_context.buffer_data_with_array_buffer_view(target,&float_array,usage);
} }
} }
@ -183,7 +183,7 @@ fn set_bound_buffer_data(gl_context:&Context, target:u32, data:&[f32]) {
/// Set the array buffer fragment with with floats. /// Set the array buffer fragment with with floats.
pub fn set_buffer_subdata(gl_context:&Context, buffer:&WebGlBuffer, offset:usize, data:&[f32]) { pub fn set_buffer_subdata(gl_context:&Context, buffer:&WebGlBuffer, offset:usize, data:&[f32]) {
let target = Context::ARRAY_BUFFER; let target = Context::ARRAY_BUFFER;
gl_context.bind_buffer(target,Some(&buffer)); gl_context.bind_buffer(target,Some(buffer));
set_bound_buffer_subdata(gl_context,target,offset as i32,data); set_bound_buffer_subdata(gl_context,target,offset as i32,data);
} }
@ -197,7 +197,7 @@ pub fn set_buffer_subdata(gl_context:&Context, buffer:&WebGlBuffer, offset:usize
#[allow(unsafe_code)] #[allow(unsafe_code)]
fn set_bound_buffer_subdata(gl_context:&Context, target:u32, offset:i32, data:&[f32]) { fn set_bound_buffer_subdata(gl_context:&Context, target:u32, offset:i32, data:&[f32]) {
unsafe { unsafe {
let float_array = Float32Array::view(&data); let float_array = Float32Array::view(data);
gl_context.buffer_sub_data_with_i32_and_array_buffer_view(target,offset,&float_array); gl_context.buffer_sub_data_with_i32_and_array_buffer_view(target,offset,&float_array);
} }
} }

View File

@ -92,7 +92,7 @@ mod deja_vu {
pub fn download_and_extract_all_fonts(out_dir : &path::Path) { pub fn download_and_extract_all_fonts(out_dir : &path::Path) {
let package_path = out_dir.join(PACKAGE.filename); let package_path = out_dir.join(PACKAGE.filename);
PACKAGE.download(&out_dir); PACKAGE.download(out_dir);
extract_all_fonts(package_path.as_path()); extract_all_fonts(package_path.as_path());
} }

View File

@ -306,7 +306,7 @@ impl Area {
let mouse = &scene.mouse.frp; let mouse = &scene.mouse.frp;
let input = &self.frp.input; let input = &self.frp.input;
let out = &self.frp.output; let out = &self.frp.output;
let pos = DEPRECATED_Animation :: <Vector2> :: new(&network); let pos = DEPRECATED_Animation :: <Vector2> :: new(network);
let keyboard = &scene.keyboard; let keyboard = &scene.keyboard;
let m = &model; let m = &model;
pos.update_spring(|spring| spring*2.0); pos.update_spring(|spring| spring*2.0);

View File

@ -1026,7 +1026,7 @@ impl Crumbable for crate::Match<Ast> {
fn iter_subcrumbs<'a>(&'a self) -> Box<dyn Iterator<Item=Self::Crumb> + 'a> { fn iter_subcrumbs<'a>(&'a self) -> Box<dyn Iterator<Item=Self::Crumb> + 'a> {
let mut crumbs = vec![]; let mut crumbs = vec![];
if let Some(pat) = &self.pfx { if let Some(pat) = &self.pfx {
for crumb in pattern_subcrumbs(&pat) { for crumb in pattern_subcrumbs(pat) {
crumbs.push(MatchCrumb::Pfx{val:crumb}); crumbs.push(MatchCrumb::Pfx{val:crumb});
} }
} }
@ -1051,7 +1051,7 @@ impl Crumbable for crate::Ambiguous<Ast> {
AmbiguousSegmentCrumb::Body => AmbiguousSegmentCrumb::Body =>
&seg.body.as_ref().ok_or_else(|| NotPresent("body".into()))?.wrapped, &seg.body.as_ref().ok_or_else(|| NotPresent("body".into()))?.wrapped,
}; };
Ok(&ast) Ok(ast)
} }
fn set(&self, crumb:&Self::Crumb, new_ast:Ast) -> FallibleResult<Self> { fn set(&self, crumb:&Self::Crumb, new_ast:Ast) -> FallibleResult<Self> {

View File

@ -314,7 +314,7 @@ impl Ast {
/// Returned index is the position of the first character of child's text representation within /// Returned index is the position of the first character of child's text representation within
/// the text representation of this AST node. /// the text representation of this AST node.
pub fn child_offset(&self, child:&Ast) -> FallibleResult<Index> { pub fn child_offset(&self, child:&Ast) -> FallibleResult<Index> {
let searched_token = Token::Ast(&child); let searched_token = Token::Ast(child);
let mut found_child = false; let mut found_child = false;
let mut position = 0; let mut position = 0;
self.shape().feed_to(&mut |token:Token| { self.shape().feed_to(&mut |token:Token| {

View File

@ -83,7 +83,7 @@ pub fn as_lambda(ast:&Ast) -> Option<LambdaInfo> {
let arg = ast.get_located(child_iter.next()?).ok()?; let arg = ast.get_located(child_iter.next()?).ok()?;
let opr = ast.get_located(child_iter.next()?).ok()?; let opr = ast.get_located(child_iter.next()?).ok()?;
let body = ast.get_located(child_iter.next()?).ok()?; let body = ast.get_located(child_iter.next()?).ok()?;
let is_arrow = crate::opr::is_arrow_opr(&opr.item); let is_arrow = crate::opr::is_arrow_opr(opr.item);
is_arrow.then_some(LambdaInfo {arg,opr,body}) is_arrow.then_some(LambdaInfo {arg,opr,body})
} }

View File

@ -346,12 +346,12 @@ impl Chain {
/// If this is infix, it flattens whole chain and returns result. /// If this is infix, it flattens whole chain and returns result.
/// Otherwise, returns None. /// Otherwise, returns None.
pub fn try_new(ast:&Ast) -> Option<Chain> { pub fn try_new(ast:&Ast) -> Option<Chain> {
GeneralizedInfix::try_new(&ast).map(|infix| infix.flatten()) GeneralizedInfix::try_new(ast).map(|infix| infix.flatten())
} }
/// Flattens infix chain if this is infix application of given operator. /// Flattens infix chain if this is infix application of given operator.
pub fn try_new_of(ast:&Ast, operator:&str) -> Option<Chain> { pub fn try_new_of(ast:&Ast, operator:&str) -> Option<Chain> {
let infix = GeneralizedInfix::try_new(&ast)?; let infix = GeneralizedInfix::try_new(ast)?;
(infix.name() == operator).as_some_from(|| infix.flatten()) (infix.name() == operator).as_some_from(|| infix.flatten())
} }

View File

@ -237,7 +237,7 @@ pub fn to_variant_types
let variant_decls = variant_idents.iter().zip(structs.iter()) let variant_decls = variant_idents.iter().zip(structs.iter())
.map(|(i,v)| gen_variant_decl(i,v)); .map(|(i,v)| gen_variant_decl(i,v));
let variant_froms = variant_idents.iter().zip(structs.iter()) let variant_froms = variant_idents.iter().zip(structs.iter())
.map(|(i,v)| gen_from_impls(i, &decl, &v)); .map(|(i,v)| gen_from_impls(i, &decl, v));
// Handle single value, unnamed params as created by user. // Handle single value, unnamed params as created by user.
let structs = structs.iter().filter(|v| match &v.fields { let structs = structs.iter().filter(|v| match &v.fields {
@ -267,7 +267,7 @@ pub fn derive_has_tokens
(input:proc_macro::TokenStream) -> proc_macro::TokenStream { (input:proc_macro::TokenStream) -> proc_macro::TokenStream {
let decl = syn::parse_macro_input!(input as syn::DeriveInput); let decl = syn::parse_macro_input!(input as syn::DeriveInput);
let ret = match decl.data { let ret = match decl.data {
syn::Data::Enum(ref e) => token::derive_for_enum(&decl, &e), syn::Data::Enum(ref e) => token::derive_for_enum(&decl, e),
_ => quote! {}, _ => quote! {},
}; };
proc_macro::TokenStream::from(ret) proc_macro::TokenStream::from(ret)

View File

@ -308,7 +308,7 @@ impl SerializableUnion for FromServerPayloadOwned {
Success::create(builder, &SuccessArgs {}).as_union_value() Success::create(builder, &SuccessArgs {}).as_union_value()
} }
FromServerPayloadOwned::Error {code,message,data} => { FromServerPayloadOwned::Error {code,message,data} => {
let message = builder.create_string(&message); let message = builder.create_string(message);
let data_serialized = data.serialize(builder); let data_serialized = data.serialize(builder);
Error::create(builder, &ErrorArgs { Error::create(builder, &ErrorArgs {
code : *code, code : *code,
@ -318,13 +318,13 @@ impl SerializableUnion for FromServerPayloadOwned {
}).as_union_value() }).as_union_value()
} }
FromServerPayloadOwned::FileContentsReply {contents} => { FromServerPayloadOwned::FileContentsReply {contents} => {
let contents = builder.create_vector(&contents); let contents = builder.create_vector(contents);
FileContentsReply::create(builder, &FileContentsReplyArgs { FileContentsReply::create(builder, &FileContentsReplyArgs {
contents : Some(contents) contents : Some(contents)
}).as_union_value() }).as_union_value()
} }
FromServerPayloadOwned::VisualizationUpdate {data,context} => { FromServerPayloadOwned::VisualizationUpdate {data,context} => {
let data = builder.create_vector(&data); let data = builder.create_vector(data);
let context = context.serialize(builder); let context = context.serialize(builder);
VisualisationUpdate::create(builder, &VisualisationUpdateArgs { VisualisationUpdate::create(builder, &VisualisationUpdateArgs {
data : Some(data), data : Some(data),

View File

@ -216,7 +216,7 @@ pub fn decode_incoming_message
use serde_json::Value; use serde_json::Value;
use serde_json::from_str; use serde_json::from_str;
use serde_json::from_value; use serde_json::from_value;
let message = from_str::<Message<Value>>(&message)?; let message = from_str::<Message<Value>>(message)?;
from_value::<IncomingMessage>(message.payload) from_value::<IncomingMessage>(message.payload)
} }

View File

@ -112,13 +112,13 @@ impl SourceFile {
} }
/// Get fragment of serialized string with code. /// Get fragment of serialized string with code.
pub fn code_slice(&self) -> &str { &self.slice(&self.code) } pub fn code_slice(&self) -> &str { self.slice(&self.code) }
/// Get fragment of serialized string with id map. /// Get fragment of serialized string with id map.
pub fn id_map_slice (&self) -> &str { &self.slice(&self.id_map) } pub fn id_map_slice (&self) -> &str { self.slice(&self.id_map) }
/// Get fragment of serialized string with metadata. /// Get fragment of serialized string with metadata.
pub fn metadata_slice(&self) -> &str { &self.slice(&self.metadata) } pub fn metadata_slice(&self) -> &str { self.slice(&self.metadata) }
fn slice(&self, range:&Range<ByteIndex>) -> &str { fn slice(&self, range:&Range<ByteIndex>) -> &str {
&self.content[range.start.value..range.end.value] &self.content[range.start.value..range.end.value]

View File

@ -130,7 +130,7 @@ impl Parser {
/// deeply nested ASTs. /// deeply nested ASTs.
pub fn from_json_str_without_recursion_limit<'de, Value:serde::Deserialize<'de>>(json_text:&'de str) pub fn from_json_str_without_recursion_limit<'de, Value:serde::Deserialize<'de>>(json_text:&'de str)
-> Result<Value,serde_json::Error> { -> Result<Value,serde_json::Error> {
let mut de = serde_json::Deserializer::from_str(&json_text); let mut de = serde_json::Deserializer::from_str(json_text);
de.disable_recursion_limit(); de.disable_recursion_limit();
Value::deserialize(&mut de) Value::deserialize(&mut de)
} }

View File

@ -39,6 +39,7 @@ pub const PORT_VAR: &str = "ENSO_PARSER_PORT";
pub type Result<T> = std::result::Result<T, Error>; pub type Result<T> = std::result::Result<T, Error>;
#[allow(clippy::enum_variant_names)]
#[derive(Debug, Fail)] #[derive(Debug, Fail)]
pub enum Error { pub enum Error {
#[fail(display = "Failed to parse given address url: {}", _0)] #[fail(display = "Failed to parse given address url: {}", _0)]
@ -88,6 +89,7 @@ impl From<serde_json::error::Error> for Error {
// ============== // ==============
/// All request supported by the Parser Service. /// All request supported by the Parser Service.
#[allow(clippy::enum_variant_names)]
#[derive(Debug, serde::Serialize, serde::Deserialize)] #[derive(Debug, serde::Serialize, serde::Deserialize)]
pub enum Request { pub enum Request {
ParseRequest { program : String, ids : IdMap }, ParseRequest { program : String, ids : IdMap },

View File

@ -115,7 +115,7 @@ impl<'a,T> Implementation for node::Ref<'a,T> {
let kind = &ins_point.kind; let kind = &ins_point.kind;
let ast = root.get_traversing(&self.ast_crumbs)?; let ast = root.get_traversing(&self.ast_crumbs)?;
let expect_arg = matches!(kind, ExpectedArgument(_)); let expect_arg = matches!(kind, ExpectedArgument(_));
let extended_infix = (!expect_arg).and_option_from(|| ast::opr::Chain::try_new(&ast)); let extended_infix = (!expect_arg).and_option_from(|| ast::opr::Chain::try_new(ast));
let new_ast = modify_preserving_id(ast, |ast| let new_ast = modify_preserving_id(ast, |ast|
if let Some(mut infix) = extended_infix { if let Some(mut infix) = extended_infix {
let item = ArgWithOffset {arg:new, offset:DEFAULT_OFFSET}; let item = ArgWithOffset {arg:new, offset:DEFAULT_OFFSET};

View File

@ -376,7 +376,7 @@ fn generate_node_for_known_match<T:Payload>
let children_kind = node::Kind::argument().with_removable(removable); let children_kind = node::Kind::argument().with_removable(removable);
let mut gen = ChildGenerator::default(); let mut gen = ChildGenerator::default();
if let Some(pat) = &this.pfx { if let Some(pat) = &this.pfx {
for macros::AstInPattern {ast,crumbs} in macros::all_ast_nodes_in_pattern(&pat) { for macros::AstInPattern {ast,crumbs} in macros::all_ast_nodes_in_pattern(pat) {
let ast_crumb = ast::crumbs::MatchCrumb::Pfx {val:crumbs}; let ast_crumb = ast::crumbs::MatchCrumb::Pfx {val:crumbs};
let located_ast = Located::new(ast_crumb,ast.wrapped); let located_ast = Located::new(ast_crumb,ast.wrapped);
gen.generate_ast_node(located_ast,children_kind.clone(),context)?; gen.generate_ast_node(located_ast,children_kind.clone(),context)?;

View File

@ -64,18 +64,18 @@ impl<'a> PatternDfs<'a> {
fn push_children_to_visit(&mut self, pattern:&LocatedPattern<'a>) { fn push_children_to_visit(&mut self, pattern:&LocatedPattern<'a>) {
use ast::MacroPatternMatchRaw::*; use ast::MacroPatternMatchRaw::*;
match pattern.pattern.deref() { match pattern.pattern.deref() {
Except(pat) => self.push_child_to_visit(&pattern,&pat.elem,PatternMatchCrumb::Except), Except(pat) => self.push_child_to_visit(pattern,&pat.elem,PatternMatchCrumb::Except),
Tag(pat) => self.push_child_to_visit(&pattern,&pat.elem,PatternMatchCrumb::Tag), Tag(pat) => self.push_child_to_visit(pattern,&pat.elem,PatternMatchCrumb::Tag),
Cls(pat) => self.push_child_to_visit(&pattern,&pat.elem,PatternMatchCrumb::Cls), Cls(pat) => self.push_child_to_visit(pattern,&pat.elem,PatternMatchCrumb::Cls),
Or(pat) => self.push_child_to_visit(&pattern,&pat.elem,PatternMatchCrumb::Or), Or(pat) => self.push_child_to_visit(pattern,&pat.elem,PatternMatchCrumb::Or),
Seq(pat) => { Seq(pat) => {
let (left_elem,right_elem) = &pat.elem; let (left_elem,right_elem) = &pat.elem;
self.push_child_to_visit(&pattern,right_elem,PatternMatchCrumb::Seq{right:true}); self.push_child_to_visit(pattern,right_elem,PatternMatchCrumb::Seq{right:true});
self.push_child_to_visit(&pattern,left_elem ,PatternMatchCrumb::Seq{right:false}); self.push_child_to_visit(pattern,left_elem ,PatternMatchCrumb::Seq{right:false});
}, },
Many(pat) => { Many(pat) => {
for (index,elem) in pat.elem.iter().enumerate().rev() { for (index,elem) in pat.elem.iter().enumerate().rev() {
self.push_child_to_visit(&pattern,elem,PatternMatchCrumb::Many {index}); self.push_child_to_visit(pattern,elem,PatternMatchCrumb::Many {index});
} }
} }
// Other patterns does not have children. // Other patterns does not have children.

View File

@ -56,7 +56,7 @@ impl<'a,T:Payload> Iterator for LeafIterator<'a,T> {
impl<'a,T> LeafIterator<'a,T> { impl<'a,T> LeafIterator<'a,T> {
/// Create iterator iterating over leafs of subtree rooted on `node`. /// Create iterator iterating over leafs of subtree rooted on `node`.
pub fn new(node: node::Ref<'a,T>, fragment:TreeFragment) -> Self { pub fn new(node: node::Ref<'a,T>, fragment:TreeFragment) -> Self {
let stack = vec![StackFrame {node:&node.node, child_being_visited:0}]; let stack = vec![StackFrame {node:node.node, child_being_visited:0}];
let next_node = node.node.children.first().map(|ch| &ch.node); let next_node = node.node.children.first().map(|ch| &ch.node);
let base_node = node; let base_node = node;
let mut this = Self {stack,next_node,base_node,fragment}; let mut this = Self {stack,next_node,base_node,fragment};
@ -81,8 +81,8 @@ impl<'a,T> LeafIterator<'a,T> {
fn descend_to_leaf(&mut self) { fn descend_to_leaf(&mut self) {
if let Some(mut current) = std::mem::take(&mut self.next_node) { if let Some(mut current) = std::mem::take(&mut self.next_node) {
while self.can_descend(&current) && !current.children.is_empty() { while self.can_descend(current) && !current.children.is_empty() {
self.stack.push(StackFrame { node: &current, child_being_visited: 0 }); self.stack.push(StackFrame { node: current, child_being_visited: 0 });
current = &current.children.first().unwrap().node; current = &current.children.first().unwrap().node;
} }
self.next_node = Some(current); self.next_node = Some(current);

View File

@ -502,7 +502,7 @@ impl<'a,T:Payload> Ref<'a,T> {
Some(self) Some(self)
} else { } else {
self.children_iter().find_map(|ch| self.children_iter().find_map(|ch|
ch.span().contains_span(span).and_option_from(|| ch.find_by_span(&span)) ch.span().contains_span(span).and_option_from(|| ch.find_by_span(span))
) )
} }
} }
@ -511,7 +511,7 @@ impl<'a,T:Payload> Ref<'a,T> {
impl<'a,T> Deref for Ref<'a,T> { impl<'a,T> Deref for Ref<'a,T> {
type Target = Node<T>; type Target = Node<T>;
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
&self.node self.node
} }
} }
@ -671,7 +671,7 @@ impl<'a,T:Payload> RefMut<'a,T> {
impl<'a,T> Deref for RefMut<'a,T> { impl<'a,T> Deref for RefMut<'a,T> {
type Target = Node<T>; type Target = Node<T>;
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
&self.node self.node
} }
} }

View File

@ -220,7 +220,7 @@ impl ParsedInput {
} }
fn new_from_ast(ast:&Ast) -> Self { fn new_from_ast(ast:&Ast) -> Self {
let prefix = ast::prefix::Chain::from_ast_non_strict(&ast); let prefix = ast::prefix::Chain::from_ast_non_strict(ast);
ParsedInput { ParsedInput {
expression : Some(ast::Shifted::new(default(),prefix)), expression : Some(ast::Shifted::new(default(),prefix)),
pattern_offset : 0, pattern_offset : 0,
@ -335,7 +335,7 @@ impl ThisNode {
// form. If we wanted to support pattern subparts, the engine would need to send us // form. If we wanted to support pattern subparts, the engine would need to send us
// value updates for matched pattern pieces. See the issue: // value updates for matched pattern pieces. See the issue:
// https://github.com/enso-org/enso/issues/1038 // https://github.com/enso-org/enso/issues/1038
(ast::identifier::as_var(&ast)?.to_owned(),false) (ast::identifier::as_var(ast)?.to_owned(),false)
} else { } else {
(graph.variable_name_for(&node.info).ok()?.repr(),true) (graph.variable_name_for(&node.info).ok()?.repr(),true)
}; };
@ -392,7 +392,7 @@ impl FragmentAddedByPickingSuggestion {
fn code_to_insert(&self, current_module:&QualifiedName, this_node:&Option<ThisNode>) -> CodeToInsert { fn code_to_insert(&self, current_module:&QualifiedName, this_node:&Option<ThisNode>) -> CodeToInsert {
let generate_this = self.id != CompletedFragmentId::Function || this_node.is_none(); let generate_this = self.id != CompletedFragmentId::Function || this_node.is_none();
self.picked_suggestion.code_to_insert(Some(&current_module),generate_this) self.picked_suggestion.code_to_insert(Some(current_module),generate_this)
} }
} }
@ -542,7 +542,7 @@ impl Searcher {
/// in a new action list (the appropriate notification will be emitted). /// in a new action list (the appropriate notification will be emitted).
pub fn set_input(&self, new_input:String) -> FallibleResult { pub fn set_input(&self, new_input:String) -> FallibleResult {
debug!(self.logger, "Manually setting input to {new_input}."); debug!(self.logger, "Manually setting input to {new_input}.");
let parsed_input = ParsedInput::new(new_input,&self.ide.parser())?; let parsed_input = ParsedInput::new(new_input,self.ide.parser())?;
let old_expr = self.data.borrow().input.expression.repr(); let old_expr = self.data.borrow().input.expression.repr();
let new_expr = parsed_input.expression.repr(); let new_expr = parsed_input.expression.repr();

View File

@ -84,7 +84,7 @@ impl Handle {
use FileHandle::*; use FileHandle::*;
match &self.file { match &self.file {
PlainText {path,language_server} => { PlainText {path,language_server} => {
let response = language_server.read_file(&path).await; let response = language_server.read_file(path).await;
response.map(|response| response.contents) response.map(|response| response.contents)
}, },
Module{controller} => Ok(controller.code()) Module{controller} => Ok(controller.code())

View File

@ -150,7 +150,7 @@ impl Handle {
}, },
VisualizationPath::File(path) => { VisualizationPath::File(path) => {
let project = visualization::path::Project::CurrentProject; let project = visualization::path::Project::CurrentProject;
let js_code = self.language_server_rpc.read_file(&path).await?.contents; let js_code = self.language_server_rpc.read_file(path).await?.contents;
let wrap_error = |err| { let wrap_error = |err| {
Error::js_preparation_error(visualization.clone(),err).into() Error::js_preparation_error(visualization.clone(),err).into()
}; };

View File

@ -196,7 +196,7 @@ impl AliasAnalyzer {
/// Processes the given AST, while crumb is temporarily pushed to the current location. /// Processes the given AST, while crumb is temporarily pushed to the current location.
fn process_located_ast(&mut self, located_ast:&Located<impl Borrow<Ast>>) { fn process_located_ast(&mut self, located_ast:&Located<impl Borrow<Ast>>) {
self.in_location_of(&located_ast, |this| this.process_ast(located_ast.item.borrow())) self.in_location_of(located_ast, |this| this.process_ast(located_ast.item.borrow()))
} }
/// Processes subtrees of the given AST denoted by given crumbs /// Processes subtrees of the given AST denoted by given crumbs
@ -223,7 +223,7 @@ impl AliasAnalyzer {
/// ///
/// This is the primary function that is recursively being called as the AST is being traversed. /// This is the primary function that is recursively being called as the AST is being traversed.
pub fn process_ast(&mut self, ast:&Ast) { pub fn process_ast(&mut self, ast:&Ast) {
if let Some(definition) = DefinitionInfo::from_line_ast(&ast,ScopeKind::NonRoot,default()) { if let Some(definition) = DefinitionInfo::from_line_ast(ast,ScopeKind::NonRoot,default()) {
self.process_definition(&definition) self.process_definition(&definition)
} else if let Some(assignment) = ast::opr::to_assignment(ast) { } else if let Some(assignment) = ast::opr::to_assignment(ast) {
self.process_assignment(&assignment); self.process_assignment(&assignment);

View File

@ -40,9 +40,9 @@ impl Endpoint {
_ => None, _ => None,
}?; }?;
let line_ast = block.get(&line_crumb).ok()?; let line_ast = block.get(&line_crumb).ok()?;
let definition = DefinitionInfo::from_line_ast(&line_ast,ScopeKind::NonRoot,block.indent); let definition = DefinitionInfo::from_line_ast(line_ast,ScopeKind::NonRoot,block.indent);
let is_non_def = definition.is_none(); let is_non_def = definition.is_none();
let node = is_non_def.and_option_from(|| NodeInfo::from_line_ast(&line_ast))?.id(); let node = is_non_def.and_option_from(|| NodeInfo::from_line_ast(line_ast))?.id();
Some(Endpoint { node, crumbs }) Some(Endpoint { node, crumbs })
} }
} }

View File

@ -175,8 +175,8 @@ impl QualifiedName {
let text = text.as_ref(); let text = text.as_ref();
let segments = text.split(ACCESS); let segments = text.split(ACCESS);
if let [ref project_name,ref id_segments @ ..] = *segments.collect_vec().as_slice() { if let [project_name,ref id_segments @ ..] = *segments.collect_vec().as_slice() {
let project_name = ReferentName::new(*project_name)?; let project_name = ReferentName::new(project_name)?;
let id = Id::try_new(id_segments)?; let id = Id::try_new(id_segments)?;
Ok(Self::new(project_name,id)) Ok(Self::new(project_name,id))
} else { } else {
@ -489,7 +489,7 @@ impl Info {
pub fn add_module_import pub fn add_module_import
(&mut self, here:&QualifiedName, parser:&parser::Parser, to_add:&QualifiedName) { (&mut self, here:&QualifiedName, parser:&parser::Parser, to_add:&QualifiedName) {
let is_here = to_add == here; let is_here = to_add == here;
let import = ImportInfo::from_qualified_name(&to_add); let import = ImportInfo::from_qualified_name(to_add);
let already_imported = self.iter_imports().any(|imp| imp == import); let already_imported = self.iter_imports().any(|imp| imp == import);
if !is_here && !already_imported { if !is_here && !already_imported {
self.add_import(parser,import); self.add_import(parser,import);
@ -658,7 +658,7 @@ pub fn locate_line_with
pub fn locate_child pub fn locate_child
(ast:&known::Module, crumb:&definition::Crumb) (ast:&known::Module, crumb:&definition::Crumb)
-> FallibleResult<ChildDefinition> { -> FallibleResult<ChildDefinition> {
let child = ast.def_iter().find_by_name(&crumb)?; let child = ast.def_iter().find_by_name(crumb)?;
Ok(ChildDefinition::try_from(child)?) Ok(ChildDefinition::try_from(child)?)
} }
@ -669,7 +669,7 @@ pub fn locate
// Not exactly regular - we need special case for the first crumb as it is not a definition nor // Not exactly regular - we need special case for the first crumb as it is not a definition nor
// a children. After this we can go just from one definition to another. // a children. After this we can go just from one definition to another.
let first_crumb = crumbs_iter.next().ok_or(EmptyDefinitionId)?; let first_crumb = crumbs_iter.next().ok_or(EmptyDefinitionId)?;
let mut child = ast.def_iter().find_by_name(&first_crumb)?; let mut child = ast.def_iter().find_by_name(first_crumb)?;
for crumb in crumbs_iter { for crumb in crumbs_iter {
child = definition::resolve_single_name(child,crumb)?; child = definition::resolve_single_name(child,crumb)?;
} }

View File

@ -34,7 +34,7 @@ pub fn is_node_by_id(line:&ast::BlockLine<Option<Ast>>, id:ast::Id) -> bool {
/// Searches for `NodeInfo` with the associated `id` index in `lines`. Returns an error if /// Searches for `NodeInfo` with the associated `id` index in `lines`. Returns an error if
/// the Id is not found. /// the Id is not found.
pub fn index_in_lines(lines:&[ast::BlockLine<Option<Ast>>], id:ast::Id) -> FallibleResult<usize> { pub fn index_in_lines(lines:&[ast::BlockLine<Option<Ast>>], id:ast::Id) -> FallibleResult<usize> {
let position = lines.iter().position(|line| is_node_by_id(&line,id)); let position = lines.iter().position(|line| is_node_by_id(line,id));
position.ok_or_else(|| IdNotFound{id}.into()) position.ok_or_else(|| IdNotFound{id}.into())
} }
@ -109,7 +109,7 @@ impl NodeInfo {
pub fn expression(&self) -> &Ast { pub fn expression(&self) -> &Ast {
match self { match self {
NodeInfo::Binding {infix} => &infix.rarg, NodeInfo::Binding {infix} => &infix.rarg,
NodeInfo::Expression{ast} => &ast, NodeInfo::Expression{ast} => ast,
} }
} }

View File

@ -342,7 +342,7 @@ impl Collapser {
if !self.extracted.is_selected(node_id) { if !self.extracted.is_selected(node_id) {
Ok(LineDisposition::Keep) Ok(LineDisposition::Keep)
} else if node_id == self.replaced_node { } else if node_id == self.replaced_node {
let expression = self.call_to_extracted(&extracted_definition)?; let expression = self.call_to_extracted(extracted_definition)?;
let no_node_err = failure::Error::from(CannotConstructCollapsedNode); let no_node_err = failure::Error::from(CannotConstructCollapsedNode);
let mut new_node = NodeInfo::new_expression(expression.clone_ref()).ok_or(no_node_err)?; let mut new_node = NodeInfo::new_expression(expression.clone_ref()).ok_or(no_node_err)?;
new_node.set_id(self.collapsed_node); new_node.set_id(self.collapsed_node);

View File

@ -36,7 +36,7 @@ pub fn apply_code_change_to_id_map(id_map:&mut IdMap, change:&data::text::TextCh
info!(logger,"Updating the ID map with the following text edit: {change:?}."); info!(logger,"Updating the ID map with the following text edit: {change:?}.");
// Remove all entries fully covered by the removed span. // Remove all entries fully covered by the removed span.
vector.drain_filter(|(span,_)| removed.contains_span(&span)); vector.drain_filter(|(span,_)| removed.contains_span(span));
// If the edited section ends up being the trailing part of AST node, how many bytes should be // If the edited section ends up being the trailing part of AST node, how many bytes should be
// trimmed from the id. Precalculated, as is constant in the loop below. // trimmed from the id. Precalculated, as is constant in the loop below.

View File

@ -921,7 +921,7 @@ impl Model {
Some(Panic { message,trace }) => Some((Kind::Panic , Some(message),trace)), Some(Panic { message,trace }) => Some((Kind::Panic , Some(message),trace)),
}?; }?;
let propagated = if kind == Kind::Panic { let propagated = if kind == Kind::Panic {
let root_cause = self.get_node_causing_error_on_current_graph(&trace); let root_cause = self.get_node_causing_error_on_current_graph(trace);
!root_cause.contains(&node_id) !root_cause.contains(&node_id)
} else { } else {
// TODO[ao]: traces are not available for Dataflow errors. // TODO[ao]: traces are not available for Dataflow errors.
@ -939,7 +939,7 @@ impl Model {
fn get_node_causing_error_on_current_graph fn get_node_causing_error_on_current_graph
(&self, trace:&[ExpressionId]) -> Option<graph_editor::NodeId> { (&self, trace:&[ExpressionId]) -> Option<graph_editor::NodeId> {
let node_view_by_expression = self.node_view_by_expression.borrow(); let node_view_by_expression = self.node_view_by_expression.borrow();
trace.iter().find_map(|expr_id| node_view_by_expression.get(&expr_id).copied()) trace.iter().find_map(|expr_id| node_view_by_expression.get(expr_id).copied())
} }
fn refresh_connection_views fn refresh_connection_views
@ -1031,7 +1031,7 @@ impl Model {
self.view.show_prompt(); self.view.show_prompt();
self.prompt_was_shown.set(true); self.prompt_was_shown.set(true);
} }
self.refresh_computed_infos(&expressions) self.refresh_computed_infos(expressions)
} }
/// Request controller to detach all attached visualizations. /// Request controller to detach all attached visualizations.
@ -1200,7 +1200,7 @@ impl Model {
fn searcher_opened_in_ui(weak_self:Weak<Self>) fn searcher_opened_in_ui(weak_self:Weak<Self>)
-> impl Fn(&Self,&graph_editor::NodeId) -> FallibleResult { -> impl Fn(&Self,&graph_editor::NodeId) -> FallibleResult {
move |this,displayed_id| { move |this,displayed_id| {
let node_view = this.view.graph().model.nodes.get_cloned_ref(&displayed_id); let node_view = this.view.graph().model.nodes.get_cloned_ref(displayed_id);
let position = node_view.map(|node| node.position().xy()); let position = node_view.map(|node| node.position().xy());
let position = position.map(|vector| model::module::Position{vector}); let position = position.map(|vector| model::module::Position{vector});
let mode = controller::searcher::Mode::NewNode {position}; let mode = controller::searcher::Mode::NewNode {position};
@ -1309,7 +1309,7 @@ impl Model {
fn connection_created_in_ui(&self, edge_id:&graph_editor::EdgeId) -> FallibleResult { fn connection_created_in_ui(&self, edge_id:&graph_editor::EdgeId) -> FallibleResult {
debug!(self.logger, "Creating connection."); debug!(self.logger, "Creating connection.");
let displayed = self.view.graph().model.edges.get_cloned(&edge_id).ok_or(GraphEditorInconsistency)?; let displayed = self.view.graph().model.edges.get_cloned(edge_id).ok_or(GraphEditorInconsistency)?;
let con = self.controller_connection_from_displayed(&displayed)?; let con = self.controller_connection_from_displayed(&displayed)?;
let inserting = self.connection_views.borrow_mut().insert(con.clone(), *edge_id); let inserting = self.connection_views.borrow_mut().insert(con.clone(), *edge_id);
if inserting.did_overwrite() { if inserting.did_overwrite() {

View File

@ -122,7 +122,7 @@ impl ComputedValueInfoRegistry {
pub fn get_from_info<F,T>(self:&Rc<Self>, id:ExpressionId, mut f:F) -> StaticBoxFuture<Option<T>> pub fn get_from_info<F,T>(self:&Rc<Self>, id:ExpressionId, mut f:F) -> StaticBoxFuture<Option<T>>
where F : FnMut(Rc<ComputedValueInfo>) -> Option<T> + 'static, where F : FnMut(Rc<ComputedValueInfo>) -> Option<T> + 'static,
T : 'static { T : 'static {
let weak = Rc::downgrade(&self); let weak = Rc::downgrade(self);
if let Some(ret) = self.get(&id).and_then(&mut f) { if let Some(ret) = self.get(&id).and_then(&mut f) {
ready_boxed(Some(ret)) ready_boxed(Some(ret))
} else { } else {

View File

@ -115,7 +115,7 @@ impl model::execution_context::API for ExecutionContext {
/// Access the registry of computed values information, like types or called method pointers. /// Access the registry of computed values information, like types or called method pointers.
fn computed_value_info_registry(&self) -> &Rc<ComputedValueInfoRegistry> { fn computed_value_info_registry(&self) -> &Rc<ComputedValueInfoRegistry> {
&self.model.computed_value_info_registry() self.model.computed_value_info_registry()
} }
fn stack_items<'a>(&'a self) -> Box<dyn Iterator<Item=LocalCall> + 'a> { fn stack_items<'a>(&'a self) -> Box<dyn Iterator<Item=LocalCall> + 'a> {

View File

@ -71,13 +71,13 @@ impl ParsedContentSummary {
} }
// Get fragment of string with code. // Get fragment of string with code.
pub fn code_slice(&self) -> &str { &self.slice(&self.code) } pub fn code_slice(&self) -> &str { self.slice(&self.code) }
/// Get fragment of string with id map. /// Get fragment of string with id map.
pub fn id_map_slice (&self) -> &str { &self.slice(&self.id_map) } pub fn id_map_slice (&self) -> &str { self.slice(&self.id_map) }
/// Get fragment of string with metadata. /// Get fragment of string with metadata.
pub fn metadata_slice(&self) -> &str { &self.slice(&self.metadata) } pub fn metadata_slice(&self) -> &str { self.slice(&self.metadata) }
fn slice(&self, range:&Range<TextLocation>) -> &str { fn slice(&self, range:&Range<TextLocation>) -> &str {
let start_ix = range.start.to_index(&self.source); let start_ix = range.start.to_index(&self.source);
@ -291,7 +291,7 @@ impl Module {
self.full_invalidation(summary,new_file).await, self.full_invalidation(summary,new_file).await,
LanguageServerContent::Synchronized(summary) => match kind { LanguageServerContent::Synchronized(summary) => match kind {
NotificationKind::Invalidate => NotificationKind::Invalidate =>
self.partial_invalidation(&summary,new_file).await, self.partial_invalidation(summary,new_file).await,
NotificationKind::CodeChanged{change,replaced_location} => { NotificationKind::CodeChanged{change,replaced_location} => {
let code_change = TextEdit { let code_change = TextEdit {
range: replaced_location.into(), range: replaced_location.into(),
@ -336,7 +336,7 @@ impl Module {
debug_assert_eq!(start.column, 0); debug_assert_eq!(start.column, 0);
(source != target).as_some_from(|| { (source != target).as_some_from(|| {
let edit = TextEdit::from_prefix_postfix_differences(&source, &target); let edit = TextEdit::from_prefix_postfix_differences(source, target);
edit.move_by_lines(start.line) edit.move_by_lines(start.line)
}) })
} }
@ -379,7 +379,7 @@ impl Module {
, new_file : &SourceFile , new_file : &SourceFile
, edits : Vec<TextEdit> , edits : Vec<TextEdit>
) -> impl Future<Output=FallibleResult<ParsedContentSummary>> + 'static { ) -> impl Future<Output=FallibleResult<ParsedContentSummary>> + 'static {
let summary = ParsedContentSummary::from_source(&new_file); let summary = ParsedContentSummary::from_source(new_file);
let edit = language_server::types::FileEdit { let edit = language_server::types::FileEdit {
edits, edits,
path : self.path().file_path().clone(), path : self.path().file_path().clone(),

View File

@ -113,7 +113,7 @@ where K : Clone + Eq + Hash {
async fn get(&self, key:&K) -> Result<Option<Rc<V>>,LoadingError> { async fn get(&self, key:&K) -> Result<Option<Rc<V>>,LoadingError> {
loop { loop {
let entry = self.registry.borrow_mut().get(&key); let entry = self.registry.borrow_mut().get(key);
match entry { match entry {
Some(Entry::Loaded(state)) => { break Ok(Some(state)); }, Some(Entry::Loaded(state)) => { break Ok(Some(state)); },
Some(Entry::Loading(mut sub)) => { Some(Entry::Loading(mut sub)) => {

View File

@ -147,6 +147,6 @@ impl From<BubbleChart> for Instance {
impl display::Object for BubbleChart { impl display::Object for BubbleChart {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.display_object.display_object() self.model.display_object.display_object()
} }
} }

View File

@ -256,6 +256,6 @@ impl From<Error> for Instance {
impl display::Object for Error { impl display::Object for Error {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.dom.display_object() self.model.dom.display_object()
} }
} }

View File

@ -155,6 +155,6 @@ impl From<RawText> for Instance {
impl display::Object for RawText { impl display::Object for RawText {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.dom.display_object() self.dom.display_object()
} }
} }

View File

@ -126,9 +126,9 @@ pub struct Animations {
impl Animations { impl Animations {
/// Constructor. /// Constructor.
pub fn new(network:&frp::Network) -> Self { pub fn new(network:&frp::Network) -> Self {
let color = DEPRECATED_Animation::new(&network); let color = DEPRECATED_Animation::new(network);
let fade_in = DEPRECATED_Animation::new(&network); let fade_in = DEPRECATED_Animation::new(network);
let separator_color = DEPRECATED_Animation::new(&network); let separator_color = DEPRECATED_Animation::new(network);
Self{color,separator_color,fade_in} Self{color,separator_color,fade_in}
} }
} }

View File

@ -106,8 +106,8 @@ pub struct Animations {
impl Animations { impl Animations {
/// Constructor. /// Constructor.
pub fn new(network:&frp::Network) -> Self { pub fn new(network:&frp::Network) -> Self {
let color = DEPRECATED_Animation::new(&network); let color = DEPRECATED_Animation::new(network);
let position = DEPRECATED_Animation::new(&network); let position = DEPRECATED_Animation::new(network);
Self{color,position} Self{color,position}
} }
} }
@ -257,7 +257,7 @@ impl ProjectName {
let hover_color = styles.get_color(theme::graph_editor::breadcrumbs::hover); let hover_color = styles.get_color(theme::graph_editor::breadcrumbs::hover);
let deselected_color = styles.get_color(theme::graph_editor::breadcrumbs::deselected::left); let deselected_color = styles.get_color(theme::graph_editor::breadcrumbs::deselected::left);
let selected_color = styles.get_color(theme::graph_editor::breadcrumbs::selected); let selected_color = styles.get_color(theme::graph_editor::breadcrumbs::selected);
let animations = Animations::new(&network); let animations = Animations::new(network);
frp::extend! { network frp::extend! { network
@ -292,7 +292,7 @@ impl ProjectName {
// === Text Area === // === Text Area ===
text_content <- text.content.map(|txt| txt.to_string()); text_content <- text.content.map(|txt| txt.to_string());
eval text_content((content) model.update_alignment(&content)); eval text_content((content) model.update_alignment(content));
text_width <- text_content.map(f!((content) model.width(content))); text_width <- text_content.map(f!((content) model.width(content)));
frp.source.width <+ text_width; frp.source.width <+ text_width;

View File

@ -1050,7 +1050,7 @@ impl Frp {
def set_disabled = source(); def set_disabled = source();
def set_color = source(); def set_color = source();
} }
let shape_events = ShapeViewEventsProxy::new(&network); let shape_events = ShapeViewEventsProxy::new(network);
Self {source_width,source_height,target_position,target_attached,source_attached,redraw Self {source_width,source_height,target_position,target_attached,source_attached,redraw
,set_disabled,set_color,hover_position,shape_events} ,set_disabled,set_color,hover_position,shape_events}
} }
@ -1250,7 +1250,7 @@ impl EdgeModelData {
front . side_line2 . mod_rotation(|r| r.z = RIGHT_ANGLE); front . side_line2 . mod_rotation(|r| r.z = RIGHT_ANGLE);
back . side_line2 . mod_rotation(|r| r.z = RIGHT_ANGLE); back . side_line2 . mod_rotation(|r| r.z = RIGHT_ANGLE);
let frp = Frp::new(&network); let frp = Frp::new(network);
let source_height = default(); let source_height = default();
let source_width = default(); let source_width = default();
let target_position = default(); let target_position = default();
@ -1906,7 +1906,7 @@ impl EdgeModelData {
(&self, position:Vector2<f32>, focus_shape_id:display::object::Id, part: PortType) (&self, position:Vector2<f32>, focus_shape_id:display::object::Id, part: PortType)
-> Result<SnapTarget, ()>{ -> Result<SnapTarget, ()>{
let snap_data = self.try_point_snap(position,focus_shape_id).ok_or(())?; let snap_data = self.try_point_snap(position,focus_shape_id).ok_or(())?;
let semantic_split = SemanticSplit::new(&self,snap_data.target_shape_id).ok_or(())?; let semantic_split = SemanticSplit::new(self,snap_data.target_shape_id).ok_or(())?;
let angle = self.cut_angle_for_shape(snap_data.target_shape_id,position,part).ok_or(())?; let angle = self.cut_angle_for_shape(snap_data.target_shape_id,position,part).ok_or(())?;
// Completely disable/enable focus for shapes that are not close to the split based on their // Completely disable/enable focus for shapes that are not close to the split based on their

View File

@ -436,11 +436,11 @@ impl NodeModel {
// Disable shadows to allow interaction with the output port. // Disable shadows to allow interaction with the output port.
let shape_system = scene.layers.main.shape_system_registry.shape_system let shape_system = scene.layers.main.shape_system_registry.shape_system
(&scene,PhantomData::<backdrop::DynamicShape>); (scene,PhantomData::<backdrop::DynamicShape>);
shape_system.shape_system.set_pointer_events(false); shape_system.shape_system.set_pointer_events(false);
let input = input::Area::new(&logger,app); let input = input::Area::new(&logger,app);
let visualization = visualization::Container::new(&logger,&app,registry); let visualization = visualization::Container::new(&logger,app,registry);
display_object.add_child(&visualization); display_object.add_child(&visualization);
display_object.add_child(&input); display_object.add_child(&input);
@ -449,7 +449,7 @@ impl NodeModel {
let (x,y) = ERROR_VISUALIZATION_SIZE; let (x,y) = ERROR_VISUALIZATION_SIZE;
error_visualization.set_size.emit(Vector2(x,y)); error_visualization.set_size.emit(Vector2(x,y));
let action_bar = action_bar::ActionBar::new(&logger,&app); let action_bar = action_bar::ActionBar::new(&logger,app);
display_object.add_child(&action_bar); display_object.add_child(&action_bar);
let output = output::Area::new(&logger,app); let output = output::Area::new(&logger,app);
@ -745,7 +745,7 @@ impl Node {
// === Color Handling === // === Color Handling ===
let bgg = style_frp.get_color(ensogl_theme::graph_editor::node::background); let bgg = style_frp.get_color(ensogl_theme::graph_editor::node::background);
let profiling_theme = profiling::Theme::from_styles(&style_frp,&network); let profiling_theme = profiling::Theme::from_styles(style_frp,network);
profiling_color <- all_with5 profiling_color <- all_with5
(&frp.set_profiling_status,&frp.set_profiling_min_global_duration, (&frp.set_profiling_status,&frp.set_profiling_min_global_duration,

View File

@ -311,6 +311,6 @@ impl ActionBar {
impl display::Object for ActionBar { impl display::Object for ActionBar {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.display_object() self.model.display_object()
} }
} }

View File

@ -114,14 +114,14 @@ impl Container {
let height = format!("{}.px", height); let height = format!("{}.px", height);
let z_index = Z_INDEX.to_string(); let z_index = Z_INDEX.to_string();
let border_radius = format!("{}.px", BORDER_RADIUS); let border_radius = format!("{}.px", BORDER_RADIUS);
background_dom.dom().set_style_or_warn("width" ,width ,&logger); background_dom.dom().set_style_or_warn("width" ,width ,logger);
background_dom.dom().set_style_or_warn("height" ,height ,&logger); background_dom.dom().set_style_or_warn("height" ,height ,logger);
background_dom.dom().set_style_or_warn("z-index" ,z_index ,&logger); background_dom.dom().set_style_or_warn("z-index" ,z_index ,logger);
background_dom.dom().set_style_or_warn("overflow-y" ,"auto" ,&logger); background_dom.dom().set_style_or_warn("overflow-y" ,"auto" ,logger);
background_dom.dom().set_style_or_warn("overflow-x" ,"auto" ,&logger); background_dom.dom().set_style_or_warn("overflow-x" ,"auto" ,logger);
background_dom.dom().set_style_or_warn("background" ,bg_hex ,&logger); background_dom.dom().set_style_or_warn("background" ,bg_hex ,logger);
background_dom.dom().set_style_or_warn("border-radius",border_radius,&logger); background_dom.dom().set_style_or_warn("border-radius",border_radius,logger);
shadow::add_to_dom_element(&background_dom,&styles,&logger); shadow::add_to_dom_element(&background_dom,&styles,logger);
background_dom background_dom
} }

View File

@ -114,7 +114,7 @@ impl Shape {
impl display::Object for Shape { impl display::Object for Shape {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.root.display_object() self.root.display_object()
} }
} }

View File

@ -402,7 +402,7 @@ impl Area {
let label_color = color::Animation::new(network); let label_color = color::Animation::new(network);
let hysteretic_transition = HystereticAnimation::new( let hysteretic_transition = HystereticAnimation::new(
&network,SHOW_DELAY_DURATION_MS,HIDE_DELAY_DURATION_MS); network,SHOW_DELAY_DURATION_MS,HIDE_DELAY_DURATION_MS);
frp::extend! { network frp::extend! { network

View File

@ -220,7 +220,7 @@ impl ProfilingLabel {
// === Color === // === Color ===
let styles = StyleWatchFrp::new(&scene.style_sheet); let styles = StyleWatchFrp::new(&scene.style_sheet);
let theme = Theme::from_styles(&styles,&network); let theme = Theme::from_styles(&styles,network);
color.target_color <+ all_with4 color.target_color <+ all_with4
(&frp.set_status,&frp.set_min_global_duration,&frp.set_max_global_duration,&theme, (&frp.set_status,&frp.set_min_global_duration,&frp.set_max_global_duration,&theme,
|&status,&min,&max,&theme| status.display_color(min,max,theme) |&status,&min,&max,&theme| status.display_color(min,max,theme)

View File

@ -188,7 +188,7 @@ impl StatusIndicator {
impl display::Object for StatusIndicator { impl display::Object for StatusIndicator {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.display_object() self.model.display_object()
} }
} }

View File

@ -192,7 +192,7 @@ impl Tooltip {
ensogl_theme::application::tooltip::show_delay_duration_ms,0.0); ensogl_theme::application::tooltip::show_delay_duration_ms,0.0);
let hysteretic_transition = HystereticAnimation::new( let hysteretic_transition = HystereticAnimation::new(
&network,hide_delay_duration_ms,show_delay_duration_ms); network,hide_delay_duration_ms,show_delay_duration_ms);
frp::extend! { network frp::extend! { network
@ -240,6 +240,6 @@ impl Tooltip {
impl display::Object for Tooltip { impl display::Object for Tooltip {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.root.display_object() self.model.root.display_object()
} }
} }

View File

@ -69,7 +69,7 @@ fn auto_hue(tp:&Type, styles:&StyleWatch) -> f32 {
// Defines how many hue values we can have based on our incoming type name. // Defines how many hue values we can have based on our incoming type name.
let hue_steps = styles.get_number_or(theme::code::types::hue_steps,512.0); let hue_steps = styles.get_number_or(theme::code::types::hue_steps,512.0);
let hue_shift = styles.get_number_or(theme::code::types::hue_shift,0.0); let hue_shift = styles.get_number_or(theme::code::types::hue_shift,0.0);
(hash(&tp) % (hue_steps as u64)) as f32 / hue_steps + hue_shift (hash(tp) % (hue_steps as u64)) as f32 / hue_steps + hue_shift
} }
/// Compute the hash of the type for use in the `compute` function. /// Compute the hash of the type for use in the `compute` function.

View File

@ -265,7 +265,7 @@ impl ContainerModel {
let scene = scene.clone_ref(); let scene = scene.clone_ref();
let is_fullscreen = default(); let is_fullscreen = default();
let size = default(); let size = default();
let action_bar = ActionBar::new(&app,registry.clone_ref()); let action_bar = ActionBar::new(app,registry.clone_ref());
view.add_child(&action_bar); view.add_child(&action_bar);
Self {logger,display_object,drag_root,visualization,vis_frp_connection,scene,view Self {logger,display_object,drag_root,visualization,vis_frp_connection,scene,view
@ -308,7 +308,7 @@ impl ContainerModel {
if let Some(viz) = &*self.visualization.borrow() { if let Some(viz) = &*self.visualization.borrow() {
self.fullscreen_view.add_child(viz); self.fullscreen_view.add_child(viz);
if let Some(dom) = viz.root_dom() { if let Some(dom) = viz.root_dom() {
self.scene.dom.layers.fullscreen_vis.manage(&dom); self.scene.dom.layers.fullscreen_vis.manage(dom);
} }
viz.inputs.activate.emit(()); viz.inputs.activate.emit(());
} }
@ -319,7 +319,7 @@ impl ContainerModel {
if let Some(viz) = &*self.visualization.borrow() { if let Some(viz) = &*self.visualization.borrow() {
self.view.add_child(viz); self.view.add_child(viz);
if let Some(dom) = viz.root_dom() { if let Some(dom) = viz.root_dom() {
self.scene.dom.layers.back.manage(&dom); self.scene.dom.layers.back.manage(dom);
} }
viz.inputs.deactivate.emit(()); viz.inputs.deactivate.emit(());
} }
@ -479,7 +479,7 @@ impl Container {
let logger = &self.model.logger; let logger = &self.model.logger;
let action_bar = &model.action_bar.frp; let action_bar = &model.action_bar.frp;
let registry = &model.registry; let registry = &model.registry;
let selection = Animation::new(&network); let selection = Animation::new(network);
frp::extend! { network frp::extend! { network
eval frp.set_visibility ((v) model.set_visibility(*v)); eval frp.set_visibility ((v) model.set_visibility(*v));

View File

@ -266,7 +266,7 @@ impl Model {
let logger = Logger::new("ActionBarModel"); let logger = Logger::new("ActionBarModel");
let background = background::View::new(&logger); let background = background::View::new(&logger);
let hover_area = hover_area::View::new(&logger); let hover_area = hover_area::View::new(&logger);
let visualization_chooser = VisualizationChooser::new(&app,vis_registry); let visualization_chooser = VisualizationChooser::new(app,vis_registry);
let display_object = display::object::Instance::new(&logger); let display_object = display::object::Instance::new(&logger);
let size = default(); let size = default();
let icons = Icons::new(logger); let icons = Icons::new(logger);
@ -415,6 +415,6 @@ impl ActionBar {
impl display::Object for ActionBar { impl display::Object for ActionBar {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.display_object() self.model.display_object()
} }
} }

View File

@ -59,7 +59,7 @@ struct Model {
impl Model { impl Model {
pub fn new(app:&Application, registry:visualization::Registry) -> Self { pub fn new(app:&Application, registry:visualization::Registry) -> Self {
let selection_menu = drop_down_menu::DropDownMenu::new(&app); let selection_menu = drop_down_menu::DropDownMenu::new(app);
app.display.scene().layers.below_main.add_exclusive(&selection_menu); app.display.scene().layers.below_main.add_exclusive(&selection_menu);
Self{selection_menu,registry} Self{selection_menu,registry}
} }

View File

@ -64,7 +64,7 @@ impl Definition {
let source = source.as_ref(); let source = source.as_ref();
let source = source; let source = source;
let context = JsValue::NULL; let context = JsValue::NULL;
let function = Function::new_with_args(binding::JS_CLASS_NAME,&source) let function = Function::new_with_args(binding::JS_CLASS_NAME,source)
.map_err(Error::InvalidFunction)?; .map_err(Error::InvalidFunction)?;
let js_class = binding::js_class(); let js_class = binding::js_class();
let class = function.call1(&context,&js_class).map_err(Error::InvalidFunction)?; let class = function.call1(&context,&js_class).map_err(Error::InvalidFunction)?;

View File

@ -145,7 +145,7 @@ impl InstanceModel {
-> result::Result<java_script::binding::Visualization,Error> { -> result::Result<java_script::binding::Visualization,Error> {
let js_new = js_sys::Function::new_with_args("cls,arg", "return new cls(arg)"); let js_new = js_sys::Function::new_with_args("cls,arg", "return new cls(arg)");
let context = JsValue::NULL; let context = JsValue::NULL;
let object = js_new.call2(&context,&class,&args.into()) let object = js_new.call2(&context,class,&args.into())
.map_err(|js_error|Error::ConstructorError {js_error})?; .map_err(|js_error|Error::ConstructorError {js_error})?;
if !object.is_object() { if !object.is_object() {
return Err(Error::ValueIsNotAnObject { object } ) return Err(Error::ValueIsNotAnObject { object } )
@ -164,7 +164,7 @@ impl InstanceModel {
let object = Self::instantiate_class_with_args(class,init_data)?; let object = Self::instantiate_class_with_args(class,init_data)?;
let on_data_received = get_method(object.as_ref(),method::ON_DATA_RECEIVED).ok(); let on_data_received = get_method(object.as_ref(),method::ON_DATA_RECEIVED).ok();
let on_data_received = Rc::new(on_data_received); let on_data_received = Rc::new(on_data_received);
let set_size = get_method(&object.as_ref(),method::SET_SIZE).ok(); let set_size = get_method(object.as_ref(),method::SET_SIZE).ok();
let set_size = Rc::new(set_size); let set_size = Rc::new(set_size);
let object = Rc::new(object); let object = Rc::new(object);
let scene = scene.clone_ref(); let scene = scene.clone_ref();
@ -245,7 +245,7 @@ impl Instance {
let frp = visualization::instance::Frp::new(&network); let frp = visualization::instance::Frp::new(&network);
let model = InstanceModel::from_class(class,scene)?; let model = InstanceModel::from_class(class,scene)?;
model.set_dom_layer(&scene.dom.layers.back); model.set_dom_layer(&scene.dom.layers.back);
Ok(Instance{model,frp,network}.init_frp(&scene).init_preprocessor_change_callback()) Ok(Instance{model,frp,network}.init_frp(scene).init_preprocessor_change_callback())
} }
fn init_frp(self, scene:&Scene) -> Self { fn init_frp(self, scene:&Scene) -> Self {
@ -292,7 +292,7 @@ impl From<Instance> for visualization::Instance {
impl display::Object for Instance { impl display::Object for Instance {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.model.root_node.display_object() self.model.root_node.display_object()
} }
} }

View File

@ -159,7 +159,7 @@ impl FrpInputs {
impl Frp { impl Frp {
/// Constructor. /// Constructor.
pub fn new(network:&frp::Network) -> Self { pub fn new(network:&frp::Network) -> Self {
let inputs = FrpInputs::new(&network); let inputs = FrpInputs::new(network);
frp::extend! { network frp::extend! { network
def preprocessor_change = source(); def preprocessor_change = source();
on_preprocessor_change <- preprocessor_change.sampler(); on_preprocessor_change <- preprocessor_change.sampler();

View File

@ -631,7 +631,7 @@ impl Node {
impl display::Object for Node { impl display::Object for Node {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.view.display_object() self.view.display_object()
} }
} }
@ -705,7 +705,7 @@ impl Edge {
impl display::Object for Edge { impl display::Object for Edge {
fn display_object(&self) -> &display::object::Instance { fn display_object(&self) -> &display::object::Instance {
&self.view.display_object() self.view.display_object()
} }
} }
@ -1110,8 +1110,8 @@ pub struct TouchState {
impl TouchState { impl TouchState {
pub fn new(network:&frp::Network, mouse:&frp::io::Mouse) -> Self { pub fn new(network:&frp::Network, mouse:&frp::io::Mouse) -> Self {
let nodes = TouchNetwork::<NodeId>::new(&network,mouse); let nodes = TouchNetwork::<NodeId>::new(network,mouse);
let background = TouchNetwork::<()>::new(&network,mouse); let background = TouchNetwork::<()>::new(network,mouse);
Self {nodes,background} Self {nodes,background}
} }
} }
@ -1163,7 +1163,7 @@ struct NodeCreationContext<'a> {
impl GraphEditorModelWithNetwork { impl GraphEditorModelWithNetwork {
pub fn new(app:&Application, cursor:cursor::Cursor, frp:&Frp) -> Self { pub fn new(app:&Application, cursor:cursor::Cursor, frp:&Frp) -> Self {
let network = frp.network.clone_ref(); // FIXME make weak let network = frp.network.clone_ref(); // FIXME make weak
let model = GraphEditorModel::new(app,cursor,&frp); let model = GraphEditorModel::new(app,cursor,frp);
Self {model,network} Self {model,network}
} }
@ -1428,7 +1428,7 @@ impl GraphEditorModel {
let breadcrumbs = component::Breadcrumbs::new(app.clone_ref()); let breadcrumbs = component::Breadcrumbs::new(app.clone_ref());
let app = app.clone_ref(); let app = app.clone_ref();
let frp = frp.output.clone_ref(); let frp = frp.output.clone_ref();
let navigator = Navigator::new(&scene,&scene.camera()); let navigator = Navigator::new(scene,&scene.camera());
let tooltip = Tooltip::new(&app); let tooltip = Tooltip::new(&app);
let profiling_statuses = profiling::Statuses::new(); let profiling_statuses = profiling::Statuses::new();
let profiling_button = component::profiling::Button::new(&app); let profiling_button = component::profiling::Button::new(&app);
@ -2316,12 +2316,12 @@ fn new_graph_editor(app:&Application) -> GraphEditor {
out.source.nodes_labels_visible <+ out.node_edit_mode || node_in_edit_mode; out.source.nodes_labels_visible <+ out.node_edit_mode || node_in_edit_mode;
eval out.node_editing_started ([model] (id) { eval out.node_editing_started ([model] (id) {
if let Some(node) = model.nodes.get_cloned_ref(&id) { if let Some(node) = model.nodes.get_cloned_ref(id) {
node.model.input.frp.set_edit_mode(true); node.model.input.frp.set_edit_mode(true);
} }
}); });
eval out.node_editing_finished ([model](id) { eval out.node_editing_finished ([model](id) {
if let Some(node) = model.nodes.get_cloned_ref(&id) { if let Some(node) = model.nodes.get_cloned_ref(id) {
node.model.input.set_edit_mode(false); node.model.input.set_edit_mode(false);
} }
}); });
@ -2333,8 +2333,8 @@ fn new_graph_editor(app:&Application) -> GraphEditor {
node_pointer_style <- source::<cursor::Style>(); node_pointer_style <- source::<cursor::Style>();
node_tooltip <- source::<tooltip::Style>(); node_tooltip <- source::<tooltip::Style>();
let node_input_touch = TouchNetwork::<EdgeEndpoint>::new(&network,&mouse); let node_input_touch = TouchNetwork::<EdgeEndpoint>::new(network,mouse);
let node_output_touch = TouchNetwork::<EdgeEndpoint>::new(&network,&mouse); let node_output_touch = TouchNetwork::<EdgeEndpoint>::new(network,mouse);
node_expression_set <- source(); node_expression_set <- source();
out.source.node_expression_set <+ node_expression_set; out.source.node_expression_set <+ node_expression_set;
@ -2648,9 +2648,9 @@ fn new_graph_editor(app:&Application) -> GraphEditor {
// === Snapping === // === Snapping ===
eval drag_tgts ((ids) model.disable_grid_snapping_for(ids)); eval drag_tgts ((ids) model.disable_grid_snapping_for(ids));
let node_tgt_pos_anim = DEPRECATED_Animation::<Vector2<f32>>::new(&network); let node_tgt_pos_anim = DEPRECATED_Animation::<Vector2<f32>>::new(network);
let x_snap_strength = DEPRECATED_Tween::new(&network); let x_snap_strength = DEPRECATED_Tween::new(network);
let y_snap_strength = DEPRECATED_Tween::new(&network); let y_snap_strength = DEPRECATED_Tween::new(network);
x_snap_strength.set_duration(300.0); x_snap_strength.set_duration(300.0);
y_snap_strength.set_duration(300.0); y_snap_strength.set_duration(300.0);

View File

@ -79,7 +79,7 @@ impl Statuses {
})); }));
min_and_max_from_remove <- frp.remove.map(f!([durations](node) { min_and_max_from_remove <- frp.remove.map(f!([durations](node) {
durations.borrow_mut().remove_by_left(&node); durations.borrow_mut().remove_by_left(node);
Self::min_and_max(&*durations.borrow()) Self::min_and_max(&*durations.borrow())
})); }));

View File

@ -122,7 +122,7 @@ impl View {
} }
impl display::Object for View { impl display::Object for View {
fn display_object(&self) -> &display::object::Instance { &self.model.display_object() } fn display_object(&self) -> &display::object::Instance { self.model.display_object() }
} }
impl application::command::FrpNetworkProvider for View { impl application::command::FrpNetworkProvider for View {
@ -135,7 +135,7 @@ impl application::View for View {
fn new(app: &Application) -> Self { Self::new(app) } fn new(app: &Application) -> Self { Self::new(app) }
fn app(&self) -> &Application { fn app(&self) -> &Application {
&self.model.app() self.model.app()
} }
fn default_shortcuts() -> Vec<shortcut::Shortcut> { fn default_shortcuts() -> Vec<shortcut::Shortcut> {

View File

@ -89,7 +89,7 @@ fn init(app:&Application) {
let world = &app.display; let world = &app.display;
let scene = world.scene(); let scene = world.scene();
let camera = scene.camera(); let camera = scene.camera();
let navigator = Navigator::new(&scene,&camera); let navigator = Navigator::new(scene,&camera);
app.views.register::<project::View>(); app.views.register::<project::View>();
app.views.register::<text::Area>(); app.views.register::<text::Area>();

View File

@ -91,7 +91,7 @@ fn init(app:&Application) {
let world = &app.display; let world = &app.display;
let scene = world.scene(); let scene = world.scene();
let camera = scene.camera(); let camera = scene.camera();
let navigator = Navigator::new(&scene,&camera); let navigator = Navigator::new(scene,&camera);
let registry = Registry::new(); let registry = Registry::new();
registry.add(constructor_graph()); registry.add(constructor_graph());
@ -100,7 +100,7 @@ fn init(app:&Application) {
let vis_class = vis_factories.iter().find(|class| { let vis_class = vis_factories.iter().find(|class| {
&*class.signature.name == "Graph" &*class.signature.name == "Graph"
}).expect("Couldn't find Graph class."); }).expect("Couldn't find Graph class.");
let visualization = vis_class.new_instance(&scene).expect("Couldn't create visualiser."); let visualization = vis_class.new_instance(scene).expect("Couldn't create visualiser.");
visualization.activate.emit(()); visualization.activate.emit(());
let network = enso_frp::Network::new("VisualizationExample"); let network = enso_frp::Network::new("VisualizationExample");

View File

@ -100,7 +100,7 @@ impl Model {
let logger = Logger::new("SearcherView"); let logger = Logger::new("SearcherView");
let display_object = display::object::Instance::new(&logger); let display_object = display::object::Instance::new(&logger);
let list = app.new_view::<ListView>(); let list = app.new_view::<ListView>();
let documentation = documentation::View::new(&scene); let documentation = documentation::View::new(scene);
let doc_provider = default(); let doc_provider = default();
scene.layers.above_nodes.add_exclusive(&list); scene.layers.above_nodes.add_exclusive(&list);
display_object.add_child(&documentation); display_object.add_child(&documentation);
@ -199,7 +199,7 @@ impl View {
let frp = &self.frp; let frp = &self.frp;
let source = &self.frp.source; let source = &self.frp.source;
let height = DEPRECATED_Animation::<f32>::new(&network); let height = DEPRECATED_Animation::<f32>::new(network);
frp::extend! { network frp::extend! { network
eval frp.set_actions ([model] ((entries,docs)) { eval frp.set_actions ([model] ((entries,docs)) {

View File

@ -269,7 +269,7 @@ impl View {
/// Create new StatusBar view. /// Create new StatusBar view.
pub fn new(app:&Application) -> Self { pub fn new(app:&Application) -> Self {
let frp = Frp::new(); let frp = Frp::new();
let model = Model::new(&app); let model = Model::new(app);
let network = &frp.network; let network = &frp.network;
let scene = app.display.scene(); let scene = app.display.scene();

View File

@ -220,7 +220,7 @@ impl View {
let style = StyleWatchFrp::new(&app.display.scene().style_sheet); let style = StyleWatchFrp::new(&app.display.scene().style_sheet);
let style_frp = LayoutParams::from_theme(&style); let style_frp = LayoutParams::from_theme(&style);
let layout_style = style_frp.flatten(&network); let layout_style = style_frp.flatten(network);
frp::extend! { network frp::extend! { network
// Layout // Layout

View File

@ -228,14 +228,14 @@ impl<Shape:ButtonShape> View<Shape> {
// Icon color initialization // Icon color initialization
let default_icon_color_path = Shape::icon_color_path(State::Unconcerned); let default_icon_color_path = Shape::icon_color_path(State::Unconcerned);
let default_icon_color = style.get_color(default_icon_color_path).value(); let default_icon_color = style.get_color(default_icon_color_path).value();
let icon_color = color::Animation::new(&network); let icon_color = color::Animation::new(network);
icon_color.target(color::Lcha::from(default_icon_color)); icon_color.target(color::Lcha::from(default_icon_color));
model.set_icon_color(default_icon_color); model.set_icon_color(default_icon_color);
// Background color initialization // Background color initialization
let default_background_color_path = Shape::background_color_path(State::Unconcerned); let default_background_color_path = Shape::background_color_path(State::Unconcerned);
let default_background_color = style.get_color(default_background_color_path).value(); let default_background_color = style.get_color(default_background_color_path).value();
let background_color = color::Animation::new(&network); let background_color = color::Animation::new(network);
background_color.target(color::Lcha::from(default_background_color)); background_color.target(color::Lcha::from(default_background_color));
model.set_icon_color(default_background_color); model.set_icon_color(default_background_color);

View File

@ -2119,7 +2119,7 @@ impl<T1,T2,F,Out> stream::EventConsumer<Output<T1>> for OwnedMap2<T1,T2,F>
where T1:EventOutput, T2:EventOutput, Out:Data, F:'static+Fn(&Output<T1>,&Output<T2>)->Out { where T1:EventOutput, T2:EventOutput, Out:Data, F:'static+Fn(&Output<T1>,&Output<T2>)->Out {
fn on_event(&self, stack:CallStack, value1:&Output<T1>) { fn on_event(&self, stack:CallStack, value1:&Output<T1>) {
let value2 = self.src2.value(); let value2 = self.src2.value();
let out = (self.function)(&value1,&value2); let out = (self.function)(value1,&value2);
self.emit_event(stack,&out); self.emit_event(stack,&out);
} }
} }
@ -2176,7 +2176,7 @@ where T1:EventOutput, T2:EventOutput, T3:EventOutput, Out:Data,
fn on_event(&self, stack:CallStack, value1:&Output<T1>) { fn on_event(&self, stack:CallStack, value1:&Output<T1>) {
let value2 = self.src2.value(); let value2 = self.src2.value();
let value3 = self.src3.value(); let value3 = self.src3.value();
let out = (self.function)(&value1,&value2,&value3); let out = (self.function)(value1,&value2,&value3);
self.emit_event(stack,&out); self.emit_event(stack,&out);
} }
} }
@ -2236,7 +2236,7 @@ impl<T1,T2,T3,T4,F,Out> stream::EventConsumer<Output<T1>> for OwnedMap4<T1,T2,T3
let value2 = self.src2.value(); let value2 = self.src2.value();
let value3 = self.src3.value(); let value3 = self.src3.value();
let value4 = self.src4.value(); let value4 = self.src4.value();
let out = (self.function)(&value1,&value2,&value3,&value4); let out = (self.function)(value1,&value2,&value3,&value4);
self.emit_event(stack,&out); self.emit_event(stack,&out);
} }
} }

View File

@ -252,7 +252,7 @@ impl<T:Clone> AutomataRegistryModel<T> {
self.states.insert(alt_repr.clone(),out); self.states.insert(alt_repr.clone(),out);
} else { } else {
let key = name; let key = name;
path.push(&key); path.push(key);
path.sort_unstable(); path.sort_unstable();
let repr = path.join(" "); let repr = path.join(" ");
state = match self.states.get(&repr) { state = match self.states.get(&repr) {

View File

@ -51,9 +51,9 @@ pub trait BlobExt {
impl BlobExt for web_sys::Blob { impl BlobExt for web_sys::Blob {
fn stream(&self) -> Result<web_sys::ReadableStream,Error> { fn stream(&self) -> Result<web_sys::ReadableStream,Error> {
let this = self.as_ref(); let this = self.as_ref();
let method_as_value = js_sys::Reflect::get(&this,&"stream".into())?; let method_as_value = js_sys::Reflect::get(this,&"stream".into())?;
let method = method_as_value.dyn_into::<js_sys::Function>()?; let method = method_as_value.dyn_into::<js_sys::Function>()?;
Ok(method.call0(&this)?.dyn_into()?) Ok(method.call0(this)?.dyn_into()?)
} }
fn stream_reader(&self) -> Result<ReadableStreamDefaultReader,Error> { fn stream_reader(&self) -> Result<ReadableStreamDefaultReader,Error> {