diff --git a/cspell.json b/cspell.json index 7e4cce7108f..77e09dc1e57 100644 --- a/cspell.json +++ b/cspell.json @@ -4,7 +4,8 @@ "words": [ "gapi", "googleusercontent", - "Hira" + "Hira", + "smalrubot" ], "ignorePaths": [ "node_modules", diff --git a/package-lock.json b/package-lock.json index 46bb9cff862..28c43fb4b79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -100,6 +100,8 @@ "eslint-import-resolver-webpack": "0.11.1", "eslint-plugin-import": "2.32.0", "eslint-plugin-jest": "22.21.0", + "eslint-plugin-json": "^4.0.1", + "eslint-plugin-jsonc": "^2.21.0", "eslint-plugin-react": "7.37.5", "file-loader": "6.2.0", "gh-pages": "3.2.3", @@ -107,6 +109,7 @@ "husky": "8.0.3", "jest": "21.2.1", "jest-junit": "7.0.0", + "jsonc-eslint-parser": "^2.4.2", "mkdirp": "1.0.4", "path-exists-cli": "^2.0.0", "raf": "3.4.1", @@ -3924,17 +3927,20 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } @@ -5132,6 +5138,19 @@ "@octokit/openapi-types": "^18.0.0" } }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", @@ -11880,6 +11899,16 @@ "integrity": "sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==", "license": "Apache-2.0" }, + "node_modules/diff-sequences": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", + "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, "node_modules/diffie-hellman": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", @@ -12908,6 +12937,35 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-compat-utils": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.6.5.tgz", + "integrity": "sha512-vAUHYzue4YAa2hNACjB8HvUQj5yehAZgiClyFVVom9cP8z5NSFq3PwB/TtJslN2zAMgRX6FCFCjYBbQh71g5RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-compat-utils/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-config-scratch": { "version": "9.0.9", "resolved": "https://registry.npmjs.org/eslint-config-scratch/-/eslint-config-scratch-9.0.9.tgz", @@ -12994,6 +13052,28 @@ "semver": "bin/semver" } }, + "node_modules/eslint-json-compat-utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/eslint-json-compat-utils/-/eslint-json-compat-utils-0.2.1.tgz", + "integrity": "sha512-YzEodbDyW8DX8bImKhAcCeu/L31Dd/70Bidx2Qex9OFUtgzXLqtfWL4Hr5fM/aCCB8QUZLuJur0S9k6UfgFkfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esquery": "^1.6.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": "*", + "jsonc-eslint-parser": "^2.4.0" + }, + "peerDependenciesMeta": { + "@eslint/json": { + "optional": true + } + } + }, "node_modules/eslint-module-utils": { "version": "2.12.1", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", @@ -13095,6 +13175,47 @@ "eslint": ">=5" } }, + "node_modules/eslint-plugin-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-json/-/eslint-plugin-json-4.0.1.tgz", + "integrity": "sha512-3An5ISV5dq/kHfXdNyY5TUe2ONC3yXFSkLX2gu+W8xAhKhfvrRvkSAeKXCxZqZ0KJLX15ojBuLPyj+UikQMkOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21", + "vscode-json-languageservice": "^4.1.6" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/eslint-plugin-jsonc": { + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsonc/-/eslint-plugin-jsonc-2.21.0.tgz", + "integrity": "sha512-HttlxdNG5ly3YjP1cFMP62R4qKLxJURfBZo2gnMY+yQojZxkLyOpY1H1KRTKBmvQeSG9pIpSGEhDjE17vvYosg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.5.1", + "diff-sequences": "^27.5.1", + "eslint-compat-utils": "^0.6.4", + "eslint-json-compat-utils": "^0.2.1", + "espree": "^9.6.1 || ^10.3.0", + "graphemer": "^1.4.0", + "jsonc-eslint-parser": "^2.4.0", + "natural-compare": "^1.4.0", + "synckit": "^0.6.2 || ^0.7.3 || ^0.11.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-plugin-react": { "version": "7.37.5", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", @@ -19973,6 +20094,58 @@ "node": ">=6" } }, + "node_modules/jsonc-eslint-parser": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jsonc-eslint-parser/-/jsonc-eslint-parser-2.4.2.tgz", + "integrity": "sha512-1e4qoRgnn448pRuMvKGsFFymUCquZV0mpGgOyIKNgD3JVDTsVJyRBGH/Fm0tBb8WsWGgmB1mDe6/yJMQM37DUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.5.0", + "eslint-visitor-keys": "^3.0.0", + "espree": "^9.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + } + }, + "node_modules/jsonc-eslint-parser/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/jsonc-eslint-parser/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -31143,6 +31316,22 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "license": "MIT" }, + "node_modules/synckit": { + "version": "0.11.12", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.12.tgz", + "integrity": "sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, "node_modules/tapable": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", @@ -32997,6 +33186,48 @@ "dev": true, "license": "MIT" }, + "node_modules/vscode-json-languageservice": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-4.2.1.tgz", + "integrity": "sha512-xGmv9QIWs2H8obGbWg+sIPI/3/pFgj/5OWBhNzs00BkYQ9UaB2F6JJaGB/2/YOZJ3BvLXQTC4Q7muqU25QgAhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsonc-parser": "^3.0.0", + "vscode-languageserver-textdocument": "^1.0.3", + "vscode-languageserver-types": "^3.16.0", + "vscode-nls": "^5.0.0", + "vscode-uri": "^3.0.3" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "dev": true, + "license": "MIT" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "dev": true, + "license": "MIT" + }, + "node_modules/vscode-nls": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", + "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==", + "dev": true, + "license": "MIT" + }, + "node_modules/vscode-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", + "dev": true, + "license": "MIT" + }, "node_modules/w3c-xmlserializer": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", diff --git a/package.json b/package.json index 9d4708ebb57..3ca8855c697 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "test": "npm run test:lint && npm run test:unit && npm run build && npm run test:integration", "test:integration": "jest --maxWorkers=4 test[\\\\/]integration", "test:integration:noMaxWorkers": "jest test[\\\\/]integration", - "test:lint": "eslint . --ext .js,.jsx", + "test:lint": "eslint . --ext .js,.jsx src/containers/ruby-tab/*.json", "test:unit": "jest test[\\\\/]unit", "test:smoke": "jest --runInBand test[\\\\/]smoke", "watch": "webpack --watch" @@ -132,6 +132,8 @@ "eslint-import-resolver-webpack": "0.11.1", "eslint-plugin-import": "2.32.0", "eslint-plugin-jest": "22.21.0", + "eslint-plugin-json": "^4.0.1", + "eslint-plugin-jsonc": "^2.21.0", "eslint-plugin-react": "7.37.5", "file-loader": "6.2.0", "gh-pages": "3.2.3", @@ -139,6 +141,7 @@ "husky": "8.0.3", "jest": "21.2.1", "jest-junit": "7.0.0", + "jsonc-eslint-parser": "^2.4.2", "mkdirp": "1.0.4", "path-exists-cli": "^2.0.0", "raf": "3.4.1", diff --git a/src/.eslintrc.js b/src/.eslintrc.js index 665de9ff9d0..78a3ab96eaa 100644 --- a/src/.eslintrc.js +++ b/src/.eslintrc.js @@ -32,6 +32,14 @@ module.exports = { rules: { 'import/no-commonjs': 'off' } + }, + { + files: ['containers/ruby-tab/*.json'], + extends: ['plugin:jsonc/recommended-with-json'], + parser: 'jsonc-eslint-parser', + rules: { + 'max-len': 'off' + } } ], settings: { diff --git a/src/containers/ruby-tab/base-completer.js b/src/containers/ruby-tab/base-completer.js index 15a26b66773..28cfffb01c0 100644 --- a/src/containers/ruby-tab/base-completer.js +++ b/src/containers/ruby-tab/base-completer.js @@ -12,7 +12,7 @@ class BaseCompleter { return { label: item.caption, - kind: monaco.languages.CompletionItemKind.Snippet, + kind: this.#getCompletionItemKind(item.type, monaco), documentation: { value: this.#toMarkdown(description, snippet) }, @@ -23,6 +23,30 @@ class BaseCompleter { }; } + #getCompletionItemKind (type, monaco) { + switch (type) { + case 'method': + return monaco.languages.CompletionItemKind.Method; + case 'function': + return monaco.languages.CompletionItemKind.Function; + case 'variable': + return monaco.languages.CompletionItemKind.Variable; + case 'value': + return monaco.languages.CompletionItemKind.Value; + case 'constant': + return monaco.languages.CompletionItemKind.Constant; + case 'enum_member': + return monaco.languages.CompletionItemKind.EnumMember; + case 'keyword': + return monaco.languages.CompletionItemKind.Keyword; + case 'event': + return monaco.languages.CompletionItemKind.Event; + case 'snippet': + default: + return monaco.languages.CompletionItemKind.Snippet; + } + } + #toMarkdown (description, snippet) { const cleanSnippet = this.#removeSnippetVarAroundCode(snippet); return `**${description}**\n\n---\n\n\`\`\`ruby\n${cleanSnippet}\n\`\`\``; diff --git a/src/containers/ruby-tab/control-snippets.json b/src/containers/ruby-tab/control-snippets.json index cddb6d54fc0..987af59bcd9 100644 --- a/src/containers/ruby-tab/control-snippets.json +++ b/src/containers/ruby-tab/control-snippets.json @@ -1,54 +1,67 @@ { "sleep": { "snippet": "sleep(${1:1})", - "description": "(1) 秒待つ" + "description": "(1) 秒待つ", + "type": "function" }, "times": { "snippet": "${1:10}.times do\n\t${2}\nend", - "description": "(10) 回繰り返す" + "description": "(10) 回繰り返す", + "type": "snippet" }, "loop": { "snippet": "loop do\n\t${1}\nend", - "description": "ずっと" + "description": "ずっと", + "type": "snippet" }, "if": { "snippet": "if ${1:false}\n\t${2}\nend", - "description": "もし < > なら" + "description": "もし < > なら", + "type": "snippet" }, "if-else": { "snippet": "if ${1:false}\n\t${2}\nelse\n\t${3}\nend", - "description": "もし < > なら、でなければ" + "description": "もし < > なら、でなければ", + "type": "snippet" }, "wait-until": { "snippet": "wait until ${1:false}", - "description": "< > まで待つ" + "description": "< > まで待つ", + "type": "function" }, "until": { "snippet": "until ${1:false}\n\t${2}\nend", - "description": "< > まで繰り返す" + "description": "< > まで繰り返す", + "type": "snippet" }, "stop-all": { "snippet": "stop(\"${1:all}\")", - "description": "[すべてを止める▼]" + "description": "[すべてを止める▼]", + "type": "function" }, "stop-this": { "snippet": "stop(\"${1:this script}\")", - "description": "[このスクリプトを止める▼]" + "description": "[このスクリプトを止める▼]", + "type": "function" }, "stop-other": { "snippet": "stop(\"${1:other scripts in sprite}\")", - "description": "[スプライトの他のスクリプトを止める▼]" + "description": "[スプライトの他のスクリプトを止める▼]", + "type": "function" }, "when_start_as_a_clone": { "snippet": "when_start_as_a_clone do\n\t${1}\nend", - "description": "クローンされたとき" + "description": "クローンされたとき", + "type": "event" }, "create_clone": { "snippet": "create_clone(\"${1:_myself_}\")", - "description": "(自分自身▼) のクローンを作る" + "description": "(自分自身▼) のクローンを作る", + "type": "function" }, "delete_this_clone": { "snippet": "delete_this_clone", - "description": "このクローンを削除する" + "description": "このクローンを削除する", + "type": "function" } } diff --git a/src/containers/ruby-tab/events-snippets.json b/src/containers/ruby-tab/events-snippets.json index 5dddd60402f..54dc0c9699c 100644 --- a/src/containers/ruby-tab/events-snippets.json +++ b/src/containers/ruby-tab/events-snippets.json @@ -1,34 +1,42 @@ { "when_flag_clicked": { "snippet": "when_flag_clicked do\n\t${1}\nend", - "description": "旗が押されたとき" + "description": "旗が押されたとき", + "type": "event" }, "when_key_pressed": { "snippet": "when_key_pressed(\"${1:space}\") do\n\t${2}\nend", - "description": "[スペース▼] キーが押されたとき" + "description": "[スペース▼] キーが押されたとき", + "type": "event" }, "when_clicked": { "snippet": "when_clicked do\n\t${1}\nend", - "description": "このスプライトが押されたとき" + "description": "このスプライトが押されたとき", + "type": "event" }, "when_backdrop_switches": { "snippet": "when_backdrop_switches(\"${1:背景1}\") do\n\t${2}\nend", - "description": "背景が [背景1▼] になったとき" + "description": "背景が [背景1▼] になったとき", + "type": "event" }, "when_greater_than": { "snippet": "when_greater_than(\"${1:loudness}\", ${2:10}) do\n\t${3}\nend", - "description": "[音量▼] > (10) のとき" + "description": "[音量▼] > (10) のとき", + "type": "event" }, "when_receive": { "snippet": "when_receive(\"${1:メッセージ1}\") do\n\t${2}\nend", - "description": "[メッセージ1▼] を受け取ったとき" + "description": "[メッセージ1▼] を受け取ったとき", + "type": "event" }, "broadcast": { "snippet": "broadcast(\"${1:メッセージ1}\")", - "description": "(メッセージ1) を送る" + "description": "(メッセージ1) を送る", + "type": "function" }, "broadcast_and_wait": { "snippet": "broadcast_and_wait(\"${1:メッセージ1}\")", - "description": "(メッセージ1) を送って待つ" + "description": "(メッセージ1) を送って待つ", + "type": "function" } } diff --git a/src/containers/ruby-tab/gdx_for-snippets.json b/src/containers/ruby-tab/gdx_for-snippets.json index a4bea79d697..4d43f18059c 100644 --- a/src/containers/ruby-tab/gdx_for-snippets.json +++ b/src/containers/ruby-tab/gdx_for-snippets.json @@ -1,39 +1,47 @@ { "gdx_for.when_gesture": { "snippet": "gdx_for.when_gesture(\"${1:shaken}\") do\n\t${2}\nend", - "description": "(振られた▼) とき" + "description": "(振られた▼) とき", + "type": "event" }, "gdx_for.when_sensor": { "snippet": "gdx_for.when_sensor(\"${1:pushed}\") do\n\t${2}\nend", - "description": "force sensorが(押された▼)とき" + "description": "force sensorが(押された▼)とき", + "type": "event" }, "gdx_for.when_tilted": { "snippet": "gdx_for.when_tilted(\"${1:any}\") do\n\t${2}\nend", - "description": "(どれかの向き▼)に傾いたとき" + "description": "(どれかの向き▼)に傾いたとき", + "type": "event" }, "gdx_for.force": { "snippet": "gdx_for.force", - "description": "force" + "description": "force", + "type": "variable" }, "gdx_for.acceleration": { "snippet": "gdx_for.acceleration(\"${1:x}\")", - "description": "(x▼) 方向への加速度" + "description": "(x▼) 方向への加速度", + "type": "variable" }, "gdx_for.tilted?": { "snippet": "gdx_for.tilted?(\"${1:any}\")", - "description": "(どれかの向き▼) に傾いた" + "description": "(どれかの向き▼) に傾いた", + "type": "value" }, "gdx_for.tilt_angle": { "snippet": "gdx_for.tilt_angle(\"${1:front}\")", - "description": "(前▼) 方向の傾き" + "description": "(前▼) 方向の傾き", + "type": "variable" }, "gdx_for.falling?": { "snippet": "gdx_for.falling?", - "description": "落下中" + "description": "落下中", + "type": "value" }, "gdx_for.spin_speed": { "snippet": "gdx_for.spin_speed(\"${1:z}\")", - "description": "(z▼) 回転のはやさ" + "description": "(z▼) 回転のはやさ", + "type": "variable" } } - diff --git a/src/containers/ruby-tab/koshien-snippets.json b/src/containers/ruby-tab/koshien-snippets.json index 627286a1991..c70f424a487 100644 --- a/src/containers/ruby-tab/koshien-snippets.json +++ b/src/containers/ruby-tab/koshien-snippets.json @@ -1,114 +1,142 @@ { "koshien.connect_game": { "snippet": "koshien.connect_game(name: ${1:\"player1\"})", - "description": "プレイヤー名を (player1) にして、ゲームサーバへ接続する" + "description": "プレイヤー名を (player1) にして、ゲームサーバへ接続する", + "type": "function" }, "koshien.set_message": { "snippet": "koshien.set_message(${1:\"hello\"})", - "description": "メッセージを (hello) にする" + "description": "メッセージを (hello) にする", + "type": "function" }, "koshien.move_to": { "snippet": "koshien.move_to(${1:\"0:0\"})", - "description": "座標 (0:0) に移動する" + "description": "座標 (0:0) に移動する", + "type": "function" }, "koshien.get_map_area": { "snippet": "koshien.get_map_area(${1:\"0:0\"})", - "description": "座標 (0:0) 付近のマップ情報を取得する" + "description": "座標 (0:0) 付近のマップ情報を取得する", + "type": "function" }, "koshien.map": { "snippet": "koshien.map(${1:\"0:0\"})", - "description": "座標 (0:0) のマップ情報" + "description": "座標 (0:0) のマップ情報", + "type": "variable" }, "koshien.calc_goal_route": { "snippet": "koshien.calc_route(result: list(${4:\"$最短経路\"}))", - "description": "ゴールまでの最短経路をリスト [最短経路] に保存する" + "description": "ゴールまでの最短経路をリスト [最短経路] に保存する", + "type": "function" }, "koshien.calc_route": { "snippet": "koshien.calc_route(result: list(${1:\"$最短経路\"}), src: ${2:\"0:0\"}, dst: ${3:\"0:0\"}, except_cells: list(${4:\"$通らない座標\"}))", - "description": "最短経路 (始点 座標 (0:0) 終点 座標 (0:0) 通らない座標 リスト [通らない座標]) をリスト [最短経路] に保存する" + "description": "最短経路 (始点 座標 (0:0) 終点 座標 (0:0) 通らない座標 リスト [通らない座標]) をリスト [最短経路] に保存する", + "type": "function" }, "koshien.set_dynamite": { "snippet": "koshien.set_dynamite(${1:\"0:0\"})", - "description": "ダイナマイトを座標 (0:0) に置く" + "description": "ダイナマイトを座標 (0:0) に置く", + "type": "function" }, "koshien.set_bomb": { "snippet": "koshien.set_bomb(${1:\"0:0\"})", - "description": "爆弾を座標 (0:0) に置く" + "description": "爆弾を座標 (0:0) に置く", + "type": "function" }, "koshien.map_all": { "snippet": "$すべてのマップ情報 = koshien.map_all", - "description": "すべてのマップ情報" + "description": "すべてのマップ情報", + "type": "variable" }, "koshien.map_from": { "snippet": "$マップ情報 = koshien.map_from(${1:\"0:0\"}, ${2:$すべてのマップ情報})", - "description": "座標 (0:0) のマップ情報を [すべてのマップ情報] から読み込む" + "description": "座標 (0:0) のマップ情報を [すべてのマップ情報] から読み込む", + "type": "variable" }, "koshien.locate_objects": { "snippet": "koshien.locate_objects(result: list(${1:\"$地形・アイテムの座標\"}), cent: ${2:\"0:0\"}, sq_size: ${3:5}, objects: ${4:\"ABCD\"})", - "description": "範囲内の地形・アイテム (中心 座標 (0:0) 、範囲 (5) 、地形・アイテム (ABCD) )をリスト [地形・アイテムの座標] に保存する" + "description": "範囲内の地形・アイテム (中心 座標 (0:0) 、範囲 (5) 、地形・アイテム (ABCD) )をリスト [地形・アイテムの座標] に保存する", + "type": "function" }, "koshien.other_player": { "snippet": "koshien.other_player", - "description": "[対戦キャラクタ] の [座標]" + "description": "[対戦キャラクタ] の [座標]", + "type": "variable" }, "koshien.other_player_x": { "snippet": "koshien.other_player_x", - "description": "[対戦キャラクタ] の [x座標]" + "description": "[対戦キャラクタ] の [x座標]", + "type": "variable" }, "koshien.other_player_y": { "snippet": "koshien.other_player_y", - "description": "[対戦キャラクタ] の [y座標]" + "description": "[対戦キャラクタ] の [y座標]", + "type": "variable" }, "koshien.player": { "snippet": "koshien.player", - "description": "[プレイヤー] の [座標]" + "description": "[プレイヤー] の [座標]", + "type": "variable" }, "koshien.player_x": { "snippet": "koshien.player_x", - "description": "[プレイヤー] の [x座標]" + "description": "[プレイヤー] の [x座標]", + "type": "variable" }, "koshien.player_y": { "snippet": "koshien.player_y", - "description": "[プレイヤー] の [y座標]" + "description": "[プレイヤー] の [y座標]", + "type": "variable" }, "koshien.enemy": { "snippet": "koshien.enemy", - "description": "[妨害キャラクター] の [座標]" + "description": "[妨害キャラクター] の [座標]", + "type": "variable" }, "koshien.enemy_x": { "snippet": "koshien.enemy_x", - "description": "[妨害キャラクター] の [x座標]" + "description": "[妨害キャラクター] の [x座標]", + "type": "variable" }, "koshien.enemy_y": { "snippet": "koshien.enemy_y", - "description": "[妨害キャラクター] の [y座標]" + "description": "[妨害キャラクター] の [y座標]", + "type": "variable" }, "koshien.goal": { "snippet": "koshien.goal", - "description": "[ゴール] の [x座標]" + "description": "[ゴール] の [x座標]", + "type": "variable" }, "koshien.goal_x": { "snippet": "koshien.goal_x", - "description": "[ゴール] の [x座標]" + "description": "[ゴール] の [x座標]", + "type": "variable" }, "koshien.goal_y": { "snippet": "koshien.goal_y", - "description": "[ゴール] の [y座標]" + "description": "[ゴール] の [y座標]", + "type": "variable" }, "koshien.turn_over": { "snippet": "koshien.turn_over", - "description": "ターンを終了する" + "description": "ターンを終了する", + "type": "function" }, "koshien.position_of_x": { "snippet": "koshien.position_of_x(${1:\"0:0\"})", - "description": "(0:0) の [x座標]" + "description": "(0:0) の [x座標]", + "type": "variable" }, "koshien.position_of_y": { "snippet": "koshien.position_of_y(${1:\"0:0\"})", - "description": "(0:0) の [y座標]" + "description": "(0:0) の [y座標]", + "type": "variable" }, "koshien.object": { "snippet": "koshien.object(${1:\"unknown\"})", - "description": "[未探索のマス]" + "description": "[未探索のマス]", + "type": "variable" } } diff --git a/src/containers/ruby-tab/looks-snippets.json b/src/containers/ruby-tab/looks-snippets.json index a1db636dcec..39c89972981 100644 --- a/src/containers/ruby-tab/looks-snippets.json +++ b/src/containers/ruby-tab/looks-snippets.json @@ -1,86 +1,107 @@ { "say-for": { "snippet": "say(\"${1:こんにちは!}\", ${2:2})", - "description": "(こんにちは!) と (2) 秒言う" + "description": "(こんにちは!) と (2) 秒言う", + "type": "function" }, "say": { "snippet": "say(\"${1:こんにちは!}\")", - "description": "(こんにちは!) と言う" + "description": "(こんにちは!) と言う", + "type": "function" }, "think-for": { "snippet": "think(\"${1:うーん...}\", ${2:2})", - "description": "(うーん...) と (2) 秒考える" + "description": "(うーん...) と (2) 秒考える", + "type": "function" }, "think": { "snippet": "think(\"${1:うーん...}\")", - "description": "(うーん...) と考える" + "description": "(うーん...) と考える", + "type": "function" }, "switch_costume": { "snippet": "switch_costume(\"${1:コスチューム1}\")", - "description": "コスチュームを (コスチューム1▼) にする" + "description": "コスチュームを (コスチューム1▼) にする", + "type": "function" }, "next_costume": { "snippet": "next_costume", - "description": "次のコスチュームにする" + "description": "次のコスチュームにする", + "type": "function" }, "switch_backdrop": { "snippet": "switch_backdrop(\"${1:背景1}\")", - "description": "背景を (背景1▼) にする" + "description": "背景を (背景1▼) にする", + "type": "function" }, "next_backdrop": { "snippet": "next_backdrop", - "description": "次の背景にする" + "description": "次の背景にする", + "type": "function" }, "size+=": { "snippet": "self.size += ${1:10}", - "description": "大きさを (10) ずつ変える" + "description": "大きさを (10) ずつ変える", + "type": "function" }, "size=": { "snippet": "self.size = ${1:100}", - "description": "大きさを (100) %にする" + "description": "大きさを (100) %にする", + "type": "function" }, "change_effect_by": { "snippet": "change_effect_by(\"${1:color}\", ${2:25})", - "description": "[色▼] の効果を (25) ずつかえる" + "description": "[色▼] の効果を (25) ずつかえる", + "type": "function" }, "set_effect": { "snippet": "set_effect(\"${1:color}\", ${2:0})", - "description": "[色▼] の効果を (0) にする" + "description": "[色▼] の効果を (0) にする", + "type": "function" }, "clear_graphic_effects": { "snippet": "clear_graphic_effects", - "description": "画像効果をなくす" + "description": "画像効果をなくす", + "type": "function" }, "show": { "snippet": "show", - "description": "表示する" + "description": "表示する", + "type": "function" }, "hide": { "snippet": "hide", - "description": "隠す" + "description": "隠す", + "type": "function" }, "go_layers": { "snippet": "go_layers(${1:1}, \"${2:forward}\")", - "description": "(1) 層 [手前に出す▼]" + "description": "(1) 層 [手前に出す▼]", + "type": "function" }, "costume_number": { "snippet": "costume_number", - "description": "コスチュームの [番号▼]" + "description": "コスチュームの [番号▼]", + "type": "variable" }, "costume_name": { "snippet": "costume_name", - "description": "コスチュームの [名前▼]" + "description": "コスチュームの [名前▼]", + "type": "variable" }, "backdrop_number": { "snippet": "backdrop_number", - "description": "背景の [番号▼]" + "description": "背景の [番号▼]", + "type": "variable" }, "backdrop_name": { "snippet": "backdrop_name", - "description": "背景の [名前▼]" + "description": "背景の [名前▼]", + "type": "variable" }, "size": { "snippet": "size", - "description": "大きさ" + "description": "大きさ", + "type": "variable" } } diff --git a/src/containers/ruby-tab/makey-snippets.json b/src/containers/ruby-tab/makey-snippets.json index f09aa14fb1e..d50e106eab7 100644 --- a/src/containers/ruby-tab/makey-snippets.json +++ b/src/containers/ruby-tab/makey-snippets.json @@ -1,10 +1,12 @@ { "makey.when_key_pressed": { "snippet": "makey.when_key_pressed(\"${1:SPACE}\") do\n\t${2}\nend", - "description": "( ▼) キーが押されたとき" + "description": "( ▼) キーが押されたとき", + "type": "event" }, "makey.when_pressed_in_oder": { "snippet": "makey.when_pressed_in_oder(\"${1:LEFT UP RIGHT}\") do\n\t${2}\nend", - "description": "( ▼) キーが順番に押されたとき" + "description": "( ▼) キーが順番に押されたとき", + "type": "event" } } diff --git a/src/containers/ruby-tab/mesh-snippets.json b/src/containers/ruby-tab/mesh-snippets.json index ba8d9f8525c..8f6d87477d9 100644 --- a/src/containers/ruby-tab/mesh-snippets.json +++ b/src/containers/ruby-tab/mesh-snippets.json @@ -1,6 +1,7 @@ { "mesh.sensor_value": { "snippet": "mesh.sensor_value(\"${1: }\")", - "description": "( ▼) センサーの値" + "description": "( ▼) センサーの値", + "type": "variable" } } diff --git a/src/containers/ruby-tab/microbit-more-snippets.json b/src/containers/ruby-tab/microbit-more-snippets.json index aec9c3ed561..45e72a7a2d2 100644 --- a/src/containers/ruby-tab/microbit-more-snippets.json +++ b/src/containers/ruby-tab/microbit-more-snippets.json @@ -1,126 +1,157 @@ { "microbit_more.when_microbit": { "snippet": "microbit_more.when_microbit(\"${1:connected}\") do\n\t${2}\nend", - "description": "micro:bit と [つながった▼] とき" + "description": "micro:bit と [つながった▼] とき", + "type": "event" }, "microbit_more.when_button_is": { "snippet": "microbit_more.when_button_is(\"${1:A}\", \"${2:down}\") do\n\t${3}\nend", - "description": "ボタン [A▼] が [押された▼] とき" + "description": "ボタン [A▼] が [押された▼] とき", + "type": "event" }, "microbit_more.button_pressed?": { "snippet": "microbit_more.button_pressed?(\"${1:A}\")", - "description": "ボタン [A▼] が押されている" + "description": "ボタン [A▼] が押されている", + "type": "value" }, "microbit_more.when_pin_is": { "snippet": "microbit_more.when_pin_is(\"${1:LOGO}\", \"${2:touched}\") do\n\t${3}\nend", - "description": "ピン [ロゴ▼] が [タッチされた▼] とき" + "description": "ピン [ロゴ▼] が [タッチされた▼] とき", + "type": "event" }, "microbit_more.pin_is_touched?": { "snippet": "microbit_more.pin_is_touched?(\"${1:LOGO}\")", - "description": "ピン [ログ▼] がタッチされている" + "description": "ピン [ログ▼] がタッチされている", + "type": "value" }, "microbit_more.when": { "snippet": "microbit_more.when(\"${1:shake}\") do\n\t${2}\nend", - "description": "[ゆさぶられた▼] とき" + "description": "[ゆさぶられた▼] とき", + "type": "event" }, "microbit_more.display_pattern": { "snippet": "microbit_more.display_pattern(\n\t\"${1:.1.1.}\",\n\t\"${2:1.1.1}\",\n\t\"${3:1...1}\",\n\t\"${4:.1.1.}\",\n\t\"${5:..1..}\"\n)", - "description": "パターン (♡▼) を表示する" + "description": "パターン (♡▼) を表示する", + "type": "function" }, "microbit_more.display_text_delay": { "snippet": "microbit_more.display_text_delay(\"${1:Hello!}\", ${2:120})", - "description": "文字 (Hello!) を (120) ミリ秒間隔で流す" + "description": "文字 (Hello!) を (120) ミリ秒間隔で流す", + "type": "function" }, "microbit_more.clear_display": { "snippet": "microbit_more.clear_display", - "description": "画面を消す" + "description": "画面を消す", + "type": "function" }, "microbit_more.light_intensity": { "snippet": "microbit_more.light_intensity", - "description": "明るさ" + "description": "明るさ", + "type": "variable" }, "microbit_more.temperature": { "snippet": "microbit_more.temperature", - "description": "温度" + "description": "温度", + "type": "variable" }, "microbit_more.angle_with_north": { "snippet": "microbit_more.angle_with_north", - "description": "北からの角度" + "description": "北からの角度", + "type": "variable" }, "microbit_more.pitch": { "snippet": "microbit_more.pitch", - "description": "ピッチ" + "description": "ピッチ", + "type": "variable" }, "microbit_more.roll": { "snippet": "microbit_more.roll", - "description": "ロール" + "description": "ロール", + "type": "variable" }, "microbit_more.sound_level": { "snippet": "microbit_more.sound_level", - "description": "音の大きさ" + "description": "音の大きさ", + "type": "variable" }, "microbit_more.magnetic_force": { "snippet": "microbit_more.magnetic_force(\"${1:absolute}\")", - "description": "磁力 [大きさ▼]" + "description": "磁力 [大きさ▼]", + "type": "variable" }, "microbit_more.acceleration": { "snippet": "microbit_more.acceleration(\"${1:x}\")", - "description": "加速度 [x▼]" + "description": "加速度 [x▼]", + "type": "variable" }, "microbit_more.analog_value": { "snippet": "microbit_more.analog_value(\"${1:P0}\")", - "description": "ピン [P0▼] のアナログレベル" + "description": "ピン [P0▼] のアナログレベル", + "type": "variable" }, "microbit_more.set_pin_to_input_pull": { "snippet": "microbit_more.set_pin_to_input_pull(\"P0\", \"up\")", - "description": "ピン [P0▼] を [プルアップ▼] 入力にする" + "description": "ピン [P0▼] を [プルアップ▼] 入力にする", + "type": "function" }, "microbit_more.is_pin_high?": { "snippet": "microbit_more.is_pin_high?(\"${1:P0}\")", - "description": "ピン [P0▼] がハイである" + "description": "ピン [P0▼] がハイである", + "type": "value" }, "microbit_more.set_digital": { "snippet": "microbit_more.set_digital(\"${1:P0}\", \"${2:Low}\")", - "description": "ピン [P0▼] をデジタル出力 [ロー▼] にする" + "description": "ピン [P0▼] をデジタル出力 [ロー▼] にする", + "type": "function" }, "microbit_more.set_analog": { "snippet": "microbit_more.set_analog(\"${1:P0}\", ${2:0})", - "description": "ピン [P0▼] をアナログ出力 [LEVEL] %にする" + "description": "ピン [P0▼] をアナログ出力 [LEVEL] %にする", + "type": "function" }, "microbit_more.set_servo": { "snippet": "microbit_more.set_servo(\"${1:P0}\", ${2:0})", - "description": "ピン [P0▼] をサーボ (0) 度にする" + "description": "ピン [P0▼] をサーボ (0) 度にする", + "type": "function" }, "microbit_more.play_tone": { "snippet": "microbit_more.play_tone(${1:440}, ${2:100})", - "description": "(440) Hzの音を (100) %の大きさで鳴らす" + "description": "(440) Hzの音を (100) %の大きさで鳴らす", + "type": "function" }, "microbit_more.stop_tone": { "snippet": "microbit_more.stop_tone", - "description": "音を止める" + "description": "音を止める", + "type": "function" }, "microbit_more.listen_event_on": { "snippet": "microbit_more.listen_event_on(\"${1:none}\", \"${2:P0}\")", - "description": "ピン [P0▼] の [イベントを受けない▼]" + "description": "ピン [P0▼] の [イベントを受けない▼]", + "type": "function" }, "microbit_more.when_catch_at_pin": { "snippet": "microbit_more.when_catch_at_pin(\"${1:low pulse}\", \"${2:P0}\") do\n\t${3}\nend", - "description": "ピン [P0▼] で [ローパルス▼] イベントが起きたとき" + "description": "ピン [P0▼] で [ローパルス▼] イベントが起きたとき", + "type": "event" }, "microbit_more.value_of": { "snippet": "microbit_more.value_of(\"${1:low pulse}\", \"${2:P0}\")", - "description": "ピン [P0▼] の [ローパルスの期間▼]" + "description": "ピン [P0▼] の [ローパルスの期間▼]", + "type": "function" }, "microbit_more.when_data_received_from_microbit": { "snippet": "microbit_more.when_data_received_from_microbit(\"${1:label-01}\") do\n\t${2}\nend", - "description": "micro:bit からラベル (label-01) のデータを受け取ったとき" + "description": "micro:bit からラベル (label-01) のデータを受け取ったとき", + "type": "event" }, "microbit_more.data": { "snippet": "microbit_more.data[\"${1:label-01}\"]", - "description": "ラベル (label-01) のデータ" + "description": "ラベル (label-01) のデータ", + "type": "variable" }, "microbit_more.send_data_to_microbit": { "snippet": "microbit_more.send_data_to_microbit(\"${1:data}\", \"${2:label-01}\")", - "description": "micro:bit へデータ (data) にラベル (label-01) を付けて送る" + "description": "micro:bit へデータ (data) にラベル (label-01) を付けて送る", + "type": "function" } } diff --git a/src/containers/ruby-tab/microbit-snippets.json b/src/containers/ruby-tab/microbit-snippets.json index fe844d8d982..cd3b5376b1e 100644 --- a/src/containers/ruby-tab/microbit-snippets.json +++ b/src/containers/ruby-tab/microbit-snippets.json @@ -1,38 +1,47 @@ { "microbit.when_button_pressed": { "snippet": "microbit.when_button_pressed(\"${1:A}\") do\n\t${2}\nend", - "description": "ボタン (A▼) が押されたとき" + "description": "ボタン (A▼) が押されたとき", + "type": "event" }, "microbit.button_pressed?": { "snippet": "microbit.button_pressed?(\"${1:A}\")", - "description": "ボタン (A▼) が押された" + "description": "ボタン (A▼) が押された", + "type": "function" }, "microbit.when": { "snippet": "microbit.when(\"${1:moved}\") do\n\t${2}\nend", - "description": "(動いた▼) とき" + "description": "(動いた▼) とき", + "type": "event" }, "microbit.display_text": { "snippet": "microbit.display_text(\"${1:こんにちは!}\")", - "description": "(こんにちは!) を表示する" + "description": "(こんにちは!) を表示する", + "type": "function" }, "microbit.display": { "snippet": "microbit.display(\n \"${1:.1.1.}\",\n \"${2:1.1.1}\",\n \"${3:1...1}\",\n \"${4:.1.1.}\",\n \"${5:..1..}\"\n)", - "description": "(♡▼) を表示する" + "description": "(♡▼) を表示する", + "type": "function" }, "microbit.when_tilted": { "snippet": "microbit.when_tilted(\"${1:any}\") do\n\t${2}\nend", - "description": "(どれかの向き▼) に傾いたとき" + "description": "(どれかの向き▼) に傾いたとき", + "type": "event" }, "microbit.tilted?": { "snippet": "microbit.tilted?(\"${1:any}\")", - "description": "(どれかの向き▼) に傾いた" + "description": "(どれかの向き▼) に傾いた", + "type": "value" }, "microbit.tilt_angle": { "snippet": "microbit.tilt_angle(\"${1:front}\")", - "description": "(前▼) 方向の傾き" + "description": "(前▼) 方向の傾き", + "type": "variable" }, "microbit.when_pin_connected": { "snippet": "microbit.when_pin_connected(${1:0}) do\n\t${2}\nend", - "description": "ピン (0▼) がつながったとき" + "description": "ピン (0▼) がつながったとき", + "type": "event" } } diff --git a/src/containers/ruby-tab/motion-snippets.json b/src/containers/ruby-tab/motion-snippets.json index 26458007142..43a719a744f 100644 --- a/src/containers/ruby-tab/motion-snippets.json +++ b/src/containers/ruby-tab/motion-snippets.json @@ -1,94 +1,117 @@ { "move": { "snippet": "move(${1:10})", - "description": "(10) 歩動かす" + "description": "(10) 歩動かす", + "type": "function" }, "turn_right": { "snippet": "turn_right(${1:15})", - "description": "時計回りに (15) 度回す" + "description": "時計回りに (15) 度回す", + "type": "function" }, "turn_left": { "snippet": "turn_left(${1:15})", - "description": "反時計回りに (15) 度回す" + "description": "反時計回りに (15) 度回す", + "type": "function" }, "go_to": { "snippet": "go_to(\"${1:_random_}\")", - "description": "(どこかの場所▼) へ行く" + "description": "(どこかの場所▼) へ行く", + "type": "function" }, "_random_": { "snippet": "_random_", - "description": "どこかの場所" + "description": "どこかの場所", + "type": "enum_member" }, "_mouse_": { "snippet": "_mouse_", - "description": "マウスのポインター" + "description": "マウスのポインター", + "type": "enum_member" }, "go_to-xy": { "snippet": "go_to([${1:0}, ${2:0}])", - "description": "x座標を (0) 、y座標を (0) にする" + "description": "x座標を (0) 、y座標を (0) にする", + "type": "function" }, "glide": { "snippet": "glide(\"${1:_random_}\", secs: ${2:1})", - "description": "(1) 秒で (どこかの場所▼) へ行く" + "description": "(1) 秒で (どこかの場所▼) へ行く", + "type": "function" }, "glide-xy": { "snippet": "glide([${1:0}, ${2:0}], secs: ${3:1})", - "description": "(1) 秒でx座標を (0) に、y座標を (0) にする" + "description": "(1) 秒でx座標を (0) に、y座標を (0) にする", + "type": "function" }, "direction=": { "snippet": "self.direction = ${1:90}", - "description": "(90) 度に向ける" + "description": "(90) 度に向ける", + "type": "function" }, "point_towards": { "snippet": "point_towards(\"${1:_mouse_}\")", - "description": "(マウスのポインター▼) へ向ける" + "description": "(マウスのポインター▼) へ向ける", + "type": "function" }, "x+=": { "snippet": "self.x += ${1:10}", - "description": "x座標を (10) ずつ変える" + "description": "x座標を (10) ずつ変える", + "type": "function" }, "x=": { "snippet": "self.x = ${1:0}", - "description": "x座標を (0) にする" + "description": "x座標を (0) にする", + "type": "function" }, "y+=": { "snippet": "self.y += ${1:10}", - "description": "y座標を (10) ずつ変える" + "description": "y座標を (10) ずつ変える", + "type": "function" }, "y=": { "snippet": "self.y = ${1:0}", - "description": "y座標を (0) にする" + "description": "y座標を (0) にする", + "type": "function" }, "bounce_if_on_edge": { "snippet": "bounce_if_on_edge", - "description": "もし端についたら、跳ね返る" + "description": "もし端についたら、跳ね返る", + "type": "function" }, "rotation_style=": { "snippet": "self.rotation_style = \"${1:left-right}\"", - "description": "回転方法を [左右のみ▼] にする" + "description": "回転方法を [左右のみ▼] にする", + "type": "function" }, "left-right": { "snippet": "left-right", - "description": "左右のみ" + "description": "左右のみ", + "type": "enum_member" }, "don't_rotate": { "snippet": "don't rotate", - "description": "回転しない" + "description": "回転しない", + "type": "enum_member" }, "all_around": { "snippet": "all around", - "description": "自由に回転" + "description": "自由に回転", + "type": "enum_member" }, "x": { "snippet": "x", - "description": "x座標" + "description": "x座標", + "type": "variable" }, "y": { "snippet": "y", - "description": "y座標" + "description": "y座標", + "type": "variable" }, "direction": { "snippet": "direction", - "description": "向き" + "description": "向き", + "type": "variable" } } diff --git a/src/containers/ruby-tab/music-snippets.json b/src/containers/ruby-tab/music-snippets.json index 7873796d0f2..bb4f214656d 100644 --- a/src/containers/ruby-tab/music-snippets.json +++ b/src/containers/ruby-tab/music-snippets.json @@ -1,186 +1,232 @@ { "music.play_drum": { "snippet": "play_drum(drum: ${1:1}, beats: ${2:0.25})", - "description": "((1)スネアドラム▼) のドラムを (0.25) 拍鳴らす" + "description": "((1)スネアドラム▼) のドラムを (0.25) 拍鳴らす", + "type": "function" }, "music.d-snare": { "snippet": "1", - "description": "(1) スネアドラム" + "description": "(1) スネアドラム", + "type": "enum_member" }, "music.d-bass": { "snippet": "2", - "description": "(2) バスドラム" + "description": "(2) バスドラム", + "type": "enum_member" }, "music.d-side-stick": { "snippet": "3", - "description": "(3) サイドスティック" + "description": "(3) サイドスティック", + "type": "enum_member" }, "music.d-crash-cymbal": { "snippet": "4", - "description": "(4) クラッシュシンバル" + "description": "(4) クラッシュシンバル", + "type": "enum_member" }, "music.d-open-hihat": { "snippet": "5", - "description": "(5) オープンハイハット" + "description": "(5) オープンハイハット", + "type": "enum_member" }, "music.d-closed-hihat": { "snippet": "6", - "description": "(6) クローズハイハット" + "description": "(6) クローズハイハット", + "type": "enum_member" }, "music.d-tambourine": { "snippet": "7", - "description": "(7) タンバリン" + "description": "(7) タンバリン", + "type": "enum_member" }, "music.d-hand-clap": { "snippet": "8", - "description": "(8) 手拍子" + "description": "(8) 手拍子", + "type": "enum_member" }, "music.d-claves": { "snippet": "9", - "description": "(9) クラーベ" + "description": "(9) クラーベ", + "type": "enum_member" }, "music.d-wood-block": { "snippet": "10", - "description": "(10) ウッドブロック" + "description": "(10) ウッドブロック", + "type": "enum_member" }, "music.d-cowbell": { "snippet": "11", - "description": "(11) カウベル" + "description": "(11) カウベル", + "type": "enum_member" }, "music.d-triangle": { "snippet": "12", - "description": "(12) トライアングル" + "description": "(12) トライアングル", + "type": "enum_member" }, "music.d-bongo": { "snippet": "13", - "description": "(13) ボンゴ" + "description": "(13) ボンゴ", + "type": "enum_member" }, "music.d-conga": { "snippet": "14", - "description": "(14) コンガ" + "description": "(14) コンガ", + "type": "enum_member" }, "music.d-cabasa": { "snippet": "15", - "description": "(15) カバサ" + "description": "(15) カバサ", + "type": "enum_member" }, "music.d-guiro": { "snippet": "16", - "description": "(16) ギロ" + "description": "(16) ギロ", + "type": "enum_member" }, "music.d-vibraslap": { "snippet": "17", - "description": "(17) ビブラスラップ" + "description": "(17) ビブラスラップ", + "type": "enum_member" }, "music.d-cuica": { "snippet": "18", - "description": "(18) クイーカ" + "description": "(18) クイーカ", + "type": "enum_member" }, "music.rest": { "snippet": "rest(${1:0.25})", - "description": "(0.25) 拍休む" + "description": "(0.25) 拍休む", + "type": "function" }, "music.play_note": { "snippet": "play_note(note: ${1:60}, beats: ${2:0.25})", - "description": "(60) の音符を (0.25) 拍鳴らす" + "description": "(60) の音符を (0.25) 拍鳴らす", + "type": "function" }, "music.instrument=": { "snippet": "self.instrument = ${1:1}", - "description": "楽器を ((1)ピアノ▼) にする" + "description": "楽器を ((1)ピアノ▼) にする", + "type": "function" }, "music.i-piano": { "snippet": "1", - "description": "(1) ピアノ" + "description": "(1) ピアノ", + "type": "enum_member" }, "music.i-electric-piano": { "snippet": "2", - "description": "(2) 電子ピアノ" + "description": "(2) 電子ピアノ", + "type": "enum_member" }, "music.i-organ": { "snippet": "3", - "description": "(3) オルガン" + "description": "(3) オルガン", + "type": "enum_member" }, "music.i-guitar": { "snippet": "4", - "description": "(4) ギター" + "description": "(4) ギター", + "type": "enum_member" }, "music.i-electric-guitar": { "snippet": "5", - "description": "(5) エレキギター" + "description": "(5) エレキギター", + "type": "enum_member" }, "music.i-bass": { "snippet": "6", - "description": "(6) ベース" + "description": "(6) ベース", + "type": "enum_member" }, "music.i-pizzicato": { "snippet": "7", - "description": "(7) ピチカート" + "description": "(7) ピチカート", + "type": "enum_member" }, "music.i-cello": { "snippet": "8", - "description": "(8) チェロ" + "description": "(8) チェロ", + "type": "enum_member" }, "music.i-trombone": { "snippet": "9", - "description": "(9) トロンボーン" + "description": "(9) トロンボーン", + "type": "enum_member" }, "music.i-clarinet": { "snippet": "10", - "description": "(10) クラリネット" + "description": "(10) クラリネット", + "type": "enum_member" }, "music.i-saxophone": { "snippet": "11", - "description": "(11) サクソフォン" + "description": "(11) サクソフォン", + "type": "enum_member" }, "music.i-flute": { "snippet": "12", - "description": "(12) フルート" + "description": "(12) フルート", + "type": "enum_member" }, "music.i-wooden-flute": { "snippet": "13", - "description": "(13) 木管フルート" + "description": "(13) 木管フルート", + "type": "enum_member" }, "music.i-bassoon": { "snippet": "14", - "description": "(14) バスーン" + "description": "(14) バスーン", + "type": "enum_member" }, "music.i-choir": { "snippet": "15", - "description": "(15) 合唱団" + "description": "(15) 合唱団", + "type": "enum_member" }, "music.i-vibraphone": { "snippet": "16", - "description": "(16) ビブラフォン" + "description": "(16) ビブラフォン", + "type": "enum_member" }, "music.i-music-box": { "snippet": "17", - "description": "(17) ミュージックボックス" + "description": "(17) ミュージックボックス", + "type": "enum_member" }, "music.i-steel-drum": { "snippet": "18", - "description": "(18) スチールドラム" + "description": "(18) スチールドラム", + "type": "enum_member" }, "music.i-marimba": { "snippet": "19", - "description": "(19) マリンバ" + "description": "(19) マリンバ", + "type": "enum_member" }, "music.i-synth-lead": { "snippet": "20", - "description": "(20) シンセリード" + "description": "(20) シンセリード", + "type": "enum_member" }, "music.i-synth-pad": { "snippet": "21", - "description": "(21) シンセパッド" + "description": "(21) シンセパッド", + "type": "enum_member" }, "music.tempo=": { "snippet": "self.tempo = ${1:60}", - "description": "テンポを (60) にする" + "description": "テンポを (60) にする", + "type": "function" }, "music.tempo+=": { "snippet": "self.tempo += ${1:20}", - "description": "テンポを (20) ずつ変える" + "description": "テンポを (20) ずつ変える", + "type": "function" }, "music.tempo": { "snippet": "tempo", - "description": "テンポ" + "description": "テンポ", + "type": "variable" } } diff --git a/src/containers/ruby-tab/operators-snippets.json b/src/containers/ruby-tab/operators-snippets.json index 705d771f37d..7d8964fad7f 100644 --- a/src/containers/ruby-tab/operators-snippets.json +++ b/src/containers/ruby-tab/operators-snippets.json @@ -1,86 +1,107 @@ { "rand": { "snippet": "rand(${1:1}..${2:10})", - "description": "(1) から (10) までの乱数" + "description": "(1) から (10) までの乱数", + "type": "variable" }, "and": { "snippet": "${1:false} && ${2:false}", - "description": "< > かつ < >" + "description": "< > かつ < >", + "type": "variable" }, "or": { "snippet": "${1:false} || ${2:false}", - "description": "< > または < >" + "description": "< > または < >", + "type": "variable" }, "not": { "snippet": "!${1:false}", - "description": "< > ではない" + "description": "< > ではない", + "type": "variable" }, "string+": { "snippet": "\"${1:りんご}\" + \"${2:バナナ}\"", - "description": "(りんご) と (バナナ)" + "description": "(りんご) と (バナナ)", + "type": "variable" }, "string[]": { "snippet": "\"${1:りんご}\"[${2:1}]", - "description": "(りんご) の (1) 番目の文字" + "description": "(りんご) の (1) 番目の文字", + "type": "variable" }, "string.length": { "snippet": "\"${1:りんご}\".length", - "description": "(りんご) の長さ" + "description": "(りんご) の長さ", + "type": "variable" }, "string.include?": { "snippet": "\"${1:りんご}\".include?(\"${2:り}\")", - "description": "(りんご) に (り) が含まれる" + "description": "(りんご) に (り) が含まれる", + "type": "value" }, "round": { "snippet": "${1:0}.round", - "description": "(0) を四捨五入" + "description": "(0) を四捨五入", + "type": "variable" }, "abs": { "snippet": "${1:0}.abs", - "description": "(0) の [絶対値▼]" + "description": "(0) の [絶対値▼]", + "type": "variable" }, "floor": { "snippet": "${1:0}.floor", - "description": "(0) の [切り下げ▼]" + "description": "(0) の [切り下げ▼]", + "type": "variable" }, "ceil": { "snippet": "${1:0}.ceil", - "description": "(0) の [切り上げ▼]" + "description": "(0) の [切り上げ▼]", + "type": "variable" }, "sqrt": { "snippet": "Math.sqrt(${1:0})", - "description": "(0) の [平方根▼]" + "description": "(0) の [平方根▼]", + "type": "variable" }, "sin": { "snippet": "Math.sin(${1:0})", - "description": "(0) の [sin▼]" + "description": "(0) の [sin▼]", + "type": "variable" }, "cos": { "snippet": "Math.cos(${1:0})", - "description": "(0) の [cons▼]" + "description": "(0) の [cons▼]", + "type": "variable" }, "tan": { "snippet": "Math.tan(${1:0})", - "description": "(0) の [tan▼]" + "description": "(0) の [tan▼]", + "type": "variable" }, "asin": { "snippet": "Math.asin(${1:0})", - "description": "(0) の [asin▼]" + "description": "(0) の [asin▼]", + "type": "variable" }, "acos": { "snippet": "Math.acos(${1:0})", - "description": "(0) の [acos▼]" + "description": "(0) の [acos▼]", + "type": "variable" }, "atan": { "snippet": "Math.atan(${1:0})", - "description": "(0) の [atan▼]" + "description": "(0) の [atan▼]", + "type": "variable" }, "log": { "snippet": "Math.log(${1:0})", - "description": "(0) の [In▼]" + "description": "(0) の [In▼]", + "type": "variable" }, "log10": { "snippet": "Math.log10(${1:0})", - "description": "(0) の [log▼]" + "description": "(0) の [log▼]", + "type": "variable" } } diff --git a/src/containers/ruby-tab/pen-snippets.json b/src/containers/ruby-tab/pen-snippets.json index 4ae7522fa4d..450a28c880e 100644 --- a/src/containers/ruby-tab/pen-snippets.json +++ b/src/containers/ruby-tab/pen-snippets.json @@ -1,62 +1,77 @@ { "pen.clear": { "snippet": "Pen.clear", - "description": "全部消す" + "description": "全部消す", + "type": "function" }, "pen.stamp": { "snippet": "pen.stamp", - "description": "スタンプ" + "description": "スタンプ", + "type": "function" }, "pen.down": { "snippet": "pen.down", - "description": "ペンを下ろす" + "description": "ペンを下ろす", + "type": "function" }, "pen.up": { "snippet": "pen.up", - "description": "ペンを上げる" + "description": "ペンを上げる", + "type": "function" }, "pen.color=#": { "snippet": "pen.color = \"#${1:7a2d74}\"", - "description": "ペンの色を (#7a2d74) にする" + "description": "ペンの色を (#7a2d74) にする", + "type": "function" }, "pen.color+=": { "snippet": "pen.color += ${1:10}", - "description": "ペンの [色▼] を (10) ずつ変える" + "description": "ペンの [色▼] を (10) ずつ変える", + "type": "function" }, "pen.saturation+=": { "snippet": "pen.saturation += ${1:10}", - "description": "ペンの [鮮やかさ▼] を (10) ずつ変える" + "description": "ペンの [鮮やかさ▼] を (10) ずつ変える", + "type": "function" }, "pen.brightness+=": { "snippet": "pen.brightness += ${1:10}", - "description": "ペンの [明るさ▼] を (10) ずつ変える" + "description": "ペンの [明るさ▼] を (10) ずつ変える", + "type": "function" }, "pen.transparency+=": { "snippet": "pen.transparency += ${1:10}", - "description": "ペンの [透明度▼] を (10) ずつ変える" + "description": "ペンの [透明度▼] を (10) ずつ変える", + "type": "function" }, "pen.color=": { "snippet": "pen.color = ${1:50}", - "description": "ペンの [色▼] を (50) にする" + "description": "ペンの [色▼] を (50) にする", + "type": "function" }, "pen.saturation=": { "snippet": "pen.saturation = ${1:50}", - "description": "ペンの [鮮やかさ▼] を (50) にする" + "description": "ペンの [鮮やかさ▼] を (50) にする", + "type": "function" }, "pen.brightness=": { "snippet": "pen.brightness = ${1:50}", - "description": "ペンの [明るさ▼] を (50) にする" + "description": "ペンの [明るさ▼] を (50) にする", + "type": "function" }, "pen.transparency=": { "snippet": "pen.transparency = ${1:50}", - "description": "ペンの [透明度▼] を (50) にする" + "description": "ペンの [透明度▼] を (50) にする", + "type": "function" }, "pen.size+=": { "snippet": "pen.size += ${1:1}", - "description": "ペンの太さを (1) ずつ変える" + "description": "ペンの太さを (1) ずつ変える", + "type": "function" }, "pen.size=": { "snippet": "pen.size = ${1:1}", - "description": "ペンの太さを (1) にする" + "description": "ペンの太さを (1) にする", + "type": "function" } } diff --git a/src/containers/ruby-tab/procedure-snippets.json b/src/containers/ruby-tab/procedure-snippets.json index 58d2449a2dc..de8c2584f57 100644 --- a/src/containers/ruby-tab/procedure-snippets.json +++ b/src/containers/ruby-tab/procedure-snippets.json @@ -1,6 +1,7 @@ { "def": { "snippet": "def self.${1:ブロック名}(${2:number_or_text})\n\t${3}\nend", - "description": "定義 ブロック名 (number_or_text)" + "description": "定義 ブロック名 (number_or_text)", + "type": "snippet" } } diff --git a/src/containers/ruby-tab/sensing-snippets.json b/src/containers/ruby-tab/sensing-snippets.json index 6eb3fa0a6d1..618dc8eb672 100644 --- a/src/containers/ruby-tab/sensing-snippets.json +++ b/src/containers/ruby-tab/sensing-snippets.json @@ -1,138 +1,172 @@ { "touching?": { "snippet": "touching?(\"${1:_mouse_}\")", - "description": "(マウスのポインター▼) に触れた" + "description": "(マウスのポインター▼) に触れた", + "type": "method" }, "touching_color?": { "snippet": "touching_color?(\"${1:#571332}\")", - "description": "(#571332▼) 色に触れた" + "description": "(#571332▼) 色に触れた", + "type": "method" }, "color_is_touching_color?": { "snippet": "color_is_touching_color?(\"#${1:ce2ef7}\", \"#${2:6a7a0e}\")", - "description": "(#ce2ef7▼) 色が (#6a7a0e▼) 色に触れた" + "description": "(#ce2ef7▼) 色が (#6a7a0e▼) 色に触れた", + "type": "method" }, "distance": { "snippet": "distance(\"${1:_mouse_}\")", - "description": "(マウスのポインター▼) までの距離" + "description": "(マウス의ポインター▼) までの距離", + "type": "method" }, "ask": { "snippet": "ask(\"${1:あなたの名前は何ですか?}\")", - "description": "(あなたの名前は何ですか?) と聞いて待つ" + "description": "(あなたの名前は何ですか?) と聞いて待つ", + "type": "method" }, "answer": { "snippet": "answer", - "description": "答え" + "description": "答え", + "type": "variable" }, "Keyboard.pressed?": { "snippet": "Keyboard.pressed?(\"${1:space}\")", - "description": "[スペースキー▼] が押された" + "description": "[スペースキー▼] が押された", + "type": "method" }, "Mouse.down?": { "snippet": "Mouse.down?", - "description": "マウスが押された" + "description": "マウスが押された", + "type": "method" }, "Mouse.x": { "snippet": "Mouse.x", - "description": "マウスのx座標" + "description": "マウスのx座標", + "type": "variable" }, "Mouse.y": { "snippet": "Mouse.y", - "description": "マウスのy座標" + "description": "マウスのy座標", + "type": "variable" }, "drag_mode=": { "snippet": "self.drag_mode = \"${1:draggable}\"", - "description": "ドラッグ [できる▼] ようにする" + "description": "ドラッグ [できる▼] ようにする", + "type": "method" }, "loudness": { "snippet": "loudness", - "description": "音量" + "description": "音量", + "type": "variable" }, "Timer.value": { "snippet": "Timer.value", - "description": "タイマー" + "description": "タイマー", + "type": "variable" }, "Timer.reset": { "snippet": "Timer.reset", - "description": "タイマーをリセット" + "description": "タイマーをリセット", + "type": "method" }, "stage.backdrop_number": { "snippet": "stage.backdrop_number", - "description": "(ステージ▼) の [背景#▼]" + "description": "(ステージ▼) の [背景#▼]", + "type": "variable" }, "stage.backdrop_name": { "snippet": "stage.backdrop_name", - "description": "(ステージ▼) の [背景の名前▼]" + "description": "(ステージ▼) の [背景の名前▼]", + "type": "variable" }, "stage.volume": { "snippet": "stage.volume", - "description": "(ステージ▼) の [音量▼]" + "description": "(ステージ▼) の [音量▼]", + "type": "variable" }, "stage.variable": { "snippet": "stage.variable(\"${1:変数}\")", - "description": "(ステージ▼) の [変数▼]" + "description": "(ステージ▼) の [変数▼]", + "type": "method" }, "sprite.x": { "snippet": "sprite(\"${1:スプライト1}\").x", - "description": "(スプライト1▼) の [x座標▼]" + "description": "(スプライト1▼) の [x座標▼]", + "type": "variable" }, "sprite.y": { "snippet": "sprite(\"${1:スプライト1}\").y", - "description": "(スプライト1▼) の [y座標▼]" + "description": "(スプライト1▼) の [y座標▼]", + "type": "variable" }, "sprite.direction": { "snippet": "sprite(\"${1:スプライト1}\").direction", - "description": "(スプライト1▼) の [向き▼]" + "description": "(スプライト1▼) の [向き▼]", + "type": "variable" }, "sprite.costume_number": { "snippet": "sprite(\"${1:スプライト1}\").costume_number", - "description": "(スプライト1▼) の [コスチューム#▼]" + "description": "(スプライト1▼) の [コスチューム#▼]", + "type": "variable" }, "sprite.costume_name": { "snippet": "sprite(\"${1:スプライト1}\").costume_name", - "description": "(スプライト1▼) の [コスチューム名▼]" + "description": "(スプライト1▼) の [コスチューム名▼]", + "type": "variable" }, "sprite.size": { "snippet": "sprite(\"${1:スプライト1}\").size", - "description": "(スプライト1▼) の [大きさ▼]" + "description": "(スプライト1▼) の [大きさ▼]", + "type": "variable" }, "sprite.volume": { "snippet": "sprite(\"${1:スプライト1}\").volume", - "description": "(スプライト1▼) の [音量▼]" + "description": "(スプライト1▼) の [音量▼]", + "type": "variable" }, "current_year": { "snippet": "Time.now.year", - "description": "現在の [年▼]" + "description": "現在の [年▼]", + "type": "constant" }, "current_month": { "snippet": "Time.now.month", - "description": "現在の [月▼]" + "description": "現在の [月▼]", + "type": "constant" }, "current_day": { "snippet": "Time.now.day", - "description": "現在の [日▼]" + "description": "現在の [日▼]", + "type": "constant" }, "current_day_of_week": { "snippet": "Time.now.date", - "description": "現在の [曜日▼]" + "description": "現在の [曜日▼]", + "type": "constant" }, "current_hour": { "snippet": "Time.now.hour", - "description": "現在の [時▼]" + "description": "現在の [時▼]", + "type": "constant" }, "current_minute": { "snippet": "Time.now.min", - "description": "現在の [分▼]" + "description": "現在の [分▼]", + "type": "constant" }, "current_second": { "snippet": "Time.now.sec", - "description": "現在の [秒▼]" + "description": "現在の [秒▼]", + "type": "constant" }, "days_since_2000": { "snippet": "days_since_2000", - "description": "2000年からの日数" + "description": "2000年からの日数", + "type": "constant" }, "user_name": { "snippet": "user_name", - "description": "ユーザー名" + "description": "ユーザー名", + "type": "constant" } } diff --git a/src/containers/ruby-tab/smalrubot-s1-snippets.json b/src/containers/ruby-tab/smalrubot-s1-snippets.json index d25ef9774d6..716588f8870 100644 --- a/src/containers/ruby-tab/smalrubot-s1-snippets.json +++ b/src/containers/ruby-tab/smalrubot-s1-snippets.json @@ -1,66 +1,82 @@ { "smalrubot_s1.action": { "snippet": "smalrubot_s1.action(\"${1:forward}\")", - "description": "[進める▼]" + "description": "[進める▼]", + "type": "function" }, "smalrubot_s1.a-forward": { "snippet": "forward", - "description": "進める" + "description": "進める", + "type": "enum_member" }, "smalrubot_s1.a-backward": { "snippet": "backward", - "description": "バックさせる" + "description": "バックさせる", + "type": "enum_member" }, "smalrubot_s1.a-turn-left": { "snippet": "left", - "description": "左に曲げる" + "description": "左に曲げる", + "type": "enum_member" }, "smalrubot_s1.a-turn-right": { "snippet": "right", - "description": "右に曲げる" + "description": "右に曲げる", + "type": "enum_member" }, "smalrubot_s1.a-stop": { "snippet": "stop", - "description": "止める" + "description": "止める", + "type": "enum_member" }, "smalrubot_s1.action-in": { "snippet": "smalrubot_s1.action(\"${1:forward}\", ${2:0.5})", - "description": "(0.5) 秒 [進める▼]" + "description": "(0.5) 秒 [進める▼]", + "type": "function" }, "smalrubot_s1.bend_arm": { "snippet": "smalrubot_s1.bend_arm(${1:90}, ${2:1})", - "description": "(1) 秒でアームを (90) 度に曲げる" + "description": "(1) 秒でアームを (90) 度に曲げる", + "type": "function" }, "smalrubot_s1.sensor_value": { "snippet": "smalrubot_s1.sensor_value(\"${1:left}\")", - "description": "[左▼] のセンサー" + "description": "[左▼] のセンサー", + "type": "variable" }, "smalrubot_s1.d-left": { "snippet": "left", - "description": "左" + "description": "左", + "type": "enum_member" }, "smalrubot_s1.d-right": { "snippet": "right", - "description": "右" + "description": "右", + "type": "enum_member" }, "smalrubot_s1.led_on": { "snippet": "smalrubot_s1.led(\"${1:left}\", true)", - "description": "[左▼] のLEDをオンにする" + "description": "[左▼] のLEDをオンにする", + "type": "function" }, "smalrubot_s1.led_off": { "snippet": "smalrubot_s1.led(\"${1:left}\", false)", - "description": "[左▼] のLEDをオフにする" + "description": "[左▼] のLEDをオフにする", + "type": "function" }, "smalrubot_s1.get_motor_speed": { "snippet": "smalrubot_s1.get_motor_speed(\"${1:left}\")", - "description": "[左▼] DCモーターの速度 (%)" + "description": "[左▼] DCモーターの速度 (%)", + "type": "variable" }, "smalrubot_s1.set_motor_speed": { "snippet": "smalrubot_s1.set_motor_speed(\"${1:left}\", ${1:50})", - "description": "[左▼] DCモーターの速度を (50) (%) にする" + "description": "[左▼] DCモーターの速度を (50) (%) にする", + "type": "function" }, "smalrubot_s1.arm_calibration=": { "snippet": "smalrubot_s1.arm_calibration = ${1:0}", - "description": "アームを (0) 度調整する" + "description": "アームを (0) 度調整する", + "type": "function" } } diff --git a/src/containers/ruby-tab/snippets-completer.js b/src/containers/ruby-tab/snippets-completer.js index 831e3bdcc1c..0e885ccba8e 100644 --- a/src/containers/ruby-tab/snippets-completer.js +++ b/src/containers/ruby-tab/snippets-completer.js @@ -56,7 +56,7 @@ class SnippetsCompleter extends BaseCompleter { snippetsList.forEach(snippets => { for (const [caption, item] of Object.entries(snippets)) { item.caption = caption; - item.type = 'snippet'; + item.type = item.type || 'snippet'; this.#completions.push(item); } }); diff --git a/src/containers/ruby-tab/sound-snippets.json b/src/containers/ruby-tab/sound-snippets.json index 46167a727fa..08f452f098a 100644 --- a/src/containers/ruby-tab/sound-snippets.json +++ b/src/containers/ruby-tab/sound-snippets.json @@ -1,38 +1,47 @@ { "play_until_done": { "snippet": "play_until_done(\"${1:ニャー}\")", - "description": "終わるまで (ニャー▼) の音を鳴らす" + "description": "終わるまで (ニャー▼) の音を鳴らす", + "type": "method" }, "play": { "snippet":"play(\"${1:ニャー}\")", - "description": "(ニャー▼) の音を鳴らす" + "description": "(ニャー▼) の音を鳴らす", + "type": "method" }, "stop_all_sounds": { "snippet": "stop_all_sounds", - "description": "すべての音を止める" + "description": "すべての音を止める", + "type": "method" }, "change_sound_effect_by": { "snippet": "change_sound_effect_by(\"${1:pitch}\", ${2:10})", - "description": "[ピッチ▼] の効果を (10) ずつ変える" + "description": "[ピッチ▼] の効果を (10) ずつ変える", + "type": "method" }, "set_sound_effect": { "snippet": "set_sound_effect(\"${1:pitch}\", ${2:100})", - "description": "[ピッチ▼] の効果を (100) にする" + "description": "[ピッチ▼] の効果を (100) にする", + "type": "method" }, "clear_sound_effects": { "snippet": "clear_sound_effects", - "description": "音の効果をなくす" + "description": "音の効果をなくす", + "type": "method" }, "volume+=": { "snippet": "self.volume += ${1:-10}", - "description": "音量を (-10) ずつ変える" + "description": "音量を (-10) ずつ変える", + "type": "method" }, "volume=": { "snippet": "self.volume = ${1:100}", - "description": "音量を (100) %にする" + "description": "音量を (100) %にする", + "type": "method" }, "volume": { "snippet": "volume", - "description": "音量" + "description": "音量", + "type": "variable" } } diff --git a/src/containers/ruby-tab/text-to-speech-snippets.json b/src/containers/ruby-tab/text-to-speech-snippets.json index bd541bade55..77e304849c1 100644 --- a/src/containers/ruby-tab/text-to-speech-snippets.json +++ b/src/containers/ruby-tab/text-to-speech-snippets.json @@ -1,14 +1,17 @@ { "text2speech.speak": { "snippet": "text2speech.speak(\"${1:こんにちは}\")", - "description": "(こんにちは) としゃべる" + "description": "(こんにちは) としゃべる", + "type": "function" }, "text2speech.voice=": { "snippet": "text2speech.voice = \"${1:alto}\"", - "description": "声を (アルト▼) にする" + "description": "声を (アルト▼) にする", + "type": "function" }, "text2speech.language=": { "snippet": "text2speech.language = \"${1:ja}\"", - "description": "言語を (日本語▼) にする" + "description": "言語を (日本語▼) にする", + "type": "function" } } diff --git a/src/containers/ruby-tab/translate-snippets.json b/src/containers/ruby-tab/translate-snippets.json index ce682fd0647..e350f65a876 100644 --- a/src/containers/ruby-tab/translate-snippets.json +++ b/src/containers/ruby-tab/translate-snippets.json @@ -1,10 +1,12 @@ { "translate.translate": { "snippet": "translate(\"${1:こんにちは}\", \"${2:en}\")", - "description": "(こんにちは) を (英語▼) に翻訳する" + "description": "(こんにちは) を (英語▼) に翻訳する", + "type": "variable" }, "translate.language": { "snippet": "language", - "description": "言語" + "description": "言語", + "type": "variable" } } diff --git a/src/containers/ruby-tab/variables-snippets.json b/src/containers/ruby-tab/variables-snippets.json index a3564a5790d..6a96f09cdfe 100644 --- a/src/containers/ruby-tab/variables-snippets.json +++ b/src/containers/ruby-tab/variables-snippets.json @@ -1,70 +1,87 @@ { "$": { "snippet": "$${1:変数}", - "description": "変数" + "description": "変数", + "type": "variable" }, "$=": { "snippet": "$${1:変数} = ${2:0}", - "description": "[変数▼] を (0) にする" + "description": "[変数▼] を (0) にする", + "type": "function" }, "$+=": { "snippet": "$${1:変数} += ${2:1}", - "description": "[変数▼] を (1) ずつ変える" + "description": "[変数▼] を (1) ずつ変える", + "type": "function" }, "show_variable": { "snippet": "show_variable(\"$${1:変数}\")", - "description": "変数 [変数▼] を表示する" + "description": "変数 [変数▼] を表示する", + "type": "function" }, "hide_variable": { "snippet": "hide_variable(\"$${1:変数}\")", - "description": "変数 [変数▼] を隠す" + "description": "変数 [変数▼] を隠す", + "type": "function" }, "list.push": { "snippet": "list(\"$${1:リスト}\").push(\"${2:なにか}\")", - "description": "(なにか) を [リスト▼] に追加する" + "description": "(なにか) を [リスト▼] に追加する", + "type": "function" }, "list.delete_at": { "snippet": "list(\"$${1:リスト}\").delete_at(${2:1})", - "description": "[リスト▼] の (1) 番目を削除する" + "description": "[リスト▼] の (1) 番目を削除する", + "type": "function" }, "list.clear": { "snippet": "list(\"$${1:リスト}\").clear", - "description": "[リスト▼] のすべてを削除する" + "description": "[リスト▼] のすべてを削除する", + "type": "function" }, "list.insert": { "snippet": "list(\"$${1:リスト}\").insert(${2:1}, \"${3:なにか}\")", - "description": "[リスト▼] の (1) 番目に (なにか) を挿入する" + "description": "[リスト▼] の (1) 番目に (なにか) を挿入する", + "type": "function" }, "list[]=": { "snippet": "list(\"$${1:リスト}\")[${2:1}] = \"${3:なにか}\"", - "description": "[リスト▼] の (1) 番目を (なにか) で置き換える" + "description": "[リスト▼] の (1) 番目を (なにか) で置き換える", + "type": "function" }, "list": { "snippet": "list(\"$${1:リスト}\")", - "description": "リスト" + "description": "リスト", + "type": "variable" }, "list[]": { "snippet": "list(\"$${1:リスト}\")[${2:1}]", - "description": "[リスト▼] の (1) 番目" + "description": "[リスト▼] の (1) 番目", + "type": "variable" }, "list.index": { "snippet": "list(\"$${1:リスト}\").index(\"${2:なにか}\")", - "description": "[リスト▼] 中の (なにか) の場所" + "description": "[リスト▼] 中の (なにか) の場所", + "type": "variable" }, "list.length": { "snippet": "list(\"$${1:リスト}\").length", - "description": "[リスト▼] の長さ" + "description": "[リスト▼] の長さ", + "type": "variable" }, "list.include?": { "snippet": "list(\"$${1:リスト}\").include?(\"${2:なにか}\")", - "description": "[リスト▼] に (なにか) が含まれる" + "description": "[リスト▼] に (なにか) が含まれる", + "type": "value" }, "show_list": { "snippet": "show_list(\"$${1:リスト}\")", - "description": "リスト [リスト▼] を表示する" + "description": "リスト [リスト▼] を表示する", + "type": "function" }, "hide_list": { "snippet": "hide_list(\"$${1:リスト}\")", - "description": "リスト [リスト▼] を隠す" + "description": "リスト [リスト▼] を隠す", + "type": "function" } } diff --git a/src/containers/ruby-tab/video-sensing-snippets.json b/src/containers/ruby-tab/video-sensing-snippets.json index 6559ee5a898..5f3809284f1 100644 --- a/src/containers/ruby-tab/video-sensing-snippets.json +++ b/src/containers/ruby-tab/video-sensing-snippets.json @@ -1,18 +1,22 @@ { "video_sensing.when_video_motion>": { "snippet": "video_sensing.when_video_motion_greater_than(${1:10}) do\n\t${2}\nend", - "description": "ビデオモーション > (10) のとき" + "description": "ビデオモーション > (10) のとき", + "type": "event" }, "video_sensing.video": { "snippet": "video_sensing.video_on(\"${1:motion}\", \"${2:this sprite}\")", - "description": "(スプライト▼) のビデオの (モーション▼)" + "description": "(スプライト▼) のビデオの (モーション▼)", + "type": "variable" }, "video_sensing.turn_video": { "snippet": "video_sensing.video_turn(\"${1:on}\")", - "description": "ビデオを (入▼) にする" + "description": "ビデオを (入▼) にする", + "type": "function" }, "video_sensing.video_transparency=": { "snippet": "video_sensing.video_transparency = ${1:50}", - "description": "ビデオの透明度を (50) にする" + "description": "ビデオの透明度を (50) にする", + "type": "function" } }