File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
1616import { LanguageClient } from 'vscode-languageclient' ;
1717import * as os from 'os' ;
1818import * as path from 'path' ;
19+ import * as tmp from 'tmp' ;
1920import { testExplorerExtensionId , TestHub } from 'vscode-test-adapter-api' ;
2021
2122import { AstViewer } from './astViewer' ;
@@ -498,11 +499,15 @@ async function activateWithInstalledDistribution(
498499 ) : Promise < void > {
499500 const path = selectedQuery ? selectedQuery . path : window . activeTextEditor ! . document . uri . fsPath ;
500501 if ( path ) {
502+ /*
501503 // Get path of temporary 'qh-markdown' directory in extension context
502- const tempDirPath = `${ getContextStoragePath ( ctx ) } /qh-markdown/` ;
504+ const tempDirPath = `${getContextStoragePath(ctx)}/qh-markdown/`;
505+ */
506+ // Create temporary directory
507+ const tmpDir = tmp . dirSync ( ) ;
503508 // Get library name and query file name in the format 'libname/queryname.md
504509 const mdFilePath = path . split ( '/' ) . slice ( - 2 ) . join ( '/' ) . replace ( '.qhelp' , '.md' ) ;
505- const absolutePathToMd = `${ tempDirPath } ${ mdFilePath } ` ;
510+ const absolutePathToMd = `${ tmpDir . name } ${ mdFilePath } ` ;
506511 const uri = Uri . file ( absolutePathToMd ) ;
507512 try {
508513 await cliServer . generateQueryHelp ( path , 'markdown' , absolutePathToMd ) ;
You can’t perform that action at this time.
0 commit comments