i've got a task at my job as internship to enable a breadcrumb navigation for their test catalog in vs code, which I unfortunately can't post here for security reasons.
But basically looks like this:
@Testcase: Prolog ;
@setDefaultTimer(200) ;
@abscall(..\..\..\..\.yp\test-support\versionen.kat) ;
@abscall(..\..\..\..\.yp\test-support\bab_signaturen.kat) ;
$BMRCONNECT: CONNECT K0
@wait(cWaitBmsStart) ;
$TSHARK: START xxx
@wait(3000)
@Testcaseend
Problem is, we need a more detailed breadcrumb navigation which vs code don't provide. In Vs Code it's just limited to the source of the file and the file meanwhile we would like to navigate throughout the the different testcases.
I've read many informations on Vs Code's page to find some information but not of a great help. I don't know if I have to create a breadcrumb extension for the file. Can someone help?
In order to have Breadcrumbs available, the language extension needs to support Code Navigation, specifically the
DocumentSymbolProvider. You will know if an extension supportsDocumentSymbolProviderif you the Outline View is populated. The same symbols you see there, will be in the Breadcrumbs.The extension doesn't necessarily need to be a full Language Server but, at least, implements this API, providing the
Symbolscontained in a file, in order for thebreadcrumbsto be available.If you use the
files.associationssetting to make.katfiles to be recognized as another file type, and this another file type has an extension that supportsDocumentSymbolProvider, the Outline and the Breadcrumbs will work for.kat, otherwise, you will end up with syntax highlight only support.BTW, Syntax Highlight (coloring the elements inside the document) and Document Symbols (Outline / Breadcrumbs) are two different things. You can create an extension that only supports Syntax Highlight with no code, simply using the TextMate support that VS Code provides. Document Symbols, on the other hand, requires some kind of implementation in order to parse the file and return the symbols and its locations. Depending on how complex is the file format, and how deep you want to go for its symbols, a simple parser with RegEx to find them would be enough for your use case.