33import * as net from 'net' ;
44import * as path from 'path' ;
55import { CancellationToken , CodeActionKind , commands , ConfigurationTarget , DocumentSelector , EventEmitter , ExtensionContext , extensions , languages , Location , ProgressLocation , TextEditor , Uri , ViewColumn , window , workspace } from "vscode" ;
6- import { ConfigurationParams , ConfigurationRequest , LanguageClientOptions , Location as LSLocation , MessageType , Position as LSPosition , TextDocumentPositionParams , WorkspaceEdit , CompletionRequest } from "vscode-languageclient" ;
6+ import { ConfigurationParams , ConfigurationRequest , LanguageClientOptions , Location as LSLocation , MessageType , Position as LSPosition , TextDocumentPositionParams , WorkspaceEdit } from "vscode-languageclient" ;
77import { LanguageClient , StreamInfo } from "vscode-languageclient/node" ;
88import { apiManager } from "./apiManager" ;
99import * as buildPath from './buildpath' ;
1010import { javaRefactorKinds , RefactorDocumentProvider } from "./codeActionProvider" ;
1111import { Commands } from "./commands" ;
12- import { ClientStatus , TraceEvent } from "./extension.api" ;
12+ import { ClientStatus } from "./extension.api" ;
1313import * as fileEventHandler from './fileEventHandler' ;
1414import { gradleCodeActionMetadata , GradleCodeActionProvider } from "./gradle/gradleCodeActionProvider" ;
1515import { awaitServerConnection , prepareExecutable , DEBUG } from "./javaServerStarter" ;
@@ -34,7 +34,7 @@ import { askForProjects, projectConfigurationUpdate, upgradeGradle } from "./sta
3434import { TracingLanguageClient } from './TracingLanguageClient' ;
3535import { TypeHierarchyDirection , TypeHierarchyItem } from "./typeHierarchy/protocol" ;
3636import { typeHierarchyTree } from "./typeHierarchy/typeHierarchyTree" ;
37- import { getAllJavaProjects , getJavaConfig , getJavaConfiguration } from "./utils" ;
37+ import { getAllJavaProjects , getJavaConfiguration } from "./utils" ;
3838import { Telemetry } from "./telemetry" ;
3939import { TelemetryEvent } from "@redhat-developer/vscode-redhat-telemetry/lib" ;
4040import { registerDocumentValidationListener } from './diagnostic' ;
@@ -147,7 +147,6 @@ export class StandardLanguageClient {
147147 // Disable the client-side snippet provider since LS is ready.
148148 snippetCompletionProvider . dispose ( ) ;
149149 registerDocumentValidationListener ( context , this . languageClient ) ;
150- registerCodeCompletionTelemetryListener ( ) ;
151150 commands . executeCommand ( 'setContext' , 'javaLSReady' , true ) ;
152151 break ;
153152 case 'Started' :
@@ -814,21 +813,4 @@ export async function applyWorkspaceEdit(workspaceEdit: WorkspaceEdit, languageC
814813 } else {
815814 return Promise . resolve ( true ) ;
816815 }
817- }
818-
819- export function registerCodeCompletionTelemetryListener ( ) {
820- apiManager . getApiInstance ( ) . onDidRequestEnd ( ( traceEvent : TraceEvent ) => {
821- if ( traceEvent . type === CompletionRequest . method ) {
822- // Exclude the invalid completion requests.
823- if ( ! traceEvent . resultLength ) {
824- return ;
825- }
826- const props = {
827- duration : Math . round ( traceEvent . duration * 100 ) / 100 ,
828- resultLength : traceEvent . resultLength || 0 ,
829- error : ! ! traceEvent . error ,
830- } ;
831- return Telemetry . sendTelemetry ( Telemetry . COMPLETION_EVENT , props ) ;
832- }
833- } ) ;
834816}
0 commit comments