Skip to content

Commit

Permalink
feat(snippets): remove [in] and [out] from @params
Browse files Browse the repository at this point in the history
  • Loading branch information
YuryShkoda committed Aug 18, 2023
1 parent 0ee67da commit d260194
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/commands/snippets/snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ interface Snippet {
description: string[]
}

const sasRegExp = /\.sas$/ // to check if file has .sas extension
const briefRegExp = /^\s\s@brief\s/ // to get lines that has @brief keyword
const paramRegExp = /^\s\s@param\s/ // to get lines that has @param keyword
// to check if file has .sas extension
const sasRegExp = /\.sas$/
// to get lines that has @brief keyword
const briefRegExp = /^\s\s@brief\s/
// to get lines that has @param keyword and optionally [in] or [out] string
// following it
const paramRegExp = /^\s\s@param\s(\[(in|out)\]\s)?/

/**
* Generates VS Code snippets from the Doxygen headers in the SAS Macros.
Expand Down
4 changes: 3 additions & 1 deletion src/commands/snippets/spec/snippets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ describe('sasjs snippets', () => {
'Macro 2',
'\r',
'Params:',
'-msg The message to be printed'
'-msg The message to be printed',
'-indlm= ( ) Delimeter of the input string',
'-outdlm= ( ) Delimiter of the output string'
]
},
badMacro: {
Expand Down
2 changes: 2 additions & 0 deletions src/commands/snippets/spec/testMacros2/macro2.sas
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@details prints an arbitrary message to the log
@param msg The message to be printed
@param [in] indlm= ( ) Delimeter of the input string
@param [out] outdlm= ( ) Delimiter of the output string
@author Allan Bowe
**/
Expand Down

0 comments on commit d260194

Please sign in to comment.