Skip to content

Commit

Permalink
Simplify control flow for #include <lib>
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-wiemer committed Feb 25, 2025
1 parent f405dc0 commit d9a1f0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/providers/defProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class DefProvider implements vscode.DefinitionProvider {

/**
* If the position is on an `#Include` line
* and the included path* is an existing file,
* and the included path* is an existing file (not a directory or library include),
* returns a Location at the beginning of the included file.
*
* Otherwise returns undefined.
Expand All @@ -113,7 +113,7 @@ export class DefProvider implements vscode.DefinitionProvider {
* - A_WorkingDir === A_ScriptDir
* - No previous `#Include Directory` lines changing the "include working directory"
*
* todo remove tryGetFileLink assumptions
* todo remove tryGetFileLink assumptions listed above
*/
export async function tryGetFileLink(
/**
Expand Down
2 changes: 1 addition & 1 deletion src/providers/defProvider.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const resolveIncludedPath = (
ahkLine: string,
): string | undefined => {
const includedPath = getIncludedPath(ahkLine);
if (!includedPath) return undefined;
if (!includedPath || includedPath.startsWith('<')) return undefined;

/** @example 'c:/path/to' */
const parentGoodPath = basePath.substring(1, basePath.lastIndexOf('/'));
Expand Down

0 comments on commit d9a1f0d

Please sign in to comment.