11
22import { commands , SymbolKind , window } from 'vscode' ;
3- import allApplications from '@dbux/data/src/applications/allApplications' ;
3+ // import allApplications from '@dbux/data/src/applications/allApplications';
44import UserActionType from '@dbux/data/src/pathways/UserActionType' ;
55import { newLogger } from '@dbux/common/src/log/logger' ;
66import { emitEditorAction } from '../userEvents' ;
7- import { getOrCreateTracesAtCursor } from '../codeUtil/TracesAtCursor' ;
7+ // import { getOrCreateTracesAtCursor } from '../codeUtil/TracesAtCursor';
88import { codeRangeToBabelLoc } from '../helpers/codeLocHelpers' ;
99
1010/** @typedef {import('@dbux/projects/src/ProjectsManager').default } ProjectsManager */
@@ -21,7 +21,7 @@ const defaultNewEventLineThreshold = 8;
2121 * @param {ProjectsManager } manager
2222 */
2323export function initCodeEvents ( manager , context ) {
24- const traceAtCursor = getOrCreateTracesAtCursor ( context ) ;
24+ // const traceAtCursor = getOrCreateTracesAtCursor(context);
2525 let _previousSelectionData , _previousVisibleRangeData ;
2626
2727 window . onDidChangeTextEditorSelection ( async ( e ) => {
@@ -37,7 +37,6 @@ export function initCodeEvents(manager, context) {
3737 return ;
3838 }
3939
40- // TODO?: take only first selection only. Do we need all selections? Can there be no selections?
4140 const firstSelection = e . selections [ 0 ] ;
4241 let data = {
4342 file : e . textEditor . document . uri . fsPath ,
@@ -83,26 +82,26 @@ export function initCodeEvents(manager, context) {
8382 // ###########################################################################
8483
8584 async function getExtraEditorEventInfo ( editor ) {
86- const trace = traceAtCursor . getMostInner ( ) ;
87- let staticTrace = null ;
88- let staticContext = null ;
89- let applicationId = null ;
90- if ( trace ) {
91- const { staticTraceId } = trace ;
92- ( { applicationId } = trace ) ;
93- const dp = allApplications . getById ( applicationId ) . dataProvider ;
94- staticTrace = dp . collections . staticTraces . getById ( staticTraceId ) ;
95- staticContext = dp . collections . staticContexts . getById ( staticTrace . staticContextId ) ;
96- }
85+ // const trace = traceAtCursor.getMostInner();
86+ // let staticTrace = null;
87+ // let staticContext = null;
88+ // let applicationId = null;
89+ // if (trace) {
90+ // const { staticTraceId } = trace;
91+ // ({ applicationId } = trace);
92+ // const dp = allApplications.getById(applicationId).dataProvider;
93+ // staticTrace = dp.collections.staticTraces.getById(staticTraceId);
94+ // staticContext = dp.collections.staticContexts.getById(staticTrace.staticContextId);
95+ // }
9796 const symbol = await getSymbolAt ( editor . document . uri , editor . selections [ 0 ] ?. start ) ;
98- const { sessionId } = manager . practiceSession ;
97+ // const { sessionId } = manager.practiceSession;
9998
10099 return {
101- applicationId,
102- staticContext,
103- staticTrace,
100+ // applicationId,
101+ // staticContext,
102+ // staticTrace,
104103 symbol : convertVSCodeSymbol ( symbol ) ,
105- sessionId
104+ // sessionId
106105 } ;
107106 }
108107}
@@ -115,7 +114,7 @@ function convertVSCodeSymbol(symbol) {
115114 if ( symbol ) {
116115 return {
117116 name : symbol . name ,
118- range : codeRangeToBabelLoc ( symbol . range )
117+ loc : codeRangeToBabelLoc ( symbol . range )
119118 } ;
120119 }
121120 else {
0 commit comments