{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/pxt/issues/3988","repository_url":"https://api.github.com/repos/Microsoft/pxt","labels_url":"https://api.github.com/repos/Microsoft/pxt/issues/3988/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/pxt/issues/3988/comments","events_url":"https://api.github.com/repos/Microsoft/pxt/issues/3988/events","html_url":"https://github.com/Microsoft/pxt/issues/3988","id":306651308,"number":3988,"title":"Regression in getBlocksInfo() w.r.t. handling of qualified names with no block nor block id.","user":{"login":"matthewtebbs","id":1424775,"avatar_url":"https://avatars3.githubusercontent.com/u/1424775?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewtebbs","html_url":"https://github.com/matthewtebbs","followers_url":"https://api.github.com/users/matthewtebbs/followers","following_url":"https://api.github.com/users/matthewtebbs/following{/other_user}","gists_url":"https://api.github.com/users/matthewtebbs/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewtebbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewtebbs/subscriptions","organizations_url":"https://api.github.com/users/matthewtebbs/orgs","repos_url":"https://api.github.com/users/matthewtebbs/repos","events_url":"https://api.github.com/users/matthewtebbs/events{/privacy}","received_events_url":"https://api.github.com/users/matthewtebbs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-19T21:53:09Z","updated_at":"2018-03-19T21:53:09Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The function\r\n\r\n`export function getBlocksInfo(info: ApisInfo): BlocksInfo {...}`\r\n\r\nchanged substantially between 3.5.4 and 3.5.7 of pxt-core. I believe the change was to support the `%blockCombine` attribute.\r\n\r\nI'm finding name information for symbols of kind 'Module' are now no longer being pruned out.\r\n\r\nThe old code filtered out qualified names which did not have an associated block and blockId is below.\r\n\r\n```javascript\r\nconst blocks = pxtc.Util.values(info.byQName).\r\n    filter(s => !!s.attributes.block && !!s.attributes.blockId &&\r\n    (s.kind != pxtc.SymbolKind.EnumMember));\r\n```\r\n\r\nThe effect I'm seeing is that the filtered block information derived from the compiler's qualified name set includes items that are not blocks with categories and therefore fail later on when creating the Blockly toolbox, specifically those of symbol kind 'Module'.\r\n\r\nThese I believe are compiled from the following kind of declaration in my 'lib/core'.\r\n\r\n```typescript\r\n//% color=0 icon=\"\\uf1fc\" block=\"Design\" weight=100\r\ndeclare namespace design { /* paint-brush icon */\r\n}\r\n```\r\n\r\nIt's unfortunate as the end result of no toolbox shown although of course the loaded project runs just fine."}}
{"actor":{"display_login":"matthewtebbs"}}