Skip to content

Commit ab89fc5

Browse files
committed
passed language ID to findSetctions() #23
1 parent 1f0c502 commit ab89fc5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/documentSymbolProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export class CodeOrganizerDocumentSymbolProvider implements vscode.DocumentSymbo
6868
////// 1.2.1 Document Processing ----
6969
const text = document.getText();
7070
const languageId = document.languageId;
71-
const all_matches: SectionMatch[] = findSections(text);
71+
console.log(`[Code Organizer] Document language: ${languageId}`);
72+
const all_matches: SectionMatch[] = findSections(text, languageId);
7273
const matches = all_matches.filter((item: SectionMatch) => item.depth === 1);
7374

7475
////// 1.2.2 Symbol Generation ----

src/utils/findSections.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export interface SectionMatch {
1313
* Find all section matches in text
1414
* Supports multiple comment syntaxes: #, //, --
1515
*/
16-
export function findSections(text: string): SectionMatch[] {
16+
export function findSections(text: string, languageId?: string): SectionMatch[] {
17+
console.log(`[Code Organizer > findSections] Processing file type: ${languageId}`);
1718
const matches: SectionMatch[] = [];
1819

1920
//// 2.1 Pattern Definitions ----

0 commit comments

Comments
 (0)