Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03df39b

Browse files
authored
FixTypeError from trying to read directory (#692)
* Fix `TypeError` from trying to read directory* Fix lint issue
1 parent020bd42 commit03df39b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎src/extension/noConfigDebugInit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,21 @@ export async function registerNoConfigDebug(
8787
);
8888

8989
// create file system watcher for the debuggerAdapterEndpointFolder for when the communication port is written
90-
constfileSystemWatcher=createFileSystemWatcher(newRelativePattern(tempDirPath,'**/*'));
90+
constfileSystemWatcher=createFileSystemWatcher(newRelativePattern(tempDirPath,'**/*.txt'));
9191
constfileCreationEvent=fileSystemWatcher.onDidCreate(async(uri)=>{
9292
sendTelemetryEvent(EventName.DEBUG_SESSION_START,undefined,{
9393
trigger:'noConfig'asTriggerType,
9494
});
9595

9696
constfilePath=uri.fsPath;
9797
fs.readFile(filePath,(err,data)=>{
98-
constdataParse=data.toString();
9998
if(err){
10099
traceError(`Error reading debuggerAdapterEndpoint.txt file:${err}`);
101100
return;
102101
}
103102
try{
104103
// parse the client port
104+
constdataParse=data.toString();
105105
constjsonData=JSON.parse(dataParse);
106106
constclientPort=jsonData.client?.port;
107107
traceVerbose(`Parsed client port:${clientPort}`);

‎src/test/unittest/noConfigDebugInit.unit.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ suite('setup for no-config debug scenario', function () {
9999

100100
// Assert
101101
sinon.assert.calledOnce(createFileSystemWatcherFunct);
102-
constexpectedPattern=newRelativePattern(path.join(os.tmpdir(),'.noConfigDebugAdapterEndpoints'),'**/*');
102+
constexpectedPattern=newRelativePattern(
103+
path.join(os.tmpdir(),'.noConfigDebugAdapterEndpoints'),
104+
'**/*.txt',
105+
);
103106
sinon.assert.calledWith(createFileSystemWatcherFunct,expectedPattern);
104107
});
105108

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp