|
5 | 5 |
|
6 | 6 | import { TextEditor, Selection, TextDocument, Range } from 'vscode'
|
7 | 7 |
|
8 |
| -import { Extent, Java, Python, Location } from '@aws/fully-qualified-names' |
9 | 8 | import { FocusAreaContext, FullyQualifiedName } from './model'
|
10 | 9 |
|
11 | 10 | const focusAreaCharLimit = 9_000
|
@@ -40,8 +39,9 @@ export class FocusAreaContextExtractor {
|
40 | 39 | importantRange = editor.document.lineAt(importantRange.start.line).range
|
41 | 40 | }
|
42 | 41 |
|
43 |
| - const names = await this.findNamesInRange(editor.document.getText(), importantRange, editor.document.languageId) |
44 |
| - |
| 42 | + // TODO: call findNamesWithInExtent from @aws/fully-qualified-names |
| 43 | + // after promise not resolving issue is fixed |
| 44 | + const names = {} |
45 | 45 | const [simpleNames] = this.prepareSimpleNames(names)
|
46 | 46 | const [usedFullyQualifiedNames] = this.prepareFqns(names)
|
47 | 47 |
|
@@ -222,37 +222,6 @@ export class FocusAreaContextExtractor {
|
222 | 222 | return document.getText(range)
|
223 | 223 | }
|
224 | 224 |
|
225 |
| - private async findNamesInRange(fileText: string, selection: Range, languageId: string) { |
226 |
| - fileText.replace(/([\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])/g, '') |
227 |
| - const startLocation: Location = new Location(selection.start.line, selection.start.character) |
228 |
| - const endLocation: Location = new Location(selection.end.line, selection.end.character) |
229 |
| - const extent: Extent = new Extent(startLocation, endLocation) |
230 |
| - |
231 |
| - let names: any = {} |
232 |
| - switch (languageId) { |
233 |
| - case 'java': |
234 |
| - names = await Java.findNamesWithInExtent(fileText, extent) |
235 |
| - break |
236 |
| - case 'javascript': |
237 |
| - case 'javascriptreact': |
238 |
| - case 'typescriptreact': |
239 |
| - // Disable Tsx.findNamesWithInExtent because promise Tsx.findNamesWithInExtent |
240 |
| - // may not resolve and can cause chat to hang |
241 |
| - //names = await Tsx.findNamesWithInExtent(fileText, extent) |
242 |
| - names = undefined |
243 |
| - break |
244 |
| - case 'python': |
245 |
| - names = await Python.findNamesWithInExtent(fileText, extent) |
246 |
| - break |
247 |
| - case 'typescript': |
248 |
| - //names = await TypeScript.findNamesWithInExtent(fileText, extent) |
249 |
| - names = undefined |
250 |
| - break |
251 |
| - } |
252 |
| - |
253 |
| - return names |
254 |
| - } |
255 |
| - |
256 | 225 | private prepareFqns(names: any): [FullyQualifiedName[], boolean] {
|
257 | 226 | if (names === undefined || !names.fullyQualified) {
|
258 | 227 | return [[], false]
|
|
0 commit comments