{"action":"opened","issue":{"url":"https://api.github.com/repos/BohemianCoding/SketchAPI/issues/195","repository_url":"https://api.github.com/repos/BohemianCoding/SketchAPI","labels_url":"https://api.github.com/repos/BohemianCoding/SketchAPI/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/BohemianCoding/SketchAPI/issues/195/comments","events_url":"https://api.github.com/repos/BohemianCoding/SketchAPI/issues/195/events","html_url":"https://github.com/BohemianCoding/SketchAPI/issues/195","id":324026309,"number":195,"title":"getImportableSymbolReferencesForDocument returning symbols from a different library","user":{"login":"steffanwilliams","id":20833,"avatar_url":"https://avatars1.githubusercontent.com/u/20833?v=4","gravatar_id":"","url":"https://api.github.com/users/steffanwilliams","html_url":"https://github.com/steffanwilliams","followers_url":"https://api.github.com/users/steffanwilliams/followers","following_url":"https://api.github.com/users/steffanwilliams/following{/other_user}","gists_url":"https://api.github.com/users/steffanwilliams/gists{/gist_id}","starred_url":"https://api.github.com/users/steffanwilliams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steffanwilliams/subscriptions","organizations_url":"https://api.github.com/users/steffanwilliams/orgs","repos_url":"https://api.github.com/users/steffanwilliams/repos","events_url":"https://api.github.com/users/steffanwilliams/events{/privacy}","received_events_url":"https://api.github.com/users/steffanwilliams/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-17T13:36:39Z","updated_at":"2018-05-17T13:36:39Z","closed_at":null,"author_association":"NONE","body":"Hey guys,\r\n\r\nI'm having an issue with Sketch 50's library API. Specifically, the `getImportableSymbolReferencesForDocument` function seems to be returning the incorrect symbols — or, it seems to be referencing a totally different library altogether:\r\n\r\n```\r\nvar libraries = Library.getLibraries();\r\nvar library = libraries.find((library) => library.name === libraryName); // libraryName = \"bui-web\" in my case\r\nvar refs = library.getImportableSymbolReferencesForDocument(context.actionContext.document);\r\nrefs.find((symbol) => log(symbol.library.name)) // symbol.library.name = \"bui-android\", expected \"bui-web\". All symbols are from the wrong library.\r\n```\r\n\r\nEven when I explicitly point at the library that I want the symbols for, it gives me the wrong symbols:\r\n\r\n```\r\nvar library = Library.getLibraryForDocumentAtPath('~/Library/Application Support/com.bohemiancoding.sketch3/Plugins/biq.sketchplugin/Contents/Resources/libraries/bui-web.sketch');\r\nvar refs = library.getImportableSymbolReferencesForDocument(context.actionContext.document);\r\nrefs.find((symbol) => log(symbol.library.name)) // all symbols are from 'bui-android' library, despite explicitly importing bui-web.\r\n```\r\n\r\nAny help with this issue would be greatly appreciated."}}
{"actor":{"display_login":"steffanwilliams"}}