Skip to content

Commit

Permalink
dev: add helper export
Browse files Browse the repository at this point in the history
  • Loading branch information
spgennard committed Sep 24, 2019
1 parent 4c2e87b commit cf32a03
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
out/test/**
out/**/*.map
src/**
**/*.ts
.gitignore
tsconfig.json
vsc-extension-quickstart.md
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/opencopybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ function findFile(filename: string, filenameDir: string): string | undefined {
return;
}

export function getCopyBookFileOrNull(filename: string) : string {
const dirOfFilename = path.dirname(filename);

if (filename) {
const fullPath = findFile(filename, dirOfFilename);
if (fullPath) {
return fullPath;
}
}

return "";
}

export function provideDefinition(doc: TextDocument, pos: Position, ct: CancellationToken): ProviderResult<Definition> {
const dirOfFilename = path.dirname(doc.fileName);
const line = doc.lineAt(pos);
Expand Down

0 comments on commit cf32a03

Please sign in to comment.