Skip to content

Commit

Permalink
wip updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-wiemer committed Oct 30, 2024
1 parent 44ef07b commit c3c67fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/defProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as vscode from 'vscode';
import { Parser } from '../parser/parser';
import { existsSync } from 'fs';
import { join } from 'path';
import { Out } from 'src/common/out';

export class DefProvider implements vscode.DefinitionProvider {
public async provideDefinition(
Expand Down Expand Up @@ -100,11 +101,12 @@ export class DefProvider implements vscode.DefinitionProvider {
const docPath = document.uri.path;
const { text } = document.lineAt(position.line);
const includeMatch = text.match(
/(?<=#include).+?\.(ahk|ahk1|ah1|ext)\b/i,
/(?<=#include) *?,? *(.+?\.(ahk|ahk1|ah1|ext))\b/i,
);
if (!includeMatch) {
return undefined;
}
Out.debug(includeMatch?.[1]);
/** @example c:/path/to */
const parentGoodPath = docPath.substring(1, docPath.lastIndexOf('/'));
const expandedPath = includeMatch[0]
Expand Down

0 comments on commit c3c67fe

Please sign in to comment.