Skip to content

Commit

Permalink
Chore: Improve bb imports
Browse files Browse the repository at this point in the history
  • Loading branch information
idillon-sfl committed Jan 8, 2024
1 parent 7ccb76a commit 5d1bb37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/src/language/middlewareDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ const getDefinitionOfD = async <DefinitionType extends Location | LocationLink>(
return await redirectDefinition(definition, dRange, dataSmartPosition)
}

export const eRange = new Range(4, 0, 4, 1) // Where `e` is located in the embedded language document
export const eventPosition = new Position(4, 12) // Where `Event` (event.Event()) is reachable in the embedded language document
export const eRange = new Range(3, 0, 3, 1) // Where `e` is located in the embedded language document
export const eventPosition = new Position(3, 14) // Where `Event` (event.Event()) is reachable in the embedded language document

// Handle `e` in `e.data.getVar('')`
const getDefinitionOfE = async <DefinitionType extends Location | LocationLink>(
Expand Down
10 changes: 4 additions & 6 deletions server/src/embedded-languages/python-support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ import { insertTextIntoEmbeddedLanguageDoc, initEmbeddedLanguageDoc } from './ut
import { type EmbeddedLanguageDoc } from '../lib/src/types/embedded-languages'

export const imports = [
'import bb',
'from bb import data_smart',
'd = data_smart.DataSmart()',
'from bb import event',
'e = event.Event()',
'import bb, bb.build, bb.compress.zstd, bb.data, bb.data_smart, bb.event, bb.fetch2, bb.parse, bb.persist_data, bb.process, bb.progress, bb.runqueue, bb.siggen, bb.utils',
'import oe.data, oe.path, oe.utils, oe.types, oe.package, oe.packagegroup, oe.sstatesig, oe.lsb, oe.cachedpath, oe.license, oe.qa, oe.reproducible, oe.rust, oe.buildcfgoe',
'd = bb.data_smart.DataSmart()',
'e = bb.event.Event()',
'e.data = d',
'import os',
'import oe.data, oe.path, oe.utils, oe.types, oe.package, oe.packagegroup, oe.sstatesig, oe.lsb, oe.cachedpath, oe.license, oe.qa, oe.reproducible, oe.rust, oe.buildcfgoe',
''
].join('\n')

Expand Down

0 comments on commit 5d1bb37

Please sign in to comment.