@@ -9,8 +9,6 @@ import { vsCodeState, OnRecommendationAcceptanceEntry } from '../models/model'
9
9
import { runtimeLanguageContext } from '../util/runtimeLanguageContext'
10
10
import { CodeWhispererTracker } from '../tracker/codewhispererTracker'
11
11
import { CodeWhispererCodeCoverageTracker } from '../tracker/codewhispererCodeCoverageTracker'
12
- import { TextEdit , WorkspaceEdit , workspace } from 'vscode'
13
- import { getTabSizeSetting } from '../../shared/utilities/editorUtilities'
14
12
import { getLogger } from '../../shared/logger/logger'
15
13
import { RecommendationHandler } from '../service/recommendationHandler'
16
14
import { InlineCompletionService } from '../service/inlineCompletionService'
@@ -83,13 +81,10 @@ export async function onInlineAcceptance(
83
81
const languageContext = runtimeLanguageContext . getLanguageContext ( acceptanceEntry . editor . document . languageId )
84
82
const start = acceptanceEntry . range . start
85
83
const end = acceptanceEntry . editor . selection . active
86
- const languageId = acceptanceEntry . editor . document . languageId
87
84
RecommendationHandler . instance . reportUserDecisionOfRecommendation (
88
85
acceptanceEntry . editor ,
89
86
acceptanceEntry . acceptIndex
90
87
)
91
- // codewhisperer will be doing editing while formatting.
92
- // formatting should not trigger consoals auto trigger
93
88
vsCodeState . isCodeWhispererEditing = true
94
89
/**
95
90
* Mitigation to right context handling mainly for auto closing bracket use case
@@ -105,29 +100,7 @@ export async function onInlineAcceptance(
105
100
} catch ( error ) {
106
101
getLogger ( ) . error ( `${ error } in handling right contexts` )
107
102
}
108
- try {
109
- if ( languageId === CodeWhispererConstants . python ) {
110
- await vscode . commands . executeCommand ( 'editor.action.format' )
111
- } else {
112
- const range = new vscode . Range ( start , end )
113
- const edits : TextEdit [ ] | undefined = await vscode . commands . executeCommand (
114
- 'vscode.executeFormatRangeProvider' ,
115
- acceptanceEntry . editor . document . uri ,
116
- range ,
117
- {
118
- tabSize : getTabSizeSetting ( ) ,
119
- insertSpaces : true ,
120
- }
121
- )
122
- if ( edits && acceptanceEntry . editor ) {
123
- const wEdit = new WorkspaceEdit ( )
124
- wEdit . set ( acceptanceEntry . editor . document . uri , edits )
125
- await workspace . applyEdit ( wEdit )
126
- }
127
- }
128
- } finally {
129
- vsCodeState . isCodeWhispererEditing = false
130
- }
103
+ vsCodeState . isCodeWhispererEditing = false
131
104
132
105
CodeWhispererTracker . getTracker ( ) . enqueue ( {
133
106
time : new Date ( ) ,
0 commit comments