-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
356c5d1
commit 4b2e521
Showing
6 changed files
with
52 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { platform } from 'os'; | ||
|
||
import { AddHistory } from './add-history'; | ||
|
||
/** | ||
* Adds input to the history file as a new entry/line | ||
*/ | ||
export function AddHistoryInput(content: string) { | ||
AddHistory(platform() === 'win32' ? `\n${content}\n` : `\n\n${content}\n`); | ||
} |
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,26 @@ | ||
import { IDL_DEBUG_ADAPTER_LOG } from '@idl/logger'; | ||
import { IDL_TRANSLATION } from '@idl/translation'; | ||
import { IDL_LOGGER } from '@idl/vscode/client'; | ||
import { appendFileSync } from 'fs'; | ||
|
||
import { OUTPUT_CONFIG } from './log-output'; | ||
|
||
/** | ||
* Adds text to our history file as raw text | ||
*/ | ||
export function AddHistory(content: string) { | ||
// check if we need to write to our log file | ||
if (OUTPUT_CONFIG.FILE !== '') { | ||
try { | ||
appendFileSync(OUTPUT_CONFIG.FILE, content); | ||
} catch (err) { | ||
IDL_LOGGER.log({ | ||
type: 'error', | ||
log: IDL_DEBUG_ADAPTER_LOG, | ||
content: [IDL_TRANSLATION.debugger.errors.addHistory, err], | ||
alert: IDL_TRANSLATION.debugger.errors.addHistory, | ||
}); | ||
OUTPUT_CONFIG.FILE = ''; | ||
} | ||
} | ||
} |
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