-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue links to functions being resolved, if there are multiple fu…
…nction declarations with the same name.
- Loading branch information
Showing
4 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const fs = require('fs/promises'); | ||
|
||
async function renameDuplicateFunctionReferences() { | ||
const configFile = await fs.readFile('./input/obsidian.api.json', 'utf8'); | ||
const configuration = JSON.parse(configFile); | ||
await each(configuration.members); | ||
fs.writeFile('./input/obsidian.api.json', JSON.stringify(configuration)); | ||
} | ||
|
||
async function each(members) { | ||
members.forEach(member => { | ||
|
||
if(member.docComment) { | ||
if(member.docComment.includes('getLeaf')) { | ||
const regex = /{@link Workspace.getLeaf(.*)}/g; | ||
member.docComment = member.docComment.replace(regex, "::Workspace.getLeaf::$1::") | ||
} | ||
} | ||
|
||
if(member.members) { | ||
each(member.members); | ||
} | ||
}) | ||
} | ||
|
||
async function main() { | ||
await renameDuplicateFunctionReferences(); | ||
} | ||
|
||
main(); |