File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const vscode = require("vscode");
33const { timestamp } = require ( "../utils/createLogger" ) ;
44const { arraysToMarkdownTable, adapterHistoryTable } = require ( "../utils/formatters" ) ;
55const { serializeKeyValuePairs } = require ( "../utils/misc" ) ;
6+ const os = require ( "os" ) ;
67
78/**
89 * @typedef {Object } subProvider
@@ -55,12 +56,22 @@ class TextDocumentProvider {
5556 const configTable = arraysToMarkdownTable ( [ [ "Config" , "" ] , ...Object . entries ( config || { } ) ] ) ;
5657 const deviceTable = arraysToMarkdownTable ( [ [ "Device" , "" ] , ...Object . entries ( device . raw || { } ) ] ) ;
5758 const systemTable = arraysToMarkdownTable ( [ [ "System" , "" ] , ...Object . entries ( device . info || { } ) ] ) ;
59+ const hostTable = arraysToMarkdownTable ( [
60+ [ "Host" , "" ] ,
61+ ...Object . entries ( {
62+ OS : process . platform + " - " + os . arch ( ) ,
63+ Pymakr : vscode . extensions . getExtension ( "Pycom.pymakr" ) ?. packageJSON . version ,
64+ "Pymakr-Preview" : vscode . extensions . getExtension ( "Pycom.pymakr-preview" ) ?. packageJSON . version ,
65+ VSCode : vscode . version ,
66+ } ) ,
67+ ] ) ;
5868
5969 const historyTable = arraysToMarkdownTable ( adapterHistoryTable ( device ) ) ;
6070 const body = [
6171 configTable ,
6272 deviceTable ,
6373 systemTable ,
74+ hostTable ,
6475 `## Device History at ${ timestamp ( new Date ( ) ) } ` ,
6576 historyTable ,
6677 ] . join ( "\r\n\r\n" ) ;
Original file line number Diff line number Diff line change 1010const { timestamp } = require ( "./createLogger" ) ;
1111
1212const sanitize = ( str ) =>
13- ( typeof str === "string" ? str : JSON . stringify ( str , null , 2 ) )
13+ ( typeof str === "string" ? str : typeof str === "undefined" ? "undefined" : JSON . stringify ( str , null , 2 ) )
1414 . replace ( / \| / gm, "|" )
1515 . replace ( / \r ? \n / gm, "<br />" )
1616 . replace ( / " u s e r n a m e " : " .+ ?" / , '"username": "***"' )
You can’t perform that action at this time.
0 commit comments