File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT license.
33import * as vscode from "vscode" ;
4+ import * as path from "path" ;
45import { sendInfo } from "vscode-extension-telemetry-wrapper" ;
56import { LSDaemon } from "../daemon" ;
67
@@ -62,6 +63,13 @@ export class ClientLogWatcher {
6263 }
6364
6465 private async readLatestLogFile ( ) {
66+ if ( ! this . javaExtensionRoot ) {
67+ try {
68+ this . javaExtensionRoot = vscode . Uri . file ( path . dirname ( await vscode . commands . executeCommand ( "_java.workspace.path" ) ) ) ;
69+ } catch ( error ) {
70+ }
71+ }
72+
6573 if ( this . javaExtensionRoot ) {
6674 const files = await vscode . workspace . fs . readDirectory ( this . javaExtensionRoot ) ;
6775 const logFiles = files . filter ( elem => elem [ 0 ] . startsWith ( "client.log" ) ) . sort ( ( a , b ) => compare_file ( a [ 0 ] , b [ 0 ] ) ) ;
Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ export class LogWatcher {
2828 * start
2929 */
3030 public async start ( ) {
31+ if ( ! this . serverLogUri ) {
32+ try {
33+ const jdtWsPath : string = await vscode . commands . executeCommand ( "_java.workspace.path" ) ;
34+ this . serverLogUri = vscode . Uri . file ( path . join ( jdtWsPath , ".metadata" ) ) ;
35+ } catch ( error ) {
36+ }
37+ }
38+
3139 if ( ! this . serverLogUri ) {
3240 sendInfo ( "" , { name : "no-server-log" } ) ;
3341 return ;
You can’t perform that action at this time.
0 commit comments