[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$KiqIp5Qu8t":3,"blog-\u002Fblog\u002Fmy-first-vs-code-extension":52,"blogToc-\u002Fblog\u002Fmy-first-vs-code-extension":458,"blog-surrounding-\u002Fblog\u002Fmy-first-vs-code-extension":702,"blog-similar-posts-\u002Fblog\u002Fmy-first-vs-code-extension":707},{"id":4,"extension":5,"items":6,"meta":49,"stem":50,"__hash__":51},"menu\u002Fmenu.json","json",[7,12,16,20,24,28,32,36,41,45],{"i18nId":8,"to":9,"ariaLabel":10,"mainNavigation":11},"components.menu.home","\u002F","Home",true,{"i18nId":13,"to":14,"ariaLabel":15,"mainNavigation":11},"components.menu.about","\u002Fhire-me","About",{"i18nId":17,"to":18,"ariaLabel":19,"mainNavigation":11},"components.menu.testimonials","\u002Ftestimonials","Testimonials",{"i18nId":21,"to":22,"ariaLabel":23},"components.menu.contact","\u002Fcontact","Contact",{"i18nId":25,"to":26,"ariaLabel":27,"mainNavigation":11},"components.menu.blog","\u002Fblog","Blog",{"i18nId":29,"to":30,"ariaLabel":31,"mainNavigation":11},"components.menu.tips","\u002Fvue-tips","Vue Tips",{"i18nId":33,"to":34,"ariaLabel":35,"mainNavigation":11},"components.menu.projects","\u002Fprojects","Projects",{"i18nId":37,"to":38,"ariaLabel":39,"mainNavigation":40},"components.menu.stats","\u002Fstats","stats",false,{"i18nId":42,"to":43,"ariaLabel":44,"mainNavigation":40},"components.menu.businessCard","\u002Fbusiness-card","Business Card",{"i18nId":46,"to":47,"ariaLabel":48,"mainNavigation":40},"components.menu.publications","\u002Fpublications","Publications",{},"menu","njLT1QoRt2Dv8QWoVmH8xdTAiDywSj0bxBQdmoyWUE0",{"id":53,"title":54,"body":55,"categories":437,"cover":332,"date":439,"description":440,"extension":441,"lastUpdated":442,"meta":443,"navigation":11,"ogImage":442,"path":445,"readingTime":446,"robots":442,"schemaOrg":442,"seo":451,"sitemap":452,"stem":456,"tags":442,"__hash__":457},"blog\u002Fblog\u002Fmy-first-vs-code-extension\u002Findex.md","My First Visual Code Extension",{"type":56,"value":57,"toc":426},"minimark",[58,76,79,84,117,123,135,140,148,151,155,158,173,178,187,202,211,315,318,323,326,333,336,339,360,363,369,373,388,396,400,403,407,422],[59,60,61,62,69,70,75],"p",{},"I am a big fan of ",[63,64,68],"a",{"href":65,"rel":66},"https:\u002F\u002Fcode.visualstudio.com",[67],"nofollow","Visual Code"," and use it as my main IDE for software development. The available selection of extensions (see the ",[63,71,74],{"href":72,"rel":73},"https:\u002F\u002Fmarketplace.visualstudio.com\u002FVSCode",[67],"Extension Marketplace",") is amazing.",[59,77,78],{},"As I started using Visual Code I found every extension I was looking for. Last week I stumbled upon a feature for which I could not find an extension. So I decided to write my first VS code extension and let you know about my experiences during the development.",[80,81,83],"h2",{"id":82},"the-problem-i-wanted-to-solve","The problem I wanted to solve",[59,85,86,87,92,93,98,99,104,105,110,111,116],{},"Currently, I am doing a lot of ",[63,88,91],{"href":89,"rel":90},"https:\u002F\u002Fangular.io\u002F",[67],"Angular"," development and therefore use ",[63,94,97],{"href":95,"rel":96},"https:\u002F\u002Fjasmine.github.io\u002F",[67],"Jasmine"," for unit tests. My first IDE, which I used for web development was ",[63,100,103],{"href":101,"rel":102},"https:\u002F\u002Fwww.jetbrains.com\u002Fwebstorm\u002F",[67],"WebStorm"," which is based on ",[63,106,109],{"href":107,"rel":108},"https:\u002F\u002Fwww.jetbrains.com\u002Fidea\u002F",[67],"IntelliJ IDEA",". In WebStorm, I often used and liked the plugin ",[63,112,115],{"href":113,"rel":114},"https:\u002F\u002Fgithub.com\u002Fandresdominguez\u002Fddescriber",[67],"ddescriber"," for Jasmine tests:",[118,119,120],"blockquote",{},[59,121,122],{},"Intellij plugin to quickly transform a JavaScript test block from describe() to ddescribe() and a test it() into iit()",[59,124,125,126,130,131,134],{},"This is a nice feature, but I often used the plugin to list all available specs and then jump to a certain ",[127,128,129],"code",{},"describe()"," or ",[127,132,133],{},"it()"," block:",[118,136,137],{},[59,138,139],{},"Just type Ctrl + Shift + D (Command + Shift + D on a Mac) to launch a dialog that lets you choose which suites or unit tests you want to include or exclude.",[59,141,142,143,130,145,147],{},"This is useful in large unit tests which includes many ",[127,144,129],{},[127,146,133],{}," blocks.",[59,149,150],{},"As I could not find a VS code extension that solves this problem, I decided to write my first own VS code extension.",[80,152,154],{"id":153},"what-the-extension-should-handle","What the extension should handle",[59,156,157],{},"The first version of the extension should be able to:",[159,160,161,170],"ul",{},[162,163,164,165,130,167,169],"li",{},"List all ",[127,166,129],{},[127,168,133],{}," blocks as dropdown in an opened file in the editor",[162,171,172],{},"If a block is selected, move the cursor to this block",[174,175,177],"h3",{"id":176},"how-to-start","How to start?",[59,179,180,181,186],{},"Big applause to the VS code team for the amazing ",[63,182,185],{"href":183,"rel":184},"https:\u002F\u002Fcode.visualstudio.com\u002Fdocs\u002Fextensions\u002Foverview",[67],"documentation"," on how to build your own VS code extension.",[59,188,189,190,195,196,201],{},"It is straightforward to grab one of the example projects or create a new one using ",[63,191,194],{"href":192,"rel":193},"https:\u002F\u002Fcode.visualstudio.com\u002Fdocs\u002Fextensions\u002Fyocode",[67],"Extension Generator"," and get started. Additionally, it is very easy to ",[63,197,200],{"href":198,"rel":199},"https:\u002F\u002Fcode.visualstudio.com\u002Fdocs\u002Fextensions\u002Fdeveloping-extensions#_running-and-debugging-your-extension",[67],"run and debug your new extension",".",[59,203,204,205,210],{},"Searching through the ",[63,206,209],{"href":207,"rel":208},"https:\u002F\u002Fcode.visualstudio.com\u002Fdocs\u002FextensionAPI\u002Foverview",[67],"Extension API documentation"," I found this method",[212,213,218],"pre",{"className":214,"code":215,"language":216,"meta":217,"style":217},"language-ts shiki shiki-themes github-light poimandres poimandres","showQuickPick\u003CT extends QuickPickItem>(items: T[] | Thenable\u003CT[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable\u003CT | undefined>\n","ts","",[127,219,220],{"__ignoreMap":217},[221,222,225,229,233,237,241,244,247,251,255,258,261,264,267,269,271,274,277,280,283,286,289,291,294,297,299,301,303,305,308,312],"span",{"class":223,"line":224},"line",1,[221,226,228],{"class":227},"sMzB8","showQuickPick",[221,230,232],{"class":231},"sygvE","\u003C",[221,234,236],{"class":235},"s4XUm","T",[221,238,240],{"class":239},"sRZEA"," extends",[221,242,243],{"class":235}," QuickPickItem",[221,245,246],{"class":231},">(",[221,248,250],{"class":249},"sadQ_","items",[221,252,254],{"class":253},"slWGy",":",[221,256,257],{"class":235}," T",[221,259,260],{"class":231},"[] ",[221,262,263],{"class":253},"|",[221,265,266],{"class":235}," Thenable",[221,268,232],{"class":231},[221,270,236],{"class":235},[221,272,273],{"class":231},"[]>, ",[221,275,276],{"class":249},"options",[221,278,279],{"class":253},"?:",[221,281,282],{"class":235}," QuickPickOptions",[221,284,285],{"class":231},", ",[221,287,288],{"class":249},"token",[221,290,279],{"class":253},[221,292,293],{"class":235}," CancellationToken",[221,295,296],{"class":231},")",[221,298,254],{"class":253},[221,300,266],{"class":235},[221,302,232],{"class":231},[221,304,236],{"class":235},[221,306,307],{"class":253}," |",[221,309,311],{"class":310},"svhIC"," undefined",[221,313,314],{"class":231},">\n",[59,316,317],{},"which functionality is described as:",[118,319,320],{},[59,321,322],{},"Shows a selection list allowing multiple selections.",[59,324,325],{},"It looks this way in VS code if it is called:",[59,327,328],{},[329,330],"img",{"alt":331,"src":332},"VS Code Quick Pick Screenshot","blog\u002Fmy-first-vs-code-extension\u002Fjasmine-test-selector_iquirk.png",[59,334,335],{},"So this sounded like an excellent opportunity to list all test blocks and provide a way to receive the selected value.",[59,337,338],{},"So basically, I had to implement these steps:",[159,340,341,351,357],{},[162,342,343,344,130,347,350],{},"Grab all strings in the opened editor, which include ",[127,345,346],{},"it(",[127,348,349],{},"describe("," and the corresponding line number of this string.",[162,352,353,354,356],{},"Pass them to ",[127,355,228],{}," method.",[162,358,359],{},"Receive the selection and move the cursor to the corresponding line number.",[59,361,362],{},"The final output for a Jasmine test file looks like this:",[59,364,365],{},[329,366],{"alt":367,"src":368},"VS Code Jasmine Test Selector Screenshot","blog\u002Fmy-first-vs-code-extension\u002Fvs-code-quick-pick_mxoayz.jpg",[174,370,372],{"id":371},"publishing-the-extension","Publishing the extension",[59,374,375,376,381,382,387],{},"Another lovely experience was the straightforward publishing process for VS code extensions. Basically, I followed the ",[63,377,380],{"href":378,"rel":379},"https:\u002F\u002Fcode.visualstudio.com\u002Fdocs\u002Fextensions\u002Fpublish-extension",[67],"official documentation",", which requires a ",[63,383,386],{"href":384,"rel":385},"https:\u002F\u002Fdocs.microsoft.com\u002Fvsts\u002Faccounts\u002Fcreate-account-msa-or-work-student",[67],"Visual Studio Team Services"," account.",[59,389,390,391,201],{},"The published extension is available in the ",[63,392,395],{"href":393,"rel":394},"https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=Mokkapps.jasmine-test-selector#overview",[67],"Visual Studio Code Marketplace",[80,397,399],{"id":398},"conclusion","Conclusion",[59,401,402],{},"In summary, it made a lot of fun to develop a VS code experience. The documentation and examples are excellent, and I am thrilled that I added a functionality to my favorite code editor, which I've been missing.",[80,404,406],{"id":405},"links","Links",[159,408,409,415],{},[162,410,411],{},[63,412,414],{"href":393,"rel":413},[67],"Download the extension from the marketplace",[162,416,417],{},[63,418,421],{"href":419,"rel":420},"https:\u002F\u002Fgithub.com\u002FMokkapps\u002Fjasmine-test-selector",[67],"Source code on GitHub",[423,424,425],"style",{},"html pre.shiki code .sMzB8, html code.shiki .sMzB8{--shiki-light:#24292E;--shiki-default:#E4F0FB;--shiki-dark:#E4F0FB}html pre.shiki code .sygvE, html code.shiki .sygvE{--shiki-light:#24292E;--shiki-default:#A6ACCD;--shiki-dark:#A6ACCD}html pre.shiki code .s4XUm, html code.shiki .s4XUm{--shiki-light:#6F42C1;--shiki-default:#A6ACCDC0;--shiki-dark:#A6ACCDC0}html pre.shiki code .sRZEA, html code.shiki .sRZEA{--shiki-light:#D73A49;--shiki-default:#5DE4C7;--shiki-dark:#5DE4C7}html pre.shiki code .sadQ_, html code.shiki .sadQ_{--shiki-light:#E36209;--shiki-default:#E4F0FB;--shiki-dark:#E4F0FB}html pre.shiki code .slWGy, html code.shiki .slWGy{--shiki-light:#D73A49;--shiki-default:#91B4D5;--shiki-dark:#91B4D5}html pre.shiki code .svhIC, html code.shiki .svhIC{--shiki-light:#005CC5;--shiki-default:#A6ACCDC0;--shiki-dark:#A6ACCDC0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":217,"searchDepth":427,"depth":427,"links":428},2,[429,430,435,436],{"id":82,"depth":427,"text":83},{"id":153,"depth":427,"text":154,"children":431},[432,434],{"id":176,"depth":433,"text":177},3,{"id":371,"depth":433,"text":372},{"id":398,"depth":427,"text":399},{"id":405,"depth":427,"text":406},[438],"development","2018-05-11","I am a big fan of Visual Code and use it as my main IDE for software development. The available selection of extensions (see the Extension Marketplace) is amazing.","md",null,{"subTitle":444},"My little journey developing my first VS Code extension","\u002Fblog\u002Fmy-first-vs-code-extension",{"text":447,"minutes":448,"time":449,"words":450},"3 min read",2.565,153900,513,{"title":54,"description":440},{"loc":445,"images":453,"lastmod":439},[454,455],{"loc":332},{"loc":368},"blog\u002Fmy-first-vs-code-extension\u002Findex","BYcmwLwkctsO_Bb_zptNQstQjF6OekbDZ2T31Ax4KN0",{"id":459,"title":54,"body":460,"cover":332,"description":440,"extension":441,"meta":693,"navigation":11,"path":445,"robots":442,"seo":696,"sitemap":697,"stem":456,"__hash__":701},"content\u002Fblog\u002Fmy-first-vs-code-extension\u002Findex.md",{"type":56,"value":461,"toc":684},[462,470,472,474,491,495,501,505,511,513,515,517,527,529,534,542,547,613,615,619,621,625,627,629,643,645,649,651,659,664,666,668,670,682],[59,463,61,464,69,467,75],{},[63,465,68],{"href":65,"rel":466},[67],[63,468,74],{"href":72,"rel":469},[67],[59,471,78],{},[80,473,83],{"id":82},[59,475,86,476,92,479,98,482,104,485,110,488,116],{},[63,477,91],{"href":89,"rel":478},[67],[63,480,97],{"href":95,"rel":481},[67],[63,483,103],{"href":101,"rel":484},[67],[63,486,109],{"href":107,"rel":487},[67],[63,489,115],{"href":113,"rel":490},[67],[118,492,493],{},[59,494,122],{},[59,496,125,497,130,499,134],{},[127,498,129],{},[127,500,133],{},[118,502,503],{},[59,504,139],{},[59,506,142,507,130,509,147],{},[127,508,129],{},[127,510,133],{},[59,512,150],{},[80,514,154],{"id":153},[59,516,157],{},[159,518,519,525],{},[162,520,164,521,130,523,169],{},[127,522,129],{},[127,524,133],{},[162,526,172],{},[174,528,177],{"id":176},[59,530,180,531,186],{},[63,532,185],{"href":183,"rel":533},[67],[59,535,189,536,195,539,201],{},[63,537,194],{"href":192,"rel":538},[67],[63,540,200],{"href":198,"rel":541},[67],[59,543,204,544,210],{},[63,545,209],{"href":207,"rel":546},[67],[212,548,549],{"className":214,"code":215,"language":216,"meta":217,"style":217},[127,550,551],{"__ignoreMap":217},[221,552,553,555,557,559,561,563,565,567,569,571,573,575,577,579,581,583,585,587,589,591,593,595,597,599,601,603,605,607,609,611],{"class":223,"line":224},[221,554,228],{"class":227},[221,556,232],{"class":231},[221,558,236],{"class":235},[221,560,240],{"class":239},[221,562,243],{"class":235},[221,564,246],{"class":231},[221,566,250],{"class":249},[221,568,254],{"class":253},[221,570,257],{"class":235},[221,572,260],{"class":231},[221,574,263],{"class":253},[221,576,266],{"class":235},[221,578,232],{"class":231},[221,580,236],{"class":235},[221,582,273],{"class":231},[221,584,276],{"class":249},[221,586,279],{"class":253},[221,588,282],{"class":235},[221,590,285],{"class":231},[221,592,288],{"class":249},[221,594,279],{"class":253},[221,596,293],{"class":235},[221,598,296],{"class":231},[221,600,254],{"class":253},[221,602,266],{"class":235},[221,604,232],{"class":231},[221,606,236],{"class":235},[221,608,307],{"class":253},[221,610,311],{"class":310},[221,612,314],{"class":231},[59,614,317],{},[118,616,617],{},[59,618,322],{},[59,620,325],{},[59,622,623],{},[329,624],{"alt":331,"src":332},[59,626,335],{},[59,628,338],{},[159,630,631,637,641],{},[162,632,343,633,130,635,350],{},[127,634,346],{},[127,636,349],{},[162,638,353,639,356],{},[127,640,228],{},[162,642,359],{},[59,644,362],{},[59,646,647],{},[329,648],{"alt":367,"src":368},[174,650,372],{"id":371},[59,652,375,653,381,656,387],{},[63,654,380],{"href":378,"rel":655},[67],[63,657,386],{"href":384,"rel":658},[67],[59,660,390,661,201],{},[63,662,395],{"href":393,"rel":663},[67],[80,665,399],{"id":398},[59,667,402],{},[80,669,406],{"id":405},[159,671,672,677],{},[162,673,674],{},[63,675,414],{"href":393,"rel":676},[67],[162,678,679],{},[63,680,421],{"href":419,"rel":681},[67],[423,683,425],{},{"title":217,"searchDepth":427,"depth":427,"links":685},[686,687,691,692],{"id":82,"depth":427,"text":83},{"id":153,"depth":427,"text":154,"children":688},[689,690],{"id":176,"depth":433,"text":177},{"id":371,"depth":433,"text":372},{"id":398,"depth":427,"text":399},{"id":405,"depth":427,"text":406},{"subTitle":444,"date":439,"categories":694,"readingTime":695},[438],{"text":447,"minutes":448,"time":449,"words":450},{"title":54,"description":440},{"loc":445,"images":698,"lastmod":439},[699,700],{"loc":332},{"loc":368},"kuSOMnhQXLJUNpVoSsIaAd-Q0jVhwiXgMrfR9aXg1HY",[703,442],{"title":704,"path":705,"stem":706,"children":-1},"My First NPM Package: github-traffic-cli","\u002Fblog\u002Fmy-first-npm-package","blog\u002Fmy-first-npm-package\u002Findex",[708,713,718,723],{"cover":709,"date":710,"slug":711,"title":712,"to":711},"blog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3\u002Fog.png","2023-06-20","\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3","A Comprehensive Guide to Data Fetching in Nuxt 3",{"cover":714,"date":715,"slug":716,"title":717,"to":716},"blog\u002Fanalyze-memory-leaks-in-your-nuxt-app\u002Fog.png","2024-07-27","\u002Fblog\u002Fanalyze-memory-leaks-in-your-nuxt-app","Analyze Memory Leaks in Your Nuxt App",{"cover":719,"date":720,"slug":721,"title":722,"to":721},"blog\u002Fbuild-and-deploy-a-serverless-graphql-react-app-using-aws-amplify\u002Fcover_pliu6q.jpg","2021-05-07","\u002Fblog\u002Fbuild-and-deploy-a-serverless-graphql-react-app-using-aws-amplify","Build and Deploy a Serverless GraphQL React App Using AWS Amplify",{"cover":724,"date":725,"slug":726,"title":727,"to":726},"blog\u002Fbuilding-a-polite-newsletter-popup-with-nuxt-3\u002FBlog_Post__Polite_Popup_Nuxt_3_k8ch1w.jpg","2022-10-18","\u002Fblog\u002Fbuilding-a-polite-newsletter-popup-with-nuxt-3","Building a Polite Newsletter Popup With Nuxt 3"]